This is going to be a long-running project as there are so many ways to do this. The objective is to provide an unobtrusive yet effective way to communicate with people around a home or office. The idea is not new and you can buy one of these from Ambient Devices. However, this one is quite different in the way it gets its information. Specifically, I wanted it to be pachube-compatible so it can be used in numerous types of projects where people have full control over the back-end processing and several choices of communication medium.
- low-cost components
- on-board processing possibilities
- wired or wireless options
- standards-based connectivity
- option to run on battery power
- brightness control
I made one to evaluate the idea:
- glass dome (IKEA or B&Q)
- base unit (painted wood for prototype)
- Microcontroller (MCU) and comms board stored in base
- Power LEDs (RGB), drivers and heatsink (yes, even LEDs get hot)
Output devices/ actuators should not poll as this just chews up power; feels wasteful and is. I chose the TCP Socket protocol provided by pachube. This features a publish and subscribe mechanism so the MCU does not have to keep polling for data. Instead, it is alerted when the data changes.
The candidate MCUs were AVR (Arduino) and MBED, the latter being chosen for the first version because the socket libraries were available and there’s plenty of RAM allowing for communication in JSON format. This one uses wired Ethernet. Another version will most likely be built with a Nanode. This will allow a cost saving at the expense of more work on the software. One interesting option would be to use a low-cost wireless receiver instead of wired Ethernet. I also made a version based on a Seeeduino ADK board that communicates via an Android phone. I’m going to try that with an old Android I know longer use. Also with an old USB dongle if I can figure out how to drive that. I was pleasantly surprised to be able to use the Android phone as a gateway although this needs two background async processes – a bit complicated.
BTW. Many thx to @dcuartielles or getting me off base with ADK and to the guys at #londroid for pushing eclipse as the way to go for Android dev.
The LEDs were a tricolor power LED module (LX1610RGBW/A) and the driver was in a quad DIL package (DS3658). For simplicity, the first version limited the current to the LEDs so was not very bright. Subsequent versions will have a larger heatsink and, optionally, be able to run these LEDs at full power. A current-control circuit will probably be needed to do this safely, given the risk of doing everything through software and accidentally over-driving the LEDs.
The firmware is made simpler by using the MCUs pulse-width-modulated (PWM) outputs to control the relative power to each LED. Most of the work is in setting up the connection to the server and dealing with data as it arrives. As firmware is easily loaded from PC or Mac we made a version that cycles the colour values while testing.
In order to control this while testing we made a web page with a colour table selector that sends colour settings to pachube.
In real applications one would take sensor data and process it before sending an appropriate colour to the orb.
Watch this space for future versions and applications.