Introduction: Glass Jar Firefly (Beginner Arduino Project)
This a super simple and easy project, perfect for those just getting interested in Arduino and how PWM signals work to make LEDs dim on or off! It is also a fun way to reuse an old jam jar into a fun and simple project! Feel free to comment on suggestions to improve the project so that others can be inspired!
any arduino will work! I just used an arduino micro pro because of its small form factor
LEDs with included resistors!
9v battery clip
matte finish spray
you can use any old glass jam jar or even a mason jar!
Step 1: Create the Diffused Effect!
The secret to making an awesome diffused lighting to a glass jar is a matte finish coating! There is no need to sand the glass down to make it diffused, all you need to apply a few coats of matte finish spray from any hardware store or online!
Apply at least 2 coats and if possible try to spray in the inside of the jar as well to make the LEDs most diffused as possible.
And like I said in the intro, any glass jar! The only thing you need to worry about is making sure that the lid of the jar can fit all the components. The glass jar I used had a 4 inch diameter lid.
Step 2: Wire & Code!
The schematics and code for this project is extremely simple and can be easily modified!
Feel free to use any LED and more LEDs if you want!
I used two RGB LEDs because those were the only two I had, and I created the color combination by basically powering just the RED and GREEN pin of the LED, connected them to the same PWM pin on the Arduino.
I included a wiring schematic for 2 RGB LEDs and 2 regular LEDs, as using normal ones would be much simpler! And for the resistance, do not worry too much about getting the exact resistance correct: all you need is a resistor that is at least around 300 ohm, as long as it protects the LED from being supplied more than recommended max voltage. Please leave a comment if you have questions!
The code I used can be modified to make its "breathe" effect faster or slower, or even coded to occur in random and more irregular patterns!
Step 3: Add Battery!
I used a 9 volt battery to supply the Arduino Micro Pro I was using, connecting the ground to GND and the positive terminal to the RAW pin of the arduino. Most arduino boards are able to be powered by a standard 9 volt battery, but double-check its board information online to see its recommended input voltage range.
Step 4: Secure Components on Lid!
I love this project because it required no soldering and no hot-gluing! It was really simple to attach the breadboard to the battery, and the battery to the inside of the glass jar lid! But feel free to be inspired to make better and more secure component housing!
Step 5: Hide the LEDs on the Arduino!
Simply use some thick tape to cover the LEDs on the arduino board, or else it will interfere with the color of the LEDs and thus ruin the firefly effect!
Step 6: Secure on Lid and You're Done!
That's it! This project is fun and simple for those just getting into arduino, and the result is great! There is no soldering involved which is also a plus for its simplicity!
If this project could be improved, here would be my personal suggestions:
- Soldering a switch for easy on/off
- Adding a photoresistor so jar turns on automatically in the dark
- Breathe effect occur at irregular times so it creates a more natural organic lighting
Thank you for viewing this project! Please comment if you have any suggestions or questions.
Participated in the
Glass Speed Challenge