BMC Primary

ESP8266 and ESP32

Over the past year or so, I've been diving more into designing micro systems for home automation and just for general tinkering. I've made several small project items, from switches to light detectors for various uses around the house.

While I used to work on the MC 6800 series (6809 and 68HC11 especially) in my youth, currently I've been working mainly with ESPressif based chips. There are a number of low cost pre-fab systems on the market that offer a lot of bang for the buck, but the ESP8266 and ESP32 based modules have a lot going for them. Both have a native Wifi chip, serial service, several GPIO lines, and at least one ADC onboard, as well as plenty of flash memory and a reasonable amount of ram. The ESP32 line adds more horsepower in the same form factor, but also adds in lots of additional options, from camera linkage to bluetooth and various I2C devices.

For environment, I'm generally preferring PlatformIO using VSCode as the main editor. It's still a little quirky, but offers flexibility that Arduino Studio simply can't match when it comes to more complex tasks.

Mail detector

One of the more interesting items I've made involved a small ESP8266 stamp, a lithium charging board, and some misc components. This little invention, about the size of a pack of cigarettes, sits in my mailbox and uses a phototransistor to detect when the box is opened. When it sees light (it's normally pretty dark) it fires up a ESP8266. That connects via wifi to the home system and updates the MQTT server with a new timestamp and status. It also checks to see if there is an OTA update waiting, applies it if there is one, and powers off when there's nothing left to do. Since the circuit only catches the edge of the signal, it can go back to sleep no matter the state of the actual door. So far on two 18650 cells it's run several weeks without noticeable power loss. The system draws under 80uA when in standby, peeking at 150ma during wifi bursts, mainly during initial connection.