Get your nerdy twee on!
What on Earth is this
I'm glad you asked! This repo holds all the files you need to create your very own IoT Tiara.
This tiara can light up in a variety of colours, controlled by the internet. You can control it any way you like, however the code setup in this repo will get you started with allowing your Twitch chat channel participants to do this by chat commands.
Here is a dorky photo of yours truly wearing it:
Is there a demo?
How do I make one of my own?
- Adafruit Huzzah Breakout Board
- FTDI Serial USB cable
- Hookup wire
- 3 RGB LEDs (common anode type)
- 3 220 ohm resistors
- 350mAh 3.7v LiPo battery
- LiPo battery charger
- Super glue / nail glue
- Hot glue gun
- Electrical tape (~15mm wide)
- Faux flowers (try Etsy)
- Soldering iron + solder
- Wire stripper tool
- Access to a 3D printer (or online, such as Shapeways)
- Download and print each STL file on a 3D printer. Using t-glase for the LED crystal shards looks really cool.
- On the headband, use a hot soldering iron tip to melt 4 tiny holes for each RGB LED so the leads can be fed through the headband. Line up the printed crystal shards to mark the placement of these holes. Reference photo
- Feed the RGB LEDs through the headband, all in the same orientation. Reference photo
- Connect the red LED leads together with wire and solder, on the underside of the headband. Do the same with the green, blue, and ground leads. Reference photo
- Solder 2 connected headers to the VBatt and GND pinouts on the Huzzah. This is for the battery to plug into. Make sure the long ends of the header pins face upwards from the front of the board.
- Solder 6 connected headers to the FTDI pinouts on the Huzzah. Make sure the long ends of the header pins face upwards from the front of the board.
- Solder a resistor to each of the following pins: #12, #14, #16
- Attach the case bottom to the bottom right side of the headband with electrical tape, via the slots in the bottom of the case. Place the Huzzah board into the 3D printed case bottom.
- From the far right RGB LED, connect its leads to the board by tracing wire along the underside of the headband. Ground connects to the free GND pin, red to #16 resistor, green to #14 resistor, and blue to #12 resistor.
- Time to test! Connect the FTDI friend to the Huzzah, the other end to your computer.
- Edit src/tiara-MQTT.ino to include your own wifi and Azure IoT Hub credentials. See the next section below on how quick it is to get your IoT Hub and new device all set up first.
- Compile and upload to the board. You're ready to test! See the software section below to get the rest up and running.
- If the software and hardware is all working as expected, go ahead and glue the crystal shards to the headband with super glue / nail glue.
- For extra twee-factor, hot glue some flowers to the band carefully. Hot glue can warp the printed headband, so go easy and use glue sparingly.
- Attach the cover onto the Huzzah case bottom, and you're done!
How do I set up the software for this?
- Create an Azure account. It's free to join!
- Create a new Azure IoT Hub instance following steps 1-6 of these instructions. The free tier allows up to 8000 messages a day.
- Create a new device within the Device Explorer after clicking on your IoT Hub instance from your Azure Dashboard. Remember the name you gave it, and generate a new SAS token for it to include in the Huzzah sketch (src/tiara-mqtt.ino)
- You can run the server to listen to Twitch chat either locally, or you can host it in the cloud. You'll need NodeJS installed if you're going local. Whether local or cloud, you'll need to set the following environment variables:
TWITCH_TOKEN- go to Twitch, log in and create a token to use.
TWITCH_NICK- your Twitch username/nick
TWITCH_CHANNEL- which Twitch chat channel you want to listen to. Example:
IOT_CONN_STRING- the connection string of your Azure IoT Hub instance. Find one under 'Shared Access Policies' after clicking on your Hub instance from the Dashboard.
IOT_DEVICE_ID- the name of the device you set up in the IoT Hub instance.
- Deploy this repo to the cloud, or run it locally with
- Go to Twitch online, and type commands into the Twitch channel your server is listening on! Try
tiara red(and other simple colour names) or even 6 digit hex colours! Like
tiara #00ff00for instance.
tiara onalso work.
- Once you verify your tiara works, disconnect the FTDI cable and try plugging in your charged LiPo battery to go cable free!