Skip to main content

Raspberry Pi Pico Smart Scale

ยท 2 min read
Jason Hollifield
Founder @ Hollplex

Building a smart scale with a Raspberry Pi Pico that stores data in Supabase.

The Problemโ€‹

I had made my own web and mobile app to track various things like schedule, goals, todos, food macros etc. Weight was one thing I added but had to manually enter data. I wanted a scale that would automatically update my own life assistant/todo app that has an AI assistant and could see that data.

I didn't like Bluetooth scales I had because I needed to open a phone app for them to record data historically.

Initial Approachโ€‹

I set out to use an existing scale and tried to sniff the Bluetooth data they blast out. Unfortunately, I couldn't crack the encoding they used, so that approach was a dead end.

Solution: HX711 Load Cell Amplifierโ€‹

I was able to find information on HX711 load cell amplifiers and decided to build my own scale. I used a Raspberry Pi Zero I had lying around to get a working scale that could read my weight and update Supabase automatically.

Later, I got a Raspberry Pi Pico and converted the code to work with it, which was more compact and power-efficient.

Resources That Helpedโ€‹

Hardware Usedโ€‹

Issues I Ran Intoโ€‹

Battery and Time Issuesโ€‹

When going to battery power, I lost time functionality, the pico thought it was years in the past. I removed the Pico sending date to Supabase and just set a default value of the current date for that field in Supabase instead.

Python Module Problemsโ€‹

The datetime Python module was causing the script to hit an exception but with no log or message on what the exception was - the program would just exit silently. I worked around needing the pico to know the date. The module wasn't microPython to begin with.

The JSON module wasn't working properly on the Pico either, so I had to work around not using it. Module wasn't microPython either.

Storage Constraintsโ€‹

To make space for the necessary code, I had to remove some packages that weren't essential for the core functionality.

Github Repoโ€‹

TBD