Now that we know the communication protocol between the WeMo(R) base board and the control PCB its time to design the custom controller. Of course the replacement has to maintain the same physical dimensions as the original and the I/O components need to be in the same places as well. Some Digikey searching yielded a compatible header connection, vertical USB port, and button. I opted for an RGB LED instead of the two discrete LED's that are on the stock board and I omitted the capacitive touch hardware mostly due to space constraints.
In addition to the stock functionality I've added some new features that make the plug much more useful in environments without good WiFi coverage:
- Long term storage so the plug can log data without a network connection
- Battery backed real time clock (RTC) so data samples are consistently timestamped
- USB interface for configuration (the original has a USB port but does nothing with it )
For storage you can't beat SD cards for size and cost so I threw in one of my favorite uSD connectors. Since there's going to be a fair bit of processing going on I opted for an ARM micro. Atmel's SAM4S is a really nice chip with plenty of peripherals including an HSMCI interface for the SD card. Its also (recently) compatible with the sweet black magic probe which makes development much nicer in a Linux environment -- although I've had good experience with Atmel's IDE as well.
The RTC is nothing special- just your vanilla I2C device with a coin cell for backup. Cost and space constraints make nicer models like the DS3231 impractical, but it doesn't need to be extremely precise so this should be sufficient.
For the wireless network connection I'm using everybody's favorite ESP8266 module from SeeedStudio. Its cheap but the AT commands make things a bit difficult. I've also had some stability issues with the stock firmware. After upgrading them to the latest image I could find, they seem to work better. The upgrade process itself is rather confusing, but for less than $7 I can't complain!
From the pictures you can see a few errors I made on the first run, but a new rev is in the mail so hopefully no wire-wrap connections next time!