Arduino analog gauge with stepper motor MK2

Поділитися
Вставка
  • Опубліковано 18 жов 2016
  • Arduino analog gauge with stepper motor let us to code several types of devices: thermometer, tachometer, speedometer, frequency meter etc. Custom gauge faces!
  • Наука та технологія

КОМЕНТАРІ • 14

  • @iuiz
    @iuiz 2 роки тому +1

    Nice work.
    Can this motor do more then one full turn and do you need an encoder?

    • @Dyr4ik
      @Dyr4ik  2 роки тому

      It can't make full turn, but it don't need an encoder.

  • @wv838
    @wv838 7 років тому

    Hey Dmitry, what kind of servo is that to move more than 180 degrees ? Thanks :-)

    • @Dyr4ik
      @Dyr4ik  7 років тому +1

      Stepper motor MR1107

    • @wv838
      @wv838 7 років тому

      My bad! For some reason I thought you were using a servo :-/
      Nice gauge !

    • @Dyr4ik
      @Dyr4ik  6 років тому +2

      Hello, wv838!
      Here is the code fo ATtiny 85 (Digispark) with Switec X25 library ( github.com/clearwater/SwitecX25 ) and IR sensor. Link to Patreon does not work because I've started new music project: www.patreon.com/RhythmsOfButtocks
      #include
      #ifndef cbi
      #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
      #endif
      #ifndef sbi
      #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
      #endif
      // standard X25.168 range 315 degrees at 1/3 degree steps
      #define STEPS (315*3)
      #define WIRE 4
      // For motors connected to pins 0,3,1,2
      SwitecX25 Gauge(STEPS,0,3,1,2);
      int i, result, pos = 0;
      int start_bit = 13000; //Start bit threshold (Microseconds)
      int repeat_bit = 11000; //Repeat bit threshold (Microseconds)
      int bin_1 = 2000; //Binary 1 threshold (Microseconds)
      int bin_0 = 1000; //Binary 0 threshold (Microseconds)
      const byte BIT_PER_BLOCK = 32;
      int data[BIT_PER_BLOCK];
      volatile byte state = LOW;
      uint32_t timer;
      byte mode = LOW;
      void setup(void)
      {
      Gauge.zero();
      pinMode(WIRE, INPUT);
      sbi(GIMSK,PCIE); // Turn on Pin Change interrupt
      sbi(PCMSK,PCINT4); // Which pins are affected by the interrupt
      }
      void loop(void)
      {
      if (state)
      {
      timer = micros() - timer;
      if (timer > start_bit) {i = 0;}
      else if (timer < repeat_bit)
      {
      if(timer > bin_1) //is it a 1?
      data[i] = 1;
      else if(timer > bin_0) //is it a 0?
      data[i] = 0;
      i++;
      if (i == BIT_PER_BLOCK)
      {
      result = 0;
      for(i = 16; i < 24; i++) {
      if(data[i+1] == 1) result |= (1

  • @joochiunglee351
    @joochiunglee351 Рік тому

    can you teach how to do ,i need analog rpm gauge diagram

  • @MrAvandalen
    @MrAvandalen 3 роки тому

    Hi, what transparant housing did you used?

    • @Dyr4ik
      @Dyr4ik  3 роки тому

      Custom laser cutted case.

  • @NesbyBone
    @NesbyBone 6 років тому +1

    Nice project, can you share the code? The patreon link its broken.

  • @fuscaazul3153
    @fuscaazul3153 3 роки тому

    hi, what kind of board did you use for this fucking project? hugs from Brazil

    • @Dyr4ik
      @Dyr4ik  3 роки тому +1

      Digispark (ATtiny85)

    • @fuscaazul3153
      @fuscaazul3153 3 роки тому

      @@Dyr4ik very good! of everything i saw, this was the best! Can you teach me how to do it?