Python and arduino program to map a surface with a cheap dial indicator and a 3D printer running marlin firmware. I am not responsible for any damage to hardware when doing this. Proceed at your own risk
- Cheap chinese digital dial indicator with an "RS232" connection
- Arduino Nano or equivalent
- A computer to send the data too
- Soldering Iron
PLEASE, PLEASE, PLEASE ensure that all connections made are not shorting out. If they short out, you could damage your arduino or your indicator in the process!
This is for if your indicator has a Micro USB port on it that has the capability for the RS232 connection (Double check the seller page to ensure it has the connection, if not you may have to use the other section below
There are two methods, see each below and decide what you want to do.
You will need:
- USB A female breakout board OR the ability to cut and solder wires from a Micro USB cable.
You will need wire the following breakout board pins to the arduino:
GND -> GNDD+ -> Pin A0D- -> A15v (sometimes labeled VCC or VBus on the board) -> 5v
Once cut, the cable should have at least 4 wires we need. You need to wire the cable to the following arduino pins:
Black (GND) -> GNDGreen (D+) -> A0White (D-) -> A1Red (5v) -> 5v
I used some spare prototyping board and some pin headers to solder the cable to a convient ghetto breakout board that I could use dupont connectors to connect to the arduino
This is for if your indicator has an open port on the side for access to the data lines.
You will need:
- Thin gauge wire (18-24 AWG is probably good)
- Soldering iron and Solder
- Tools to dissassemble the indicator if needed (probably needed)
There should be 4 solder pads inside the indicator, you will need to solder wires to 3 out of the 4 pins.
Solder wires to: DATA, CLOCK, GND
Once wires are attached, you need to connect them to the arduino in the following way:
GND -> GNDDATA -> A0CLOCK -> A1
Open the .ino file in the arduino IDE and select the correct COM port, and arduino version. Then just upload the sketch and it should be ready to go.
The arudino code is modified from a project by Paweł Stawicki. You can see it hosted on github here
The python script is written for Python 3.8 or newer. Please ensure you install a version that is 3.8 or newer.
printrunscipymatplotlibpycairo
Install dependencies using pip install printrun scipy matplotlib pycairo or python -m pip install printrun scipy matplotlib pycairo
python surface_mapper.py