Digital read out (DRO) using an Arduino and a digital caliper

Поделиться
HTML-код
  • Опубликовано: 27 авг 2024

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

  • @m.l.5284
    @m.l.5284 Год назад +1

    Very interesting. A while back, I did a similar project: connected a cheap height measuring gauge in a similar way, to an ESP8266, and mounted the gauge, together with the ESP to my CNC router tool head. Then I run gcode on the CNC router, to measure heights, across a X/Y-matrix. The ESP sends the height data via Wifi to my PC, which computes a height map of the CNC workspace, which is used on the PC to compute the Z-compensation over the CNC-code, before the milling process is started on the CNC machine. It gives me much better milling results, especially for PCB-milling, because the the very precise compensation for any height deviations on the CNC-bed or the PCB coper surface. Reading values from the X/Y matrix takes 1.5 seconds per point, or ~5 min for a larger PCB with ~150 measurement points. So, it's quick, precise and greatly improves milling results. I am still using this mechanism. Doing the same measurement manually, by reading values from the gauge display, would take me hours for each milled PCB, so it's definitly worth to do this automation.

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

      Thank! Really nice project. It sounds somewhat similar to the BLTouch module used in 3d printers. It is also used to map the uneven surface of the printing bed to correct the position of the printing nozzle. The distance is measured in a different way using the number of steps on the stepper motor to bump into the surface, but the purpose is the same.
      Spending 5 extra minutes (even more) to get a perfectly milled PCB is definitely worth it! These cheap digital calipers can be used as really powerful tools.

    • @m.l.5284
      @m.l.5284 Год назад +1

      @@CuriousScientist Interesting. I didn't know about the BLTouch. Just looked it up. Yes, the process is similar, and the method for the measurement is different. The BLTouch would probably not work for my CNC router, because there is no accessable point to connect such a device to the CNC. Hence, I process all height compensation on the PC. The only chance, I see, is modifying the firmware of the CNC, to read additional jnput wires. I didn't want to touch the firmware of the router, so far, so I worked around that. Could be one of my next projects.

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

      Yes, the BLTouch requires a bit hacking if the hardware is not prepared for it from the beginning.
      Furthermore, just as an interesting stuff, I recommend you to look at the leveling procedure of Prusa printers. It has some (9) built-in magnetic areas on the printing bed and when you auto-calibrate the printer, it checks the height of these 9 points and readjusts the printer accordingly. There are plenty of smart solutions out there.

  • @alanesq1
    @alanesq1 4 месяца назад +1

    I recently built myself a 3-axis DRO for my mill and lathe using these calipers which may be of interest
    "Super cheap Digital Readout (DRO) for lathes, milling machines etc."

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

      Nice! Yes, these cheap calipers could be nice for simple DROs. If you are not looking for high precision things and have a tight budget, they are really useful.

    • @alanesq1
      @alanesq1 4 месяца назад +1

      @@CuriousScientist Hi. Yes, I wanted a DRO but couldn't really justify the expense especially as I wanted two and I didn't even know if I would like having a DRO. Turns out I don't know how I used my lathe without one now - lol

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

    A couple of transistors make a cheaper level shifter (it is unidirectional) and a third as an emitter follower can provide the power. Cheaper, simpler, smaller.

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

      I worked with what I had at home. But you're right, that since we only read, it is probably enough to have some unidirectional shifting.

  • @v.r.kudale4055
    @v.r.kudale4055 2 года назад +1

    It is working well. Thank you very much for your nice teaching ablities.

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

      Thank you! It is good to hear such a positive feedback!

  • @titigermain
    @titigermain 9 месяцев назад

    Perfect video - Many thanks for your very clear description. So I subcribed to your channel.
    One remark (in the positive way) = it seems to be an small error. In the circuit, you mention D4 and D5. In the code, you refer to D2 and D3. Never mind.
    I have looked for a solution to add a push button to transfer data in CAO program, (like Fusion 360) but until now I have not found the solution.
    best regards from France

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

      Thanks! You can assign any pins for data and clock so it does not really matter which pin pairs you pick.
      At work I use some Mitutoyo calipers and they have a Bluetooth module that can send the data straight to an Excel cell, for example. I was thinking to make a DIY version of such a device, but I have other priorities, so so far I haven't worked on it.

    • @titigermain
      @titigermain 9 месяцев назад +1

      As I subscribed to your channel, I 'll get a notification as soon as you put the device on line
      @@CuriousScientist

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

      Thanks for subscribing! I hope I will manage to develop something and you'll like it.

  • @Etapa_Montecristi
    @Etapa_Montecristi 3 года назад +1

    Me ayudó mucho tu vídeo Bro, saludos desde Ecuador

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

      Thank you!

    • @Etapa_Montecristi
      @Etapa_Montecristi 3 года назад

      @@CuriousScientist hey bro!
      I need you help, plis. In my project i have the same calibrador, but the difference that is I need save data in MicroSD and show this information in a LCD.
      Have you any idea to do this code in Arduino nano?

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

      Hey! I have other video where I save the data of a thermometer to an sd card. You can use that code as an example.

    • @Etapa_Montecristi
      @Etapa_Montecristi 3 года назад +1

      @@CuriousScientist thanks bro

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

      @@Etapa_Montecristi You are welcome! It is this video: ruclips.net/video/eWZP44vS7cU/видео.html You just have to replace the name of the variable in the file.println() method and basically that's all.

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

    Hey, can you post updated links to the products you used here? You don't mention what exactly they are in the video and there aren't links for them on your site.

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

      Hi! Sorry, which product are you interested in?

    • @pyroveus5408
      @pyroveus5408 5 месяцев назад

      @@CuriousScientist I found them on Amazon, but the logic level shifter and the voltage step-down module. Neither of their product pages on your site show what’s in this video

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

      Those are very generic parts, so I did not bother putting them on my website. People anyway don't use the links I provide because they buy it from Amazon. 🙃

  • @Tobby4063
    @Tobby4063 11 месяцев назад +1

    Awesome video!!

  • @easymoneysniper5068
    @easymoneysniper5068 3 года назад +1

    Great! Thank you.

  • @mukm5255
    @mukm5255 3 года назад +2

    Great presentation thank you.
    I tried to format the code for lcd 1602 12c but I can't because I'm new to arduino. I like it because I would use this on a mini lathe.
    Can anyone help me.
    Thanks in advance for your help.

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

      Thanks! What do you exactly want? Do you want to display the same data on the mentioned LCD?

    • @mukm5255
      @mukm5255 3 года назад

      @@CuriousScientist Yes thanks

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

      Check my other videos where I use that display and see how I did it. I explain each code line by line, so if you take the time and watch it, you can learn it.

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

      I'm also here to apply this knowledge to my mini lathe 😀

  • @codymack6343
    @codymack6343 4 года назад

    Great tutorial!

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

    Rather than using level shifters, would the anolog inputs ADC be fast enough to read the serial?. And then just use a resistor voltage divider to power it from 5v. And similarly use the 5v arduino digital outputs via a voltage divider to "drive" the zero and inch/mm buttons. Also to keep the caliper board awake, you could periodicaly double pulse the inch/mm button if no change has been seen within a period. obviouslly hide the result on display during the awake pulse.
    Good stuff :D

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

      Hi! Good idea, but I honestly don't know if the ADC would be able to catch up with the serial speed. But the level shifter is such a cheap part that in my opinion it does not worth the struggle with the coding. The awake pulse is a neat idea I like it!

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

      @@CuriousScientist Hi, I did use arduino to read from a digital Gauge, same like here (clk and data). Arduino internal comparator - input can be routed to ADC analog multiplexer and you can route the comparator + input to ATMega 1.1V internal bandgap reference. So 1.5Volt logic "1" in the selected analog input will drive the comparator output to "0" and 0Volt logic "0" will drive the comparator to "1" only need invert this result and put the analog mux to the analog input you need read, could be CLK to A0 pin and Data to A1 pin. This way you dont need any component neither do dirty analog tricks. You got a clean comparator digital output. Only thing is you need mess with the registers to route the comparator inputs, and put the analog mux to the analog input you need to read before take the comparator input. Enjoy!!

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

      Hi! Wow this is a fantastic trick, thank you for telling me about it. I have never heard about this method, so I will take a closer look on it and try to implement it. I definitely need to learn this. Thanks!

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

      @@CuriousScientist The bad thing is I think ESP32 (which is very popular to replace the Arduino) do not have internal comparator. Maybe I am wrong .

  • @anandh1967
    @anandh1967 4 года назад +1

    Thank you sir does this setup will support all calipers?

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

      Hi! I am glad to help! As long as your digital caliper has the SDA and CLK outputs, yes. And as far as I am concerned most of the digital calipers use the same standard. Look for a small door on the cover of the caliper. If there are four connections beneath the cover, that should be the digital connection. It is advised to check the manual for the pins (which is which). If you use these Chinese cheap calipers, they are the same (I disassembled several), but if you want to do the same with a precious Mitutoyo, then do everything very carefully!

    • @anandh1967
      @anandh1967 4 года назад

      @@CuriousScientist thank you for your response sir, please upload full video detailing the code with serial monitor. I'm currently working on this project sir. rarohith1988@gmail.com it's my mail id if possible please send the code sir.

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

      @@anandh1967 read the description, the code is freely available. I shared it via PasteBin.

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

    Check the output from your chosen device before investing time on this- the linear device (not a caliper, but the same electronics) that I tried turned out to have a data output that was entirely random. Set to zero, I would get a different reading every time. Checked with a 'scope, and sure enough the bit pattern was random. A couple of hours wasted...

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

      Sure, it is always worth to check the output signal of the caliper. Most of them have similar output signals (like this one), but some of them differ.

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

      @@CuriousScientist It did not just differ- the output kept changing without the slide being moved- so it was impossible to use the signal.

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

      If it is constantly changing, then something is wrong with the caliper itself. At a certain position, it should give the exact same output.

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

      @@CuriousScientist That was my point. It does not. The data pulses are correctly aligned to the clock pulses, but the values change, a large amount, for every reading without any movement. This is confirmed with a 'scope, so it is not software error. The device screen readings are correct. The device is clearly defective, either in this instance or by design. Hence my warning not to invest time in such a build without confirming that the device works.

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

      @@Tensquaremetreworkshop are you sure your connections were good? I assume they use those leads at the factory for QA. If your caliper still works (normally, with it's own display) the most likely cause of things jumping around seems likely to be the connection to the leads isn't solid/stable, might even be intermittently touching two or something. Maybe you already checked that really carefully, please don't take offense at the suggestion!

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

    can i use the same technique for a digital micrometer?

  • @alejandroramirez3908
    @alejandroramirez3908 3 года назад

    Hi, do u know to disable the auto off feature? after a few minutes my caliper turn off and i lose the zero

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

      Hi! Unfortunately, I don't know, sorry. I haven't checked this feature.

  • @maxk4324
    @maxk4324 3 года назад

    Could you explain how you got a logic level shifter that is designed for a minimum low level input voltage of 1.8V to work using a 1.5V low level input? (these specs are taken from the product link you provided for the level shifter)

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

      Hi! Other than "it just works", I have not better explanation, I haven't actually paid attention to these nuances to be honest. I guess that the 1.5 V is close enough to 1.8 V, so it is considered as high by the circuit and it behaves accordingly.

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

      It is called specification tolerance. In other words, you are taking a risk. Using a bi-directional level shifter is over-kill; there are simpler and cheaper ways.

  • @codymack6343
    @codymack6343 4 года назад

    How can I add a push button and input the readings to SolidWorks for 3d modeling?

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

      Good question. Unfortunately, I don't know how to channel the measurements into Solidworks. I can't try it either since I don't have that software. Push button should be easy. Just write a function which works with one of the attachinterrupt compatible legs. Or, you can do it with any regular pin too, but then you have to restructure the code a bit.

    • @maxk4324
      @maxk4324 3 года назад

      Read this comment on a computer rather than a phone in order for the code snippets I've included below to look right without weird wrap around text throwing off the spacing.
      First review the instructions at this link then return here:
      help.solidworks.com/2019/english/SolidWorks/sldworks/hidd_curve_in_file.htm
      It doesn't say but I can tell you right now that for the text file the format is the following. The first column are the X coordinates of each point on the curve, the second column is the corresponding Y coordinates, and the third column is the Z coordinates, separate each column by a comma when generating the file from your script (this step comes later) and make sure that the units in your solidworks part match the units of your data or vice versa. Each line of the text file is now a coordinate for a point in 3D space. Make sure that all the data goes in order from one end of the curve to the other because solidworks assumes you are giving it a path. For example if row 5 shows values for a point between rows 2 and 3 it will not rearrange the row order to make a neat curve, it will just make the curve double back on itself and it will look all wrong so make sure the points are in order from one end of the curve to the other. If you are only measuring 2 or 1 axis do not worry, just leave that coordinate as 0 on every row, but you can not omit a column. It must be a text file with 3 comma separated columns of numerical data with no header text, any deviation from this will not be importable.
      Anyway now that you understand that system now go on to read through the response posted by Nikolaus Gradwohl as well as all of the comments under his answer at the following link, then return here for some more detail:
      electronics.stackexchange.com/questions/54/saving-arduino-sensor-data-to-a-text-file
      The processing script will be running on your computer, incase that was unclear in his answer and from the comments below his answer. Now if you just copy the script it will not work for you. What you need to do is a bit of data formatting before the arduino sends the data to the computer. Once your arduino has collected all the data you want to send over you need to funnel it all into a single string variable which Nikolaus calls "value", but its actually a string, not an int or a float. However this is better for us since we need to do some formatting before sending it and doing that in a string will make writing the text file later easier. Rather than sending over one value at a time, first create a string that combines the data into the same format which solidworks is expecting to see in each row of the text file ( symbols to indicate mid-code comments that should be interpreted by you and not just copied right into your final code):
      //Initialize all variables
      X_raw = ;
      Y_raw = ;
      Z_raw = ;
      X_string = String(X_raw, );
      Y_string = String(Y_raw, );
      Z_string = String(Z_raw, );
      output = X_string + "," + Y_string + "," + Z_string;
      Serial.println(output);
      //End of code
      The above is what you would have the arduino board running in its loop method, you can add whatever bits and bobbles of functionality you wish but as long as you address all the comments that call for you to interpret my instructions or make a decision on something you should be good. Then you can basically use Nikolaus' script running on your computer to save what the arduino is sending over into a text file with each new entry being a new line of the text file (this is what "ln" in the "println" statement does). Unless you have a servo controlled system and you time it to take measurements at even intervals you are likely going to want to only have it send over a coordinate once you click a button or something so that you can first adjust your set up to take the next measurement. Solidworks will do absolutely zero filtering of the data. If the first 20 out of 100 rows of data are the same values because you started sending data at a fixed rate but then fumbled when going to operate the physical mechanism by hand it will not just chop off the first 19 rows for you, it will make a curve where the first 20 of the data points are located at the same point in space and it will not be clear until you try and make a drawing or 3D shape with it.
      Finally, as stated earlier, if you are only measuring 1 or 2 axes, you still need to send over x y and z values, just replace the line where you read and store the decimal value of the unused axis with a line setting the raw axis value to 0, the rest of the code can be left as is. Sorry if this has bugs, I can't debug properly without the hardware in hand but I'm sure its close enough for you to debug on your own without much issue. Also here are some extra resources I looed at while writing this explanation:
      Converting floats to strings:
      www.arduino.cc/reference/en/language/variables/data-types/stringobject/
      Issues that can arise when concatenating numerical values into strings:
      www.arduino.cc/en/Tutorial/BuiltInExamples/StringAdditionOperator

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

    Interesting.. is it possible to zero the caliper from arduino too?

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

      As far as I know, no, because the communication is unidirectional. The caliper only sends the data, but it doesn't receive anything.

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

      @@CuriousScientist Understood. Thanks for your swift response. im subscribing now.. :)

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

      You're welcome!

  • @anandh1967
    @anandh1967 4 года назад

    Sir LM7805 converts output as 5v but we want only 1.5v how to do it?

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

      The currents are likely to be very low, so after the voltage regulator, you can build a voltage divider using simple resistors. Then you can choose the appropriate values of resistors for R1 and R2 to convert the 5V down to ~1.5V. If you have R1=12k and R2=4.7k (I chose standard values from the E-series, so you can directly buy these), the voltage should be dropped down to ~1.4V. That should be perfectly sufficient to run the caliper. Otherwise, you can also simply use a potmeter to drop the voltage, I tested it just now with a 47k potmeter and it works fine. If you use a potmeter, first set the (potmeter's) output voltage to ~1.5V, then connect the caliper to it. This will further drop the voltage to ~1.1-1.2V. You can carefully adjust your potmeter back to 1.5V, if it is necessary, but my caliper (the one in the video) was working fine with the lower voltage as well. The best potmeter for this purpose would be a trimmer potmeter, because you can adjust it with a screwdriver and leave it like that. Or, finally, I added another product to the description which you can buy to convert the voltage to the desired value (you do not have to buy it via the link, but at least you can see the product and you can decide where you want to buy it).

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

    INPUTS internal pull-up + rezistor
    Vcc rezistor + 2 diodes
    enought?

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

      Sorry, but I have no idea what you are talking about. Could you clarify your question please?

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

      @@CuriousScientist
      Arduino input with internal pull-up --- rezistor --- DATA
      Arduino input with internal pull-up --- rezistor --- CLK
      +5V - rezistor - 1.5 V --|>|-- --|>|-- GND ( --|>|-- diode), capacitor? ( remove batery )
      beter resolution for mm or inch?

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

      It is really hard to understand your comment, especially if you decide to edit it hours after you've written it...
      First of all, if you enable the internal pullup (pinMode(INPUT_PULLUP)), you don't need an extra "rezistor", except if you want to drop voltage. But in that case, just use a level shifter instead. They are cheap and widely available. The resolution is the same for both units, it does not matter. The DRO puts out the exact same number and actually, there is an extra bit that decides whether the value is in inches or mms. But this does not affect the resolution. Actually, I will release another DRO video really soon, you should check it once it is available. There, I will explain everything in very details and it will be applicable to this DRO as well.

  • @whiletr
    @whiletr 7 месяцев назад

    What if the caliper circuit is powered via divider, so its logic is somewhere in the middle of 3.3v ? Will it work?

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

      You should not power any circuit with a voltage divider. Use LDO or buck converter. If the signals need voltage drop, use a level shifter.

  • @qrubmeeaz
    @qrubmeeaz 7 месяцев назад

    Can't see anything.