300 mm DRO with Arduino (ATTiny85 and Nano)

Поделиться
HTML-код
  • Опубликовано: 20 авг 2024
  • In this video I show you a nice DRO with a great range (300 mm) and good resolution (0.01 mm).
    I “hacked” the DRO and was able to hijack its data and clock signal and convert it into human readable values using an ATTiny85 microcontroller. I made my own tiny display unit for this DRO and the principles I used is applicable to similar DROs and digital calipers as well as any Arduino-compatible microcontrollers.
    Resources: curiousscienti...
    If you want to buy the things I used in the video and support me at the same time, please consider using my affiliate links on my website:
    curiousscienti...

Комментарии • 46

  • @CuriousScientist
    @CuriousScientist  2 года назад +4

    Hey! Please make sure you check my website (link is in the description)! I did some improvements to the code and I also uploaded a "pure" Arduino code that you can directly upload to a Nano or Uno without any modifications. Cheers!

  • @Tensquaremetreworkshop
    @Tensquaremetreworkshop Год назад +2

    Excellent information, this has saved me considerable time on my current project. One small point- your code line 'convertedValue += (pow(2, i) * dro_bits[i]);' is incredibly computation intensive- and repeated 19 times. Bit-shifting is simpler, and assembling in a long (actually, 300mm only needs an int) before moving to a float will save considerable time. For scales under 600mm, only reading 16 bits, and bit shifting during reading [if (digitalRead(data) (unsigned int)rawData += (1

    • @CuriousScientist
      @CuriousScientist  Год назад

      Thanks, I am glad to hear that my project could save you some time! Also thanks for the feedback, I will consider this method in the future! I will have some more projects with this DRO, so I will try to have the new code for the future projects.

  • @vancehines562
    @vancehines562 2 года назад +1

    Excellent Video. around 6:00 6 Nibbles = 3 Bytes = 24 bits.

    • @CuriousScientist
      @CuriousScientist  2 года назад

      Thank you! Yup, basically that's what I tell in the video!

  • @isidoromaich7226
    @isidoromaich7226 2 года назад +1

    Amazing project! Great work you've done here. In the past I was watching the caliper2pc project but it never ended up to convinced me. I will be watching how this evolve.

    • @CuriousScientist
      @CuriousScientist  2 года назад +2

      Thank you! Using a PC for such a task is a bit of an overkill, but maybe the maker of that project had some other intentions. I will definitely post an update on this project as well as make something interesting out of this DRO.

  • @mousam_upadhyaya
    @mousam_upadhyaya 2 года назад +1

    Excellent thorough tutorial, I like the pace of tutorial and 15:28 - Nice lines 😃

    • @CuriousScientist
      @CuriousScientist  2 года назад +1

      Thank you very much! If you mean the flickering lines on the OLED display, it has something to do with the refresh rate and the camera frame rate. I noticed that at some angles, I cannot see this flickering. The value's refresh rate is much-much slower (1 fps), so it cannot be that, I guess.

    • @mousam_upadhyaya
      @mousam_upadhyaya 2 года назад +1

      @@CuriousScientist No, I am aware of flickering related to Refresh rate of the shutter😃. I was actually referring to the words you said..

  • @markmaker2488
    @markmaker2488 10 месяцев назад

    Great tutorial and explanation of how everything works, thank you!

    • @CuriousScientist
      @CuriousScientist  10 месяцев назад +1

      Thanks! I'm glad to hear that you like my way of explaining.

  • @jtreg
    @jtreg 5 месяцев назад +1

    Hi there, do you have Frizing diagram for the Nano circuit? I looked for it on your blog, only saw the one you did for ATTiny... but really nice video thank you!

    • @CuriousScientist
      @CuriousScientist  5 месяцев назад +1

      Hi! If you can't find it in the corresponding article, then it is most probably not available/does not exist. However, the circuit is the same anyway, you just need to use the connections for the Nano. The pins are written in the code.

  • @markmaker2488
    @markmaker2488 2 года назад +1

    Fantastic tutorial, thank you.

  • @jamesan2517
    @jamesan2517 Год назад +1

    I enjoyed your tutorial on the 300mm DRO. I do not see any level change cct, from 3.3V to 5V. I have adapted the cct. and sketch to Arduino Nano but clk and data signals are too low to trigger inputs without level changing. Could you explain how you get the Nano to work without level changing. Thanks.

    • @CuriousScientist
      @CuriousScientist  Год назад +1

      Hi! The circuit runs on the 3 V battery inside the DRO's box. There is no level shifting applied, it works directly connected to the ATtiny85 MCU. If the levels are too low, you will need some form of level shifting. If the signal would've been too high, you could've used a "dirty" method by dropping the voltage through resistors, but if the signal is too low, then you need to "amplify" it, so you need to level shift it.

  • @mrdebug6534
    @mrdebug6534 2 года назад +1

    nice & proper work + explanation 👌🏻 I only miss thy sync with the pause in the CLK signals to start at beginning of the 24 bits...
    maybe this was the binking the display in your Demo?

    • @CuriousScientist
      @CuriousScientist  2 года назад +1

      Thank you! I will check this in the code.

    • @CuriousScientist
      @CuriousScientist  2 года назад +1

      Hi! I think I managed to solve the issue and additionally improve the code. Now I can synchronize the DRO reading. I figured out the following procedure: I look for a section in the CLK signal where the signal is HIGH for more than 5 ms. Inside the clocking out part, where the 24 bits are clocked out the CLK is high for around ~400 us (the wider part that separates two 4-bit packages), so if the CLK was high for more than 5 ms, we can be pretty sure that we caught the longer CLK period between two 24-bit packages. After we caught the correct part of the CLK we just wait for the falling edge and continue the reading as it is shown in the video. Further improvement is that I only update the OLED when the DRO value is changed so there is no more blinking.

    • @mrdebug6534
      @mrdebug6534 2 года назад +1

      @@CuriousScientist very cool...👌🏻🍀I thought in similar solutions. is it more stable now?

    • @mrdebug6534
      @mrdebug6534 2 года назад +1

      @@CuriousScientist in your video, there were mis-reading. These should be ginge and away. how is the responsivness after the Change?

    • @CuriousScientist
      @CuriousScientist  2 года назад +1

      Thank you! It is super stable now (I kept it running for an hour approximately), there is no misreading. Also, it is very responsive. In fact, if you remove the timer part from the readEncoder() function, then it could become realtime. Of course, it will blink a little while the values change when you move the DRO, but once it is stopped, it is rock solid.

  • @petercohen8877
    @petercohen8877 6 месяцев назад

    Hello, thanks for the excellent video. Have you found out the reason for those strange incorrect readings and fixed the problem in the "pure" Arduino code?

    • @CuriousScientist
      @CuriousScientist  6 месяцев назад

      Hi and thanks! I suggest you to check my website, I wrote down all the answers for your questions there already. 😉

  • @rbgohome
    @rbgohome Год назад +1

    I am totally new to electronics, but working with 3D printers and laser engravers raised the wondering about how it all works.
    Already dreaming of creating my own tough and precise CNC milling machine; one of the concerns is precision of linear motion system for XYZ.
    Does the number of steps of a stepper motor, exactly results in the target position?
    Does the advances per step during a full stepper motor rotation, fluctuates?
    Already saw how to drive stepper motors with Arduino. Combined with your greatly appreciated information,
    allows to drive a stepper motor, capture the data stream of a DRO, and produce graphs/statistics about precision of the motion system and or components used.
    I will make time for this before the summer. Thank you for sharing this.

    • @CuriousScientist
      @CuriousScientist  Год назад +1

      Hi! I don't want to discourage you by any means, but if you are new to electronics, a _precise_ CNC milling machine would be an extremely difficult first build. You can simplify things by using premade kits and code (GRBL Arduino) and so on, but then you just need to wire up everything and assemble the mechanism. No programming or any special skills would be required then.
      The stepper motor goes to the target position very precisely. You said you are working with 3d printers... They can do sub-millimetre movements without any active feedback. They just need to perform a homing in the beginning, and their position is super stable. If the mechanical system (belts, screws, wheels, bearings....etc.) is good, there should not be any issues with skipped steps or inaccurate movements.

    • @rbgohome
      @rbgohome Год назад +1

      Thank you for warning me and showing me other options.
      But I like the difficult route with all the challenges.
      Bought a DRO exactly like yours but rebranded.
      Measuring the manual X axis advances of my milling machine by spindle, the DRO turns out pretty preciese.
      I'm creating adjustable belt tensioners for the XY axis of my 3D printer.
      When done I use the DRO to measure relation between belt tension and distance traveled, and tweak it to exactly right.
      Many print an object and start with scalling to get right size or alter the firmware steps per mm into even a float number; cannot be the way to go.
      I suspect belt tension is the problem as its the only thing in stack that brings along variables; the number of belt teeth per length being not exactly right.

  • @milanercegovic8413
    @milanercegovic8413 2 года назад +2

    Hello how are you. Videos are great to watch and well explained from start to finsh. I would like to install rotary encoder wirh a shaft directlly to lead or ball screw to achieve DRO insted magnetic or glass scale connected to a Bluetooth TouchDRO. Can it be done. Thank you.

    • @CuriousScientist
      @CuriousScientist  2 года назад

      Hi and thanks! Yes it is absolutely doable.

    • @milanercegovic8413
      @milanercegovic8413 2 года назад +1

      @@CuriousScientist Thank's for quick replay and great, building smalll hobby lathe stepper on Z and X Axis Omron 1800 PPR roary encoder for Spindle 100 line hand encoder 4 position joystic with center button, all electronics copied PCB Shield fitted on Arduino MEGA 2560. Don't know what you need to start project ,not in a hurry, Google Bluetooth TouchDRO to see if you have not seen it before, dont know if I am allowed to mention people or ther sites.

    • @CuriousScientist
      @CuriousScientist  2 года назад

      You are welcome!
      Of course you are free to mention anyone. The only thing I don't like when people put in extremely long links or source code in the comments because it messes up the readability of the other comments. But I am not against mentioning others. Perhaps we can learn something new from them. Why do you want to use a Mega? Two encoders can be perfectly handled with a Nano as well.

    • @milanercegovic8413
      @milanercegovic8413 2 года назад +2

      @@CuriousScientist Mega is used for software to run lathe, group of poeple at chipmaker developed it it's called ELS electronic lead screw , gears are replaced with steper motors Z and X axis, omron encoder 1800PPR connected to a spindle for thread cutting and feed per revolution, 100 line hand encoder to move axis 2 different speeds, joestick 4 position with limit stop and rapid movement, what I seen on RUclips it's been done well threads, feeds ,tapers, radius, angle. Vidio above 300 mmDRO with Arduino can bee connected to Bloutooth TouchDRO, see YuriysToys for more detail. I think to have Z and X readout to do turning or machining woud be great readout suports library for more tools if needed, up tu you what board are used to send data to TouchDRO.

  • @puneethpoduri
    @puneethpoduri 2 года назад +1

    I can hear a low frequency hum like a motor running. can anyone else hear that?

    • @CuriousScientist
      @CuriousScientist  2 года назад

      It is my microphone picking up some noise probably due to some ground loop issue. If you watch closely, the noise disappears when I touch the surface of the table. I am working on it, but it is not straightforward because sometimes there's no noise at all. I am planning to buy a better microphone because this one is a cheap one with a long cable, but these microphones are crazy expensive unfortunately.

  • @imlassuom
    @imlassuom Год назад

    I think the waiting for the start condition code is not correct, you may fall into the middle of any other falling edges ...

    • @CuriousScientist
      @CuriousScientist  Год назад

      It works for me so far, I get reasonable values. However if you could send me a better solution in email or something, I would be very happy.