Introduction: Digital Ruler and Unit Converter
This project uses an LED strip to resemble a ruler. The number of LEDs that are on can be adjusted, and a button will send the length of the lit up LEDs to the serial console. The units can be changed by another button, indicated by the color. For this project, I wanted to take an everyday item and add tech to it, and I decided to choose a ruler.
Supplies
Electrics Materials:
- Raspberry Pi Pico W
- LED Strip (30 LEDs)
- Potentiometer
- 2 External Buttons
- Alligator Clip to Male Jumper Wire
- Male to Male Jumper Wire
Woodworking Materials:
- Laser Cutter
- 1/8'' Baltic Birch Plywood
- Wood Glue
- Hot Glue
- Clear Tape
- Markers
Other:
- Mu Serial Console
- Adafruit IO
Step 1: Design and Code
I began with a loose visual idea for the project and wrote the majority of the code. I tested this with my electrics before building anything. (Note: sketch should say 32 in)
Attachments
Step 2: Laser Cut
I did not end up using the original dimensions and instead scaled down to 20 inches long. I designed the wood box using a "Console" preset on festi.info/boxes.py/. I added a hole in the back for parts access and holes in the front for buttons and a potentiometer. I also engraved the color key on the front of the box. I printed each piece, but I needed to attempt to unwarp some of the pieces, which delayed my assembly.
Step 3: Wood Assembly
I used wood glue to put the general box together. After each piece was on, I added some tape to remove some of the issues with the warped wood. I also colored the color code.
Step 4: Electronics Assembly
I attached the potentiometer to the box using hot glue, and the LED strip using tape. For the buttons, I made small square wooden cutouts and hot glued the button in the middle. I then wood-glued the square to the back of the circle hole. The wiring for this project is very simple, only needing two or three wires for each part.
Step 5: Connecting to Adafruit IO
I created a dashboard in Adafruit IO to allow the ruler to work the other way around. Rather than visually choosing a length and getting the numerical equivalent, the dashboard allows the user to enter a number and see the length on the ruler. I use two separate feeds, one for centimeters and one for inches, that work the exact same, receiving a numerical value and lighting up the appropriate number of LEDs. The code does not check for nonnumerical values but does catch numbers that are out of bounds.