Perpetual tools maintenance

When it became obvious that just using the AT commands and built in WiFi capabilities would not be enough to realize this project I investigated what would be needed to build new binaries for these PADI modules. Not a very complex system, compared to most but it does include a SOC, WiFi module and RTOS all rolled into one binary. Thankfully there is an available build package for this chip from Ameba.

To build the Ameba binary I needed some libraries for cygwin which forced an update to that package. That build went flawlessly. Building OpenOCD under cygwin for the command line revealed that this version does not support the STlink. The prebuilt Eclipse OpenOCD needed a newer version of Eclipse which forced upgrades to the Android SDK which required a newer Android Studio. The STlink V2 needed to be upgraded which required new drivers and utilities. All of this to get to the point where I could just verify that the rebuilt package matched the binary on the device and functioned.

It isn’t developing for these platforms that’s difficult, it’s maintaining the toolchain…

Computer controlled Christmas lights using PADI stamp

A fun and quick project for the IoT space is a lighting controller for the holidays.

The goal is to have multiple strings of lights, each controlled centrally yet installed on the house and various trees separated by up to 200 feet. Each string should be addressable and synchronized. I’m not going to address weatherproofing as these will be run from GFCI outlets but they must be safe to install and handle.

Lights themselves are inexpensive. Extension cords add up quickly. Assume we have 4 locations, each with 4 individual light strings and each location is spaced 50 feet apart. Bringing all of the cords in to a single central 16 channel location will require 16 cords, 8 75′ and 8 25′ cords plus the length to go up each tree. That is a large bundle of cords and at roughly $0.50 per foot, 800 feet of cord for at least $400.00 in just cords. A bit more than what I want to spend for blinking lights.

Plan two will have 4 smaller 4 light controllers, one per location. Daisy chaining the cords can decrease the required length to 200 total feet of power cables. We then need to optimize the light controller design to build 4 of them and make them wireless.

Initial draft idea is to use an project enclosure, cable tails to outlets and the PADI stamp controlling relay modules. While certainly workable this draft ends up being moderately expensive.

Project box, 4x6x3: ~ $8.00
Cord tail outlet, 1 per module: $20.00
Cord tail plug, 1 per module: $11.00
Cable inlet / grommets assy, 5 per: $5.00
Relay module, 4 ch opto 3.3v in: $8.00
PADI Stamp with breakout board: $2.00
USB 5v-3.3v regulator: $1.00
modified USB 500ma power adaptor: $0.00

This works out to a total BOM of around $50 each unit. There has to be a cheaper way, off to the hardware store.

Heavy duty 2 gang new construction wiring box, Carlon 34 cu in: $2.18
120V blade wall outlets, 15A 2 per module: $0.50
2 gang outlet cover: $0.50
8′ extra outlet extension cord: $5.62
Relay module, 4 ch opto 3.3v in: $8.00
PADI Stamp with breakout board: $2.00
USB 5v-3.3v regulator: $1.00
modified USB 500ma power adaptor: $0.00

This gets the cost down closer to $20 each and decreases the hassle with huge bundles of power cords running everywhere. There is enough room in the wiring box to easily fit the stamp, relay module and USB wall wart inside and they come with a convenient nail bracket to attach to the trees. Cutting the hot side link on the duplex outlets allows the individual sockets to be isolated.

Simple, straightforward, somewhat elegant and yet inexpensive. I think this is good enough to build and test.