A Physical Computing Project
This project is wearble device that you can control from your phone and the internet.
##Stuff it does;
- Lights up random colours _ Lights up depending on the temprature
- Flashes blue when you send a tweet
- Lights up bright white when you send it a command (to be used as a flashlight)
- Sends a notification to your phone when it gets too cold
- More features coming soon
##To build this project you will need:
- Adafruit Feather 32u4 Bluefruit LE
- Adafruit NeoPixel FeatherWing
- Male Header pins
- Female header pins (buying the ones made for the feather is best to keep the project slim)
- A smart phone
###--- Optional ---
- lipo battery
- JST jack cable (for the battery, if it doesn't already come with one)
- 2 push buttons
- Some Protoboard/stripboard/wires (to attach the other components to)
- Temprature sesnor
- Wires
- Some sort of case to keep it in when you're done
- A chain if you want to use it as a necklace
##Connect components up like so:
- note it may be easier to stack the feather and featherwing
- the battery is shown as not connected on the schematic, just plug it into the side of the feather, or use a usb cable for power
Images are made using Fritzing (source file is in the repo)
##Upload the code Use the ardunio IDE to upload the code in the repo to the feather, make sure you select the right board and port. If you haven't used your feather before you'll need to instal the libraries from Adafruit. Check out this guide for more info on that. You'll need their BLE libeary aswell.
######Test it If everything is set up properly the neopixels should light up. Once the code is uploaded keep the feather plugged into your computer and open up the serial monitor, it should give you a stream of numbers, the temprature readings from the sensor. If you push the buttons, it will also print out here, press each one and both at the same time to make sure its all working.
- Button 1 will turn the LEDs off and on.
- Button 2 will switch between lighting modes.
##Connecting it to your phone and the internet ###To your phone To get it online you'll need to first connect it to your phone Download the bluefruit connect app for your android or iPhone
Note i've only tested this on android, it's probably the same on iOS
- Open up the app
- Make sure you're feather is on
- Click connect next to "Adafruit Bluefruit LE"
- Select UART
- Once you're connected it will give you a text field, type in
tweet
then press send. - The feather should flash blue. That means everything is working so far ๐ ย ๐
- You can now control the feather from you're phone.
###But what about from the internet?
- You'll need to make an account on io.adafruit and IFTTT
- Create 2 feeds on io.adafruit, call them whatever you want.
- Click on MQTT at the top of the app
- Fill in the details:
Replace username/feed/feedname with your username and the names of your feeds For password press the scan code button then on io.adafruit go to settings then view AIO key.
Server
Address: io.adafruit.com
Port: 1883
Publish
UART RX username/feed/feedname1
Subscribe
Topic username/feed/feedname2
Advance
Username: username
Password: see quote above
- Now thats set up you can send commands from anywhere to your feather.
You can test this buy going to feedname2 clicking create data and typing
tweet
which should cause the text to apear on your phone and make your feather flash blue.
###Making it do stuff with the internet Remember when I told you to make an account of IFTTT? This is where you get to use that.
- Go to my applets on ifttt.
- Create a new applet, using twitter and adafruit, you'll need to link your accounts.
- On twitter select any option you want, I used "New tweet by you"
- On adafruit, select "send data to adafruit io" then pick feedname2 and in data write
tweet
- Hit create action and Finish and you now have a IoT device that flashs blue whenever you tweet
##Full list commands the code will respond to:
tweet
Flashes blue
flashlightON
Maxes out brightness, changes all neopixels to white
flashlightOFF
Turns off flashlight mode.
random
Default mode, displays random strips of colours
healthbar
Changes mode to healthbar, lights up depending on the temprature turns blue if too cold, green if normal and red if too hot.
brightness xxx
>replace xxx with a number between 0 and 255
Sets the brightness of the modes
flash
Flashes white
You can replace tweet
in the above example with any of these to make it react to the internet.
If you want to control it via a smartwatch you'll need to use the maker channel.
On a pebble I used THISBUTTON
####Addtionally when both buttons are pressed it sends data
#####When both buttons are pressed it will add 100
to feed1name, otherwise it will contsantly update feed1name with the tempreature in celsius.
I have created a IFTTT aplet that send a notifcation to my phone when it gets too cold, by monitoring the feed and checking if it is below 15.
I have also set it to tweet for me if I press both buttons at the same time; By monitoring the feed and seeing if the value is equal to 100
.
##An overview of my design process/making off with pictures can be found on this blog
###:octocat: If you run into any issues feel free to contact me on twitter
###
If there are spelling/grammer mistakes in this guide then open a pull request