digital multi-function measuring tool
I \'ve always wanted a device to help me level my 3D printer bed and there are a few other devices to help me get the approximate length of the curved surface, this way I can easily cut out the correct length pasted on that surface, thus preventing waste.
So I guess why not combine these two ideas and make a gadget that can do both ideas at the same time.
Finally, I built a device that can measure not only the curve and surface level, but also the distance and angle of the line.
So basically, this gadget is universal in a digital level ruler angle rollermeasure.
The device is small enough to fit in a pocket and can easily charge the battery with a mobile phone charger.
The device uses accelerometer and gyro sensors to accurately measure the level and angle of the surface, a sharp infrared sensor for measuring non-
Contact mode and encoder with wheels, which can be rolled on a surface or curve to obtain its length.
The characteristic through the device mode is to mark as M using the monthly touch button (mode), U (unit)and 0 (zero)M -
Select between different types of measurements
Select between unit mm, cm, inch and meter0
Reset the measured value to 0 after measuring the distance or angle.
The reason for using the touch button is to gently browse the mode and unit without interfering with the position of the device when measuring.
The bottom of the device is embedded with an nd magnet so that it does not slide or slide from the measured metal surface.
The housing is designed to make the device as compact as possible and also to facilitate 3D printing.
When choosing these components, remember that this device is designed to fit in your pocket.
So the smallest monitors, batteries and sensors I can find are all used. 1.
Case 2 for 3d printing.
Sharp gp2y0a4skir infrared distance sensor x1 (Aliexpress)3.
MPU6050 accelerometer/gyro module x1 (Aliexpress)4.
Boost charging module X 1 (Aliexpress)5.
Grove mouse encoder X 1 (Aliexpress)6.
128X32 OLED display X 1 (Aliexpress)7.
Arduino pro mini ATMEGA328 5 V/16 MHz X 1 (Aliexpress)8.
12mm buzzer X 1 (Aliexpress)9. 3.
7 v, 1000 mah lipo battery X 1 (Aliexpress)10.
Touch button module x3 (Aliexpress)11.
20X10X2mm nd magnet X 1 (Aliexpress)12.
USB to usb ttl module x1 (Aliexpress)13.
Enameled copper wire (Aliexpress)14.
10k resistor x215. 19(length)X2(dia)
Mm steel axis X 116. 3mm led X 117.
Any vinyl sticker roll (Aliexpress)18.
The micro USB cable MPU6050 is a microcomputer system device consisting of a 3-axis accelerometer and a 3-axis gyro.
This helps us to measure acceleration, speed, direction, and displacement.
This is a I2C-based device that runs on 3. 3 to 5v.
In this project, the MPU6050 is used to measure whether the surface is flat or not, and also to measure the angle of the line.
This is a mechanical incremental rotary encoder with rotation direction and rotation speed feedback data.
I use this encoder because it is the smallest encoder I can find and the programming part is also very easy.
This encoder rotates 24 steps each.
Using this, if the wheel diameter is known, we can calculate the distance the wheel moves on the encoder.
The calculation of how to do this will be discussed in the next steps in this manual.
This project measures the curve distance using an encoder.
This is an analog sensor that gives a variable voltage as output based on the distance between the object and the sensor.
Unlike other infrared modules, the color of the object being detected does not affect the output of the sensor.
There are many versions of the sharp sensor, but the range of sensors we use is 4-30 cm.
The sensor operating voltage is between 4. 5 to 5.
5 volts, only 12 mA current. The red(+)and black(-)
The wire is the power cord and the 3rd wire (
White or yellow)
Is the analog output line.
In this project, the sensor is used to measure the linear distance without contact. 1.
A pair of scissors.
Box cutter or any other super sharp blades3. tweezers4. Hot glue gun5. Instant glue (Like Super Glue)6.
Rubber-based adhesive (
Like fevi bonds)7.
Soldering iron and lead 8laser cutter9. 3D printer10.
Rotary tool with disc cutting bit11. Wire cutters12.
The case for this device was designed in Autodesk Fusion 360 software.
There are 3 pieces.
The STL files for these fragments are given below.
The \"lid\" and \"Wheel\" files can be printed without support, while the \"body\" files need support.
I printed these at 0.
\"With Green PLA fill 2mm of 100% layer height.
The printer used is TEVO tarantula. 1.
Smooth all the outer surfaces of the 3D print with fine sandpaper so that the vinyl sticker can be easily pasted. 2.
Use a damp cloth to remove all particles that may remain on the surface after grinding. 3.
After the surface is dry, apply a vinyl sticker on the surface.
Make sure there are no trapped bubbles. 4.
Use scissors to trim the extra stickers around the edges. 5.
Now put a sticker on the side of the shell and trim the excess. 6.
Cut holes in OLED display, charging port, encoder wheel and sharp infrared sensor using boxcutter or any other razor.
Warning: Be very careful when using sharp blades and tools different from Arduino nano, pro mini can\'t be programmed directly by plugging in a USB cable because it doesn\'t have built-in-
USB to serial TTL converter.
So for programming, we should first connect the external USB-to-serial converter to the pro mini.
The first picture shows how to make these connections. Vcc -5VGND -GNDRXI -TXDTXD -RXIDTR -
The DTR 2nd figure shows the complete circuit diagram of the project. D2 -INT MPU6050D3 -I/O (MODE)D5 -I/O (UNIT)D6 -I/O (ZERO)D7 -+(1)ENCODERD8 -+(2)ENCODERA0 -
Sharp IRA1-I/O+ BuzzerA4 -SDA (
OLED and MPU6050)A5 -SCL (
OLED and MPU6050)GND -
GND and boost modules for all modules and sensors
Boost module for USB port BBATTERY +B--BATTERY -
I took 3rd photos when creating the code.
This is a temporary setup for testing code, modules, and circuits.
It\'s optional for you to try. 1.
Apply instant glue to the magnet provided under the charging port hole in the cavity. 2.
Place the magnet in the cavity and hold it until the glue is not usedmagnetic.
When used on a metal surface, magnets help prevent the device from sliding or moving.
In order to make the equipment as small as possible, the mounting bracket of the sharp infrared sensor and encoder is cut off using a rotary tool with a cutting disc drill bit attachment. 1.
Mark the pin name on the back of the OLED display so that it can be properly connected later. 2.
Place the OLED display in the correct position as shown in the second picture.
The opening design of the display allows the display to enter the Wall slightly.
This ensures that the display is in the right position and direction and is not easy to move. 3.
Apply hot glue carefully around the display.
Hot glue is the first choice, because it is a bit like a shock absorber of the monitor and does not put pressure on the monitor when using it. 1.
Rubber-based adhesive is used. 2.
The adhesive is suitable for two surfaces. 3.
Make sure all welding points are facing the open side of the chassis and place the module in the specified position as shown in the figure. 4.
Stick the module and shell together for at least 2 minutes.
This is a module I took out from a cheap single battery power supply group.
The module has a battery protection circuit and a 5 v, 1 amp boost converter.
It also has an on/off button that can be used as a power switch for the entire project.
Use the soldering iron to remove the female USB port on the module and weld the two wires to the 5v and ground terminals as shown in figure 4.
Weld 2 male pins to B and B-
As shown in the first two pictures, then check if the module works with the battery.
Apply instant glue on the platform provided for the module and gently place the module to ensure that the charging port and opening are fully aligned. 1.
By heating the tip of the wire using a soldering iron or lighter, remove the coating of the enamelled copper wire until the insulation melts.
The wires are then carefully welded to the OLED display.
This is done now because it may be difficult to do this after the battery is placed. 2.
The battery slides under the platform of the boost module, making its wire connector oriented in the direction of the OLED display, as shown in the 3rd picture. 3.
The sharp infrared sensor is inserted into the slot provided for it. 1.
According to the circuit diagram provided, the USB to serial converter is welded to Arduino. 2.
Hot glue is used to glue the Arduino in the middle of the battery case. 3.
The wire is welded to the buzzer terminal, and then the buzzer is pushed into the circular cavity on the housing provided for it, as shown in Figure 7. 1.
The terminals of the encoder are cleaned using blades. 2.
Resistance welding is connected to the encoder. 3.
Circuit diagram of pure copper wire welded. 4.
The steel shaft is inserted into the wheel of 3D printing.
If the wheel is too loose, fix it with instant glue. 5.
Install the wheel into the encoder.
If it is loose, use instant glue again.
But this time, be very careful not to let any glue into the encoder mechanism. 6.
Place the encoder inside the housing so that the wheel is extended through the provided opening and make sure it rotates freely. 7.
Fix the encoder in place using hot glue. 1.
Circuit wiring is done according to the circuit diagram given in the previous \"circuit diagram\" step. 2. The +ve and -
The ve wires for all sensors and modules are connected in parallel with the power supply. 3.
Make sure that there is no wire blocking the view of the infrared module, and that there is no wire winding with the encoder wheel. 1.
Download the code and library provided below. 2.
Extract the library folder.
Copy these folders to the library folder in the \"Arduino\" folder in the computer \"My Documents (
If you are a windows user). 3.
Open the code provided (\"filal_code\")
Upload to Arduino in Arduino IDE.
Since the MPU6050 accelerometer/gyro module is just glued to the housing, it may not be the perfect level.
So follow the steps below to correct this zero error.
Step 1: plug the device into the computer and place it on the perfect level of surface you already know (
For example: tile floor)
Step 2: Enter the \"LEVEL\" mode on the device by touching the \"M\" button and note down the X and Y values.
Step 3: assign these values to the variables \"calibx\" and \"caliby\" in the code \".
Step 4: upload the program again.
The number of steps per rotation of the encoder shaft, N = 24-step wheel diameter, D = 12.
Wheel circumference 7mm, C = 2 * pi *(D/2)= 2*3. 14*6. 35 = 39.
898 mmTherefore, walk from each step = C/N = 39. 898/24 = 1.
6625mm if you are using wheels or encoders of different diameters, the number of steps is different, find the distance moving per mm by replacing the values in the formula above, once the resolution is found, enter this value in the formula in the code, as shown in the figure.
Compile and upload the code to Arduino again.
After the encoder calibration is complete and the modified program is uploaded, you can remove the USB to serial TTL converter module from the Arduino Pro Mini.
Things to test: 1.
If the charger can be plugged into the port easily and the battery is charging properly. 2.
Does the power on/off button work. 3.
OLED displays everything in the right direction and position at the right spacing. 4.
The touch buttons are all working and marked correctly. 5.
If the encoder gives a distance value when turning. 6.
The MPU6050 and sharp ir modules work fine and the readings are correct. 7.
The buzzer rang. 8.
Make sure nothing is heating inside when open.
If heating occurs, this means a wiring error somewhere. 9.
Make sure everything is fixed in the right place and not moving around in the case.
Extend the button shaft using LED. The shaft of the button on the charging module is too short to reach out through the opening on the housing.
Therefore, a 3mm LED head is used as an extender. 1.
Use the cutter to cut the legs of the led. 2.
Use sandpaper to smooth and smooth the flat side of the LED.
If the LED is too small to operate by hand, use tweezers. 3.
As shown in the figure, place the LED head on the hole provided for it.
Make sure the led is not tight because it should slide in and out when the button is pressed.
Apply any rubber-based adhesive (
I use the Fevi key)
Carefully follow the edge of the body and hat. 2.
Wait 5 to 10 minutes for the glue to dry a little and press the two halves together.
Ensure that the free end of the steel shaft of the encoder wheel enters the hole on the cover provided for it. 3.
Use heavy objects (
I use the UPS battery)
When the glue dries, keep both pieces pressed.
A rubber adhesive is recommended here, because if the case must be opened for battery replacement or re-programming in the future, it can be easily done by running a sharp blade or knife along the joint.
The label is carried out to easily identify the location and function of the touch button.
Use my homemade laser cutter to cut the letters from the white sticker.
The cutter uses removal from the main paper and is then applied to the device in the correct position and direction.
Maximum letter Height: 8mm maximum letter width: 10mm warning: wear laser blocking safety glasses when using laser engraving or cutting equipment.
If you guys have any questions or suggestions about this project, please let me know by comment.