Last week, my mom asked me to hang a photo frame on the wall. I grabbed a ruler and a drill machine, drilled two holes, and mounted the frame. She pointed out that the frame looked slightly tilted, even though it seemed fine to me. She also mentioned that the kitchen slab was tilted, causing water to flow in the wrong direction.
By noticing these issues, I realized that one important tool was missing from my collection—a spirit level (bubble level).
So, I decided to make my own: Planum – A Digital Spirit Level Tool. The name “Planum” comes from the word for a flat, even, and horizontal surface.
This device uses a 6-axis IMU sensor to detect whether the surface it’s placed on is level or not. If the surface is level, the display shows a green bubble; if it’s not, the bubble turns red.
The device also includes a calibration feature for accurate measurements. It is battery-powered, rechargeable via a USB Type-C port, and designed with portability in mind. The 3D-printed case is compact enough to be used as a keychain, so you can easily carry it anywhere.
By the way, Subscribe to my YouTube channelfor more projects like this. I also update my upcoming projects on Instagram.
buy me a coffee! ☕: Donate
This device is quite similar to one of my previous projects, SoulCage – the Digital Trapped Soul Pendant for Halloween. So, with this build, you’re actually getting two projects in one!
What is spirit level (bubble level)A spirit level, also known as a bubble level, is a tool used to check whether a surface is straight, flat, or properly aligned. It contains a small liquid-filled tube with an air bubble inside. When the bubble rests exactly in the center, it means the surface is level (perfectly horizontal or vertical). This tool is very handy for hanging photo frames, installing shelves, laying tiles, or any work that needs precise alignment. In short, it helps you avoid tilted or uneven surfaces.
Supplies
COMPONENTS:
- Waveshare ESP32-S3 Round 1.28-inch Display With CNC Metal Case [No Touch] (amazon.com/ amazon.in)
- 3D Printed Back Cover
- 3.7V 950mAh Lipo Battery (amazon.com/ amazon.in)
- Mini SPDT Slide Switch (amazon.com/ amazon.in)
- MX1.25 2P connector (amazon.com/ amazon.in)
- Heat Shrink Sleeve Tube [1mm] (amazon.com/ amazon.in)
TOOLS:
- Hot Glue Gun (amazon.com/ amazon.in)
- Hot Glue Sticks (amazon.com/ amazon.in)
- Surgical Blade (amazon.com/ amazon.in)
- Soldering Iron (amazon.com/ amazon.in)
- Screwdriver (amazon.com/ amazon.in)
Waveshare ESP32-S3 Round 1.28-inch Display
The Waveshare ESP32-S3 LCD 1.28-inch board is a compact and powerful microcontroller module, perfect for wearable and portable projects. At its core, it uses ESP32 with built-in Wi-Fi and Bluetooth 5 for wireless connectivity. It includes 512 KB SRAM, 2 MB PSRAM, and 16 MB Flash memory for smooth performance. The standout feature is its 1.28-inch round IPS display with 240×240 resolution and rich 65K colors. Other highlights include a Type-C connector, lithium battery management, and a 6-axis motion sensor, making it versatile, low-power, and easy to integrate into creative digital projects.
CNC Metal Case
Waveshare also provides a CNC-machined metal case for the board. The case is designed with precise cutouts, giving a perfect fit for the 1.28-inch display and the Type-C port. The sleek black metal finish not only protects the device but also gives it a premium and professional look, making the device feel more like a finished product than just an electronic project.
3D Printed Back Cover
The CNC metal case provided by Waveshare is excellent, but it doesn’t include space for a battery. To fix this, I designed and built a custom back cover for the case. This cover securely holds the battery and also gave me the flexibility to add a hook at the top. Thanks to this hook, the device can easily be used as a keychain.
3.7V 950mAh Lipo Battery
For this project, I chose a 3.7V 950mAh battery, which fits perfectly inside the custom back cover. This battery provides a good amount of backup time, allowing the user to wear the device for hours without worrying about frequent recharging. In the market, there are many types of lithium batteries available in different shapes, sizes, and capacities. So depending on your design, you may find a battery that fits even better, with either lower or higher capacity, to match your specific needs.
Mini SPDT Slide Switch
A mini SPDT switch is placed at the bottom of the 3D-printed back cover. The switch is designed to fit perfectly into a slot, so there’s no need for screws or extra mounting hardware—it simply slides into place and stays secure. This switch plays an important role, as it powers the device on and off.
MX1.25 2P connector
The MX1.25 2P connector is used to connect the battery to the board. The Waveshare ESP32-S3 round display comes with a built-in 1.25 2P male connector, so the battery needs a matching female connector attached. This makes it easy to plug the battery directly into the PCB without soldering every time. Using the proper connector ensures a secure and reliable connection while also making the battery simple to replace or upgrade in the future.
Heat Shrink Sleeve Tube
A Heat Shrink Sleeve Tube (1mm) is a thin plastic tube that shrinks tightly when heated, usually with a heat gun or the side of a soldering iron. It is commonly used in electronics to cover and insulate exposed wires or solder joints, protecting them from short circuits and giving a cleaner look. For this project, the 1mm size is perfect for small battery wires and connectors. It not only improves safety but also makes the overall build look neat and professional.
Designing the Custom Back Cover in Tinkercad
I designed a 3D-printed back cover for this project that fits perfectly with the CNC metal case. The design was created in Tinkercad, an easy-to-use online 3D design tool.
The back cover is made in such a way that the battery can snap-fit inside without the need for screws or glue. In the same way, I created a slot for the mini slide switch, so it can easily slide into place and stay secure, again with no extra mounting required. Finally, the back cover attaches to the CNC case using the original screws that come with the case, making the whole assembly neat and reliable.STL with support : https://www.tinkercad.com/things/iuLhoR2B9iq-soulcage-with-support
STL without support : https://www.tinkercad.com/things/izTjHNzJxj2-soulcage-without-support
3D Printing the Back Cover
Printing Details:
- Nozzle: 0.1 mm (for fine detail and smooth finish)
- Infill: 20% (strong yet lightweight)
- Material: ABS – Black (durable, heat-resistant, and gives a professional look)
The original back cover of the CNC metal case for the Waveshare ESP32-S3 round display is made from a sheet of black acrylic. This cover protects the electronics and gives the case a smooth and professional finish. It is firmly mounted on the back of the CNC case with three small screws, which hold the acrylic plate securely in place.
Before replacing it with the custom 3D-printed back cover, we first need to remove this acrylic piece. Take a small screwdriver that fits the screws properly, using the wrong size may damage the screw heads. Slowly and carefully unscrew them one at a time. Don’t rush, and hold the case steady so that the display does not get scratched or damaged while you are working.
As you remove each screw, place it somewhere safe, like in a small container or on a magnetic screw pad. This is important because we will reuse these exact screws later when attaching the new back cover. If you lose even one screw, the back cover may not fit tightly, so keeping them safe right from the start saves you from trouble during reassembly.
Once the three screws are removed, gently lift the acrylic back cover off the case. You will now see the PCB, battery connector, and the inside of the CNC housing exposed. With the acrylic cover out of the way, The device is ready for the modifications.
Setting Up the TFT_eSPI LibraryTo run the graphics on the round LCD screen, we need the TFT_eSPI library. This library is designed to drive many different displays, so we must configure it properly to work with the Waveshare ESP32-S3 Round Display (No Touch). Follow the steps below to install and set it up.
1. Installing the Library- Open Arduino IDE.
- Go to Sketch > Include Library > Manage Libraries.
- In the Library Manager, search for TFT_eSPI.
- Install TFT_eSPI by Bodmer (version v2.5.43 is recommended).
- Open your computer’s Arduino Libraries folder (usually located in Documents > Arduino > Libraries).
- Find the folder named TFT_eSPI and open it.
- Download the User Setup file from my GitHub repository.
- Copy and paste this file into the User_Setups folder inside TFT_eSPI.
- Now, open the file User_Setup_Select.h (you can use Notepad or any text editor).
- Look for the line and comment it out by adding // at the beginning.
#include <User_Setup.h>
- Add the following line instead:
#include <User_Setups/Setup303_Waveshare_esp32s3_round_no_touch.h>
That’s it! Now the library will use our custom setup file for pin configuration, and your display will work correctly with the Planum project.
Programming the Device in Arduino IDENow that the library is configured, we will program the device. This step verifies that all of our previous setup is correct and that the Planum display works as expected. Follow the instructions below carefully:
- Make sure your ESP32 Board Package in Arduino IDE is installed and updated to version 3.3.0.
- Download the Planum code from my GitHub and open the project in Arduino IDE.
- Go to the Tools menu and set the following options:
- Board: ESP32S3 Dev Module
- CPU Frequency: 80 MHz
- Flash Size: 16 MB
- Partition Scheme: Custom
- PSRAM: QSPI PSRAM
- Erase All Flash Before Sketch Upload: Enable
- Connect the device to your computer using a Type-C USB cable.
- Select the correct COM port for the device in Arduino IDE.
- Click the Upload button to program the ESP32-S3.
- If everything is set up correctly, the code will compile and upload successfully. After a few seconds, check the round display: a red or green bubble should appear, confirming that your configuration and code are working properly.
Github : https://github.com/vishalsoniindia/Planum---A-Digital-Spirit-Level-Tool
Making Small Modifications to the PCB
At first, I thought putting the ESP32 into deep sleep mode would be enough to reduce current consumption down to about 10 µA. However, the PCB has several other components that continue drawing current even when the ESP32 is asleep, so the power usage never dropped as expected.
To solve this, I decided to add a switch that disconnects the main power supply of the PCB while still allowing the charging circuit to work. For this, I made a small cut on the EN pin of the ME6217C33M5G LDO regulator and wired it through the switch.
But this still did not fully solve the problem. When a USB cable was connected, the CH343P USB-to-serial chip continued converting 5V to 3.3V and supplying it to the same rail. This caused the display to flicker when the device was turned off but charging. To fix this, I also had to cut the V3 trace (pin 6) of the CH343P.
During testing, I found another source of unnecessary current draw. The voltage divider used to detect battery level was constantly consuming around 20 µA, even when the device was not in use. I simply removed resistors R4 and R7 (as shown in the image). After doing this modification, the standby current dropped significantly, down to about 1.5 µA.
- Locate the first spot (EN trace of the ME6217C33M5G LDO regulator) as shown in the image.
- Locate the second spot (V3 trace of pin 6 on the CH343P) as shown in the image.
- Take a sharp, pointed cutter.
- Carefully cut the traces at both spots, making sure not to damage nearby tracks.
- Use a soldering iron to carefully remove R4 and R7, as shown in the image.
Once these two cuts are made, the switch can completely disconnect power from the PCB without affecting charging, and the display will no longer flicker when the USB cable is plugged in.
Soldering the Mini SPDT Switch & Battery ConnectorIn this step, we will solder two important components: the mini SPDT switch and the battery connector. Follow the instructions carefully.
Soldering The Mini SPDT Switch
- Cut three small pieces of wire.
- Strip the edges of each wire and tin them using a soldering iron.
- Solder the first wire to pin 1 of the ME6217C33M5G.
- Solder the second wire to pin 3 of the ME6217C33M5G.
- Solder the third wire to the GND pad of the C3 capacitor (see reference image).
- Now connect these wires to the switch:
- Solder the wire from pin 3 of the LDO to the middle pin of the SPDT switch.
- Solder the other two wires to the remaining pins of the switch. The order does not matter—one side will turn the device ON, the other side OFF.
- Carefully strip the ends of the connector wires and the battery wires.
- Slide a piece of heat shrink tube onto each battery wire.
- Solder the red wire of the connector to the red wire of the battery, and the black wire of the connector to the black wire of the battery.
- Move the heat shrink tube over the solder joints.
- Apply hot air (or briefly touch the side of the soldering iron) to shrink the tubing and secure the joints.
Once both the switch and connector are soldered:
- Connect the battery.
- Toggle the switch to test that the device powers ON and OFF properly.
The 3D-printed back cover includes some support structures to ensure accurate printing. Before assembly, these supports need to be removed and the part cleaned.
- Remove the support material from the bottom of the device hook.
- Remove the supports from the screw holes.
- Use a small screwdriver or tweezers to clean the screw holes thoroughly.
- Test the holes by inserting the screws, make sure they pass through smoothly, as shown in the reference image. This confirms that the holes are properly cleaned.
Now it’s time to assemble all the components so the Planum device is ready to use. Follow these steps carefully:
- Snap-fit the battery securely inside the 3D-printed back cover. No screws or glue are needed.
- Slide the mini SPDT switch into its slot at the bottom of the back cover. Make sure it sits firmly in place.
- Attach the battery connector to the PCB, ensuring correct polarity.
- Align the back cover with the CNC metal case. Use a magnetic screwdriver to insert the screws. Check that the screws come out correctly on the other side and fit smoothly.
- Tighten the screws one by one carefully, making sure the cover is snug but not over-tightened to avoid cracking the 3D print.
Once this is done, the device is fully assembled. we will do the final testing in the next step to confirm that everything is working correctly.
Using the Device
After completing all the previous steps, your Planum device is ready to use. Here’s how it works and how to control it:
- Power On/Off: Use the mini SPDT slide switch to turn the device on or off.
- Using the Device: Place the device on the surface you want to check. The display will show whether the surface is flat (green bubble) or tilted (red bubble).
- Calibration: If the device is not giving accurate readings, follow the next step to calibrate it.
- Charging: The device can be recharged using the Type-C connector at the bottom. Simply plug in a USB charger to recharge the battery.
- Enable Calibration: In the code, change CAL_FLAG to true as shown in the image.
- Upload the Code: Upload the modified code to your device.
- Place on a Flat Surface: Put the device on a perfectly flat surface. You can use a traditional spirit level to help find a flat reference.
- Read Sensor Values: Open the serial monitor and wait till readings are stable. note the stable X and Y values displayed.
- Update the Code: Go back to the code and paste the X and Y values in lines 84 and 85, as shown in the image.
- Disable Calibration: Set CAL_FLAG back to false in the code and upload it again.
- Congratulations! Your device is now calibrated and ready to give accurate readings.
To estimate how long the battery will last, I tested the device in two different states and used the Digi-Key Battery Life Calculatorfor predictions.
- Turned Off Condition:
- When the device is powered off, it draws only about 1 µA of current.
- At this rate, the battery life is theoretically around 108 years! Of course, this is more of an ideal number, but it shows that the device uses almost no power when off.
- Turned On Condition:
- While the device is running and the display is active, it draws approximately 85 mA.
- Based on this current, the battery can last about 11 hours on a full charge.
This means that after fully charging the battery, the device can be used comfortably all day without worrying about recharging. The combination of low standby current and moderate active current makes it very efficient for wearable use.
Improvements & Future Ideas
The Planum device is fully functional, but there’s always room to add more features and creativity. Here are some ideas for future upgrades:
- Increase Accuracy: Upgrade the IMU sensor or add a temperature-compensated sensor to make measurements even more precise.
- Larger Display Options: Use an OLED or color display to show tilt angles numerically in addition to the bubble indicator.
- App Integration: Connect the device to a smartphone app via Bluetooth for logging measurements or sharing level data.
- Multiple Modes: Add modes for measuring angles, slopes, or vertical alignment (plumb).
- Waterproof Design: Make the device waterproof so it can be used outdoors or in wet environments.
- Rechargeable Battery Upgrade: Switch to a larger battery or add a solar charging option for longer use.
- Custom Shapes & Accessories: Offer customizable cases, keychain hooks, or magnetic mounts for different applications.
By the way, Subscribe to my YouTube channelfor more projects like this. I also update my upcoming projects on Instagram.
buy me a coffee! ☕: Donate
Comments