The Lovebox is a project I learned about through a Make: magazine article from 2019. A reader notified ThingPulse – of which I’m a co-founder – because the project’s Arduino sketch relies on an open-source display driver provided by ThingPulse.
I was immediately intrigued as the project involves electronics, software and classical woodworking. As a born-and-breed cabinet marker, later turned software engineer, I loved that building it would allow me to combine many of my interests. Also, I saw a good reason to put the new (used) bandsaw I had recently added to my still scarcely equipped workshop to good use. Not to mention the fact that for once I happened to have all the required hardware, both wood and electronics, at home already. The only thing missing yet is mirror/darkening film to build a magic mirror on top of the OLED display.
This is not a full-blown instructable. Rather, I’ll publish a few photos of my implementation and add a few notes. All credits go to Lisa Ihde who created the project and who wrote the Make: article. Please read her project description at http://lisaih.de/Lovebox/.
When the Lovebox receives your message for a loved one, the heart wiggles until she/he lifts the lid and reads the message on the display hidden inside the box.
The initial app implementation polls a GitHub Gist for new content. If it sees a new message (text or image) it displays it and sets a servo in motion to which the heart is attached. When the lid is opened a photoresistor (acronymed LDR for Light Decreasing Resistance, or light-dependent resistor) registers the extra light in which case the app stops the servo.
Very few components are required and luckily I had all of them at home already when shortly before Christmas I decided to build a Lovebox for my wife.
In her project Lisa sandwiched the servo between a WeMos D1 mini ESP8266 and the 0.96″ OLED display. Both sit on a perf board of their own. It’s a fairly logical stack. However, in hind sight I wonder if it wouldn’t be simpler to solder the display directly to the back of the D1 mini.
MCU and servo
From an earlier project my WeMos D1 mini already had pins soldered to it. So, first I soldered it a perf board into which I had previously drilled a ~10mm hole in the center. That allowed me to feed the wires from the MCU pins to the back side of the female pin headers on the side of the board.
This section obviously involved many repetitive steps. Cut a wire to length, strip both ends, tin them, bend them to an open loop, place the ends around a pin, solder them. At the end I filed down the pins to minimal length.
While soldering those wires I really came to appreciate the two most favorite recent additions to my workshop (links go to Amazon): the Jokari automatic wire stripper and the Goobay magnifying lamp – brilliant pieces for the workbench, both of them.
Display and LDR
Again, I first soldered the 0.96″ OLED display, which came with pins attached, to a perf board. Then I added a row of 5 extra long male pin headers and the LDR. Finally I connected the display pins in a somewhat bizarre way with the connector pins. I’m sure there’s a more straightforward way to do it. However, as is obvious from the pictures I’m a real electronics rookie.
For her original project Lisa apparently used 3mm plywood. What I had available was 4mm plywood. That gives the lid of the box a slightly more chunky look but works otherwise just fine. Also, while Lisa had a laser cuter available I had to rely on solid and honest craftsmanship. Every piece small, everything a bit fiddly. Oh, how I loved that! After I sanded the outside (see below) I treated the plywood with natural wood oil and painted the heart with acrylic paint.
Before I got to work on the electronics I connected the components on a breadboard in tinkered with the original code. Rather quickly I decided to create a fork to clean up the code a bit. The original code:
- Doesn’t write anything to the serial console.
- Stores the message sequence number and read state in EEPROM. I didn’t see much value in that.
- Polls the GitHub Gist in
loop(). That’s crazy; no one needs such high frequency. I added a configurable fetch interval in between which the MCU does “nothing”.
- Does not have Arduino IDE-friendly directory structure and file names.
- Uses SSL server certificate fingerprint for the SSL/TLS handshake. That is not desirable as you need to change it in your source code every time the server certificate changes (i.e. every couple of months). My code uses the CA root certificate instead that is valid until 2031.
The most obvious major flaw in my opinion is an architectural one and I haven’t “fixed” it yet: rather than polling the GitHub Gist for new messages – however infrequently – the more sensible choice would have been an MQTT pub-sub model. CloudMQTT for example offers a free-tier and also has a nice web UI to publish messages without the need for a dedicated client.
Update 2021-11-28: MQTT is now supported by my Lovebox application. The README at https://github.com/marcelstoer/Lovebox describes how.
Oh, you want to know what my wife said? She absolutely adores it and is proud to own something unique, something you can’t buy anywhere. But…she wouldn’t mind a slightly larger display. Frankly, I wouldn’t mind either. As larger OLEDs are fairly expensive I might as well use an e-ink display instead should I ever build another Lovebox.