IoT Bluetooth NeoPixel Lamp
A Bluetooth Low Energy / Internet connected light can be used for all sorts of things. As a status indicator, it could be used to let you know when something has occured. With Adafruit IO, this can combined with IFTTT( If This Then That) so the colors of the NeoPixel ring can reflect a change.
It's a good idea to walk through the following guides to get familiar with the libraries, software and components.
Bluetooth Controlled NeoPixels
This particular sketch for the Arduino allows you to change the color of the NeoPixel LEDs and trigger animations using the Adafruit Bluefruit LE Connect app for iOS or Android.
Once you get this working, you can connect the lamp to the Internet thru your phone by using our MQTT gateway capability of Bluefruit Connect - for more details check out this tutorial for details.
To use the Adafruit Feather 32u4 BLE sketch you'll want to make sure you're using the latest version of the Arduino IDE (1.6.5 at the time of this writing).
If you're totally new to Arduino take a little time to go through some introductory tutorials like how to make a LED blink. This will help you understand how to use the IDE, load a sketch, and upload code.
Next you'll need to make sure the libraries used by the sketch are installed. With the latest Arduino IDE you can use its library manager to easily install libraries, or check out this guide on how to manually install a library. You'll want to install the following libraries:
- Adafruit BluefruitLE nRF51
- Adafruit NeoPixel
Search for the libraries in the library manager and they should be easy to find and install.
Adafruit AVR Boards
Next, you'll need to install the Adafruit AVR boards package from the Boards Manager. Open the Boards Manager and search for Adafruit AVR. This includes all of the boards from Adafruit and will make Arduino compatabile with them. The BLE sketch was tested with version 1.4.0.
Uploading Sketch to Adafruit Feather BLE
This sketch will run the Bluetooth controlled LED program to the NeoPixel strips that are mounted in the lamp
To load the sketch make sure the libraries above are installed, and the Arduino is connected to the computer through a USB cable. Under the Tools -> Board menu make sure the Adafruit Feather 32u4 is selected, and under the Tools -> Port menu the serial port for the Adafruit Feather is selected.
Then press the upload button or click the Sketch -> Upload item to send the code to the Arduino. Woo-hoo the sketch should be running.
Connect Adafruit BLE Mobile App to Adafruit Feather BLE
Download the Adafruit BLE Connect app for iOS or Android. Under the peripherals list, tap the connect button on the Adafruit Bluefruit LE item. Make sure the Feather board is powered on. Select "Controller" and choose either Control Pad or the Color Picker.
Buttons 1-4 will trigger an animation.
- color wipe
- rainbow gradient
- rainbow cycle
Here you can change the brightness or RGB value of the leds.
With the Arduino sketch uploaded to the Adafruit Feather 32u4 Bluefruit LE, proceede to the circuit digram page for prototyping the circuit.
Use the circuit diagram to reference for connecting the components together. The diagram does not depict exact wire lengths or size of components.
- EN from Feather to Switch
- GND from NeoPixel to Switch
- GND from Feather to GND on NeoPixel
- 3V from Feather to PWR 5V+ on NeoPixel
- #6 from Feather to Data Input NeoPixel
- JST connector from Battery to JST on Feather
The 500mAh battery only gives you about an hour of use. Use the diagram below if you'd like to use USB Power.
If you're planning to leave the lamp on for extended periods of time, it's best if you power the circuit via 5V USB power supply. You can use your computer's USB port, USB hub or dedicated 5V power supply.
Build a Prototype
If this is your first electronics project, it's a good idea make a prototype before mounting the components to the enclosure. You can use alligator clips to make quick connections without having to solder any wires. The idea here is to test the code and components to see if everything works as expected. You can ommit wiring the slide switch to the 500mAh battery in the prototype - Plugging the male JST connector from the battery to the Adafruit Feather board will prompty power the micro-controller on, unplug to power it off.
Alternatively, a breadboard is meant for prototyping, but soldering headers and desoldering headers can be a bit of a challenge.
Once you have uploaded the Arduino sketch to the Adafruit Feather 32u4 Bluefruit LE and test connected the NeoPixel Rings and 500mAh battery, verify everything works. With that, you can proceede to the 3D printing and assembly.
We recommend using PLA material for this project. You can use ABS or other type of filaments but may require a heated bed. PLA prints with minimal warping and doesn't necessary require a heated bed.
The table below is a general reference for slice settings. Every 3D printer is slightly different, so you might want to use settings you're familiar with.
0.1mm Layer Height
90/150 mm/s Speeds
Twisty top part connects to case.
Main case holds components.
Print in a white or a translucent colored filament.
Connects to twisty top part.
Print in a white or a translucent colored filament.
Download, Modify, Remix Design
The parts were modeled in Autodesk Fusion 360 and available to download, modify and remix. The parts can be exported in several file formats - great if you're using a different CAD package.
The remaining three wires will be used to connet the 24 x NeoPixel ring to the Adafruit Feather 32u4 Bluefruit LE.
NeoPixel Wires and Switch
Now our NeoPixel PCB and Slide Switch are wired up.
Now all of our wires and components are connected. It's a good idea to test out circuit before mounting things to the enclosure. Plug in the JST connector from the 500mAh battery into the JST port on the Adafruit Feather board. Flip the slide switch on and you should see red LED's flashing on the Adafruit Feather.
Install Slide Switch
The slide switch should hold in place with friction, but if you find it loose, you can use adhesives to permanently mount in place.
Install Battery and NeoPixel
Next up, place the 500mAh battery over the Feather board. Route the wire from the battery through the cavity and press it down so it's nested inside. Then, adjust the wires so the NeoPixel ring can sit on the circular mount. Make sure not to kink any of the wires.
Lay the top part over the case and start twisting it until the threads meet and fasten the two parts together.
Install Cover Diffuser
Lay the diffuser cover over the opening of the case.
Install Voronoi Lamp Shade
Now you can press the lamp shade down top the top cover pieces.
And thats it! Now you have a pretty cool looking lamp shade. If you've made one, we'd love to see and share about it on the blog! You can post a "make" on the Thingiverse project page.
If you have any technical issues or questions, please post them up in the Adafruit Forums so our dedicate engineering support team can assist you.