¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Arduino based DRO using cheap Calipers #ARD #DRO


 

Oh, forgot to add, here is the ino file saved as a .txt file. I don't have the Arduino development software, but others might want to read the code...

Chuck - if you want your circuit drawn up, I would do that if you want. If you have a paper drawing, take an photo of it and email it to me privately ( johndurbetaki@... ) and I'll send you back a pdf of an OrCAD drawing.

Buffalo John


On Wed, Nov 27, 2019 at 7:40 AM BuffaloJohn via Groups.Io <johndurbetaki=[email protected]> wrote:
If I understand your code, you receive a start bit and then a value of 20 bits (LSB first) followed by a sign bit and then a few bits you discard. Then, you take the value and convert it to a float and divide by 100. to make the result be 2 decimal place mm.

Since we know 1 inch equals 25.4 mm (exactly), if you were to take result (mm) and divide by 25.4, you would have inches. result is already a float, so the decimal point would be correct.

Add this to the end of your code before the 1 second delay:

? result=(result)/25.4; ? ? // convert to inches
? Serial.print(result,3);??? //print result with 3 decimals
? Serial.println(" in");

Buffalo John

On Wed, Nov 27, 2019 at 4:12 AM Chuck Pickering <chunk07@...> wrote:



In the pic, the breadboard next to the mouse has the logic shifting circuit to shift the caliper data and clock from 1.5v to 5v logic. The other breadboard has the adjustable 1.5v regulator to power the caliper. The leads connected to the caliper are soldered to the pads in the data port, as I have not yet found a cable to plug into the port. I am working on a 3d printed connector.
For the code, I pieced together bits from several websites, and have 3 working sketches. One just outputs the data stream as 1's and 0's, which I used to see which bits represented a + or - reading, and which bit represented inch or mm units. The other two output the caliper measurement in decimal,? one for mm, one for in. I hope to combine those two into one sketch.To give you an idea how it works, here's the sketch that displays the measurement in mm. The in/mm switch must be in mm .

Join [email protected] to automatically receive all group messages.