Spark Core + Raspberry Pi + Blinky Tape = Awesome

I’ve made an updated version of my Spark Core Shower Room Door Sensor that adds a Raspberry Pi driving a Blinky Tape (RBG LED strip) to show the occupancy status. It still uses the paper-clip switch (I’ll write up how to make a micro-switch out of office supplies in another post) with a Spark Core to do the sensing and sends the data over the wireless network. During an office refurbishment I got the electricians to install a power socket right outside the shower room door which makes installation a snap.

The idea is to show the status outside the outer door a few meters away with an “information radiator” to avoid a wasted trip and disturbing occupants by trying the handle. Yes, this could be achieved with some wire linking the switch directly to some LEDs but where’s the fun in that‽ In the spirit of the development team this needs to be massively over-engineered and the greatest amount of micro-processors and micro-controllers should be put between the switch and lamp as is unreasonably possible. So here is the data flow:

  1. Super hacky awesome paper-clip switch in bolt hole
  2. Cat5 twisted pair core for wire
  3. Spark Core
  4. Wi-Fi network
  5. The Internets
  6. Spark Cloud (on the other side of the Atlantic ocean!)
  7. More Internets
  8. Ethernet to Raspberry Pi
  9. Serial over USB to Blinky Tape controller
  10. Each RGB LED (which all have ICs) changed from green to red

That’s at least 8 chips just for one LED not counting steps 5-7 which is hard to measure. They could be eliminated by running the local Spark cloud on the Pi (or preferably a Pi v2). This would have the advantage of reducing latency (not that it’s that bad) and more importantly stop GCHQ perving on our bathroom habits.

I used this JavaScript library to drive the tape as the Spark SDK requires node. Python would be better as node (and especially the serial port module) doesn’t run great on a Pi v1. The code is on GitHub and here are some pictures.





Notice how close the door and LEDs are to each other even though the data goes 1000s of kms (just like your iMessages).

If you liked this then why not follow me on twitter so you hear about new articles.

This blog is treeware! If you found it useful then please plant a tree.
Donate a treeDonate a tree🌳🌳