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

  Рет қаралды 21,087

Curious Scientist

Curious Scientist

Күн бұрын

Пікірлер: 84
@RBgamesbr
@RBgamesbr 8 күн бұрын
In the hopes this helps somebody: I simplified the setup by using a voltage divider to get the 3.3v from my ESP32 to about 1.6 to feed the caliper. (One resistor between V+ of the caliper and 3.3v and an equal one between V+ and GND. Wired inside the caliper) Also I am using analog read on the esp to read the signals with no issue. Seems to be fast enough. Replicating this setup requires no external boards or components except 2 equal resistors of any value. Bonus it looks very sleek because its literally the 4 cables going straight to the ESP. I think this is an amazing way to get a fairly precise sensor for VERY little money.
@CuriousScientist
@CuriousScientist 8 күн бұрын
Sure it can work, but voltage divider is a really bad (worst) practice to adjust voltages... They are not stable whatsoever, so they might even damage the device that is being fed through them. Also, they waste power because they continuously draw current and generate heat. Sure, with carefully chosen values, you can minimize the losses, but you must keep in mind that the load (caliper) needs a certain minimum current, otherwise it won't work. Even if it works, it is not a good practice and it should not be encouraged.
@m.l.5284
@m.l.5284 Жыл бұрын
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 Жыл бұрын
@@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 7 ай бұрын
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 7 ай бұрын
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 7 ай бұрын
@@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 2 жыл бұрын
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 жыл бұрын
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 11 ай бұрын
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 11 ай бұрын
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 11 ай бұрын
As I subscribed to your channel, I 'll get a notification as soon as you put the device on line @@CuriousScientist
@CuriousScientist
@CuriousScientist 11 ай бұрын
Thanks for subscribing! I hope I will manage to develop something and you'll like it.
@maredu97
@maredu97 3 жыл бұрын
Me ayudó mucho tu vídeo Bro, saludos desde Ecuador
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Thank you!
@maredu97
@maredu97 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 жыл бұрын
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.
@maredu97
@maredu97 3 жыл бұрын
@@CuriousScientist thanks bro
@CuriousScientist
@CuriousScientist 3 жыл бұрын
@@maredu97 You are welcome! It is this video: kzbin.info/www/bejne/m4i9gWdqq7hqmbc You just have to replace the name of the variable in the file.println() method and basically that's all.
@Tobby4063
@Tobby4063 Жыл бұрын
Awesome video!!
@CuriousScientist
@CuriousScientist Жыл бұрын
Thanks!
@pyroveus5408
@pyroveus5408 7 ай бұрын
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 7 ай бұрын
Hi! Sorry, which product are you interested in?
@pyroveus5408
@pyroveus5408 7 ай бұрын
@@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 7 ай бұрын
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. 🙃
@easymoneysniper5068
@easymoneysniper5068 3 жыл бұрын
Great! Thank you.
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Hi! You're welcome!
@anandh1967
@anandh1967 4 жыл бұрын
Thank you sir does this setup will support all calipers?
@CuriousScientist
@CuriousScientist 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 жыл бұрын
@@anandh1967 read the description, the code is freely available. I shared it via PasteBin.
@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 Жыл бұрын
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 Жыл бұрын
@@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 .
@RBgamesbr
@RBgamesbr 8 күн бұрын
Just to help anyone wondering. I have managed to get it to work using analog read on an ESP32 with no issues. I used 1500 as the threshold for the read to have some margin.
@codymack6343
@codymack6343 4 жыл бұрын
Great tutorial!
@CuriousScientist
@CuriousScientist 4 жыл бұрын
Thank you!
@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 жыл бұрын
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 2 жыл бұрын
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.
@mukm5255
@mukm5255 3 жыл бұрын
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 жыл бұрын
I'm also here to apply this knowledge to my mini lathe 😀
@mutthunaveen
@mutthunaveen 2 жыл бұрын
Interesting.. is it possible to zero the caliper from arduino too?
@CuriousScientist
@CuriousScientist 2 жыл бұрын
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 жыл бұрын
@@CuriousScientist Understood. Thanks for your swift response. im subscribing now.. :)
@CuriousScientist
@CuriousScientist 2 жыл бұрын
You're welcome!
@Tensquaremetreworkshop
@Tensquaremetreworkshop Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
@@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!
@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.
@aleenamani1596
@aleenamani1596 3 жыл бұрын
can i use the same technique for a digital micrometer?
@CuriousScientist
@CuriousScientist 3 жыл бұрын
If it has a similar output, yes!
@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
@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 жыл бұрын
@@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 9 ай бұрын
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 9 ай бұрын
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.
@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).
@qrubmeeaz
@qrubmeeaz 10 ай бұрын
Can't see anything.
@CuriousScientist
@CuriousScientist 10 ай бұрын
Open your eyes. 😎
Displacement measurement with a linear potmeter - part 2
25:21
Curious Scientist
Рет қаралды 7 М.
Caliper and Arduino i2c - measure 3D filament
9:19
Electronoobs
Рет қаралды 120 М.
ЗНАЛИ? ТОЛЬКО ОАЭ 🤫
00:13
Сам себе сушист
Рет қаралды 4 МЛН
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 51 МЛН
When u fight over the armrest
00:41
Adam W
Рет қаралды 12 МЛН
Digital caliper battery drain prevention
23:06
Spare Time Repair
Рет қаралды 6 М.
Custom ATmega32u4 microcontroller board - 2024 version
10:30
Curious Scientist
Рет қаралды 3,6 М.
JCS-900 DRO with Arduino and LCD
24:20
Curious Scientist
Рет қаралды 10 М.
Inside a cheap set of eBay digital calipers
23:32
bigclivedotcom
Рет қаралды 686 М.
How Does A Digital Caliper Work?
12:27
learnelectronics
Рет қаралды 17 М.
Digital Readout DRO with digital caliper gauge (german)
24:48
Magnetic Switches - for $20 each!
20:42
The Warthog Project
Рет қаралды 449 М.
Big Stepper Motors with Arduino
29:43
DroneBot Workshop
Рет қаралды 1,2 МЛН
Digital Caliper HACK/MOD from 150mm to 650mm
14:54
Limi DIY
Рет қаралды 32 М.
ЗНАЛИ? ТОЛЬКО ОАЭ 🤫
00:13
Сам себе сушист
Рет қаралды 4 МЛН