Glass Jar Firefly (Beginner Arduino Project)

3,732

101

4

Introduction: Glass Jar Firefly (Beginner Arduino Project)

About: I just created a youtube channel to give how-to's and quick previews of all the projects that I make in my garage. I decided in sign up for instructables in order to show more people my tutorials! Please suppo…

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!

Materials:

any arduino will work! I just used an arduino micro pro because of its small form factor

https://www.amazon.com/ATmega32U4-desarrollo-Micro...

LEDs with included resistors!

https://www.amazon.com/EDGELEC-Tri-Color-Multicolo...

small breadboard

https://www.amazon.com/MCIGICM-6PCS-tie-Points-Bre...

9v battery clip

https://www.amazon.com/Battery-Connector-Leather-H...

matte finish spray

https://www.amazon.com/Aleenes-Spray-Finish-Acryli...

glass jar

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.

Glass Speed Challenge

Participated in the
Glass Speed Challenge

Be the First to Share

    Recommendations

    • Make it Fly Challenge

      Make it Fly Challenge
    • Backyard Contest

      Backyard Contest
    • Summer Fun: Student Design Challenge

      Summer Fun: Student Design Challenge

    4 Comments

    0
    jmõttus
    jmõttus

    Question 10 months ago

    Cool project. How difficult it would be to use one controller built into one jar, but to attach more jars to the circuit? I'm thinking about a set of jars that can be hanged from a cable or wire across the yard.

    0
    cp256
    cp256

    11 months ago

    This similar to a PWM circuit that I made for an electronic candle, which might work well for a firefly and extend battery life. I had one of those cheap LED candles that run off of a coin cell (like a 2025 or 2032), but it was constant brightness and didn't emulate a candle very well. I prototyped a flickering version with an arduino and 5 mm yellow LED that fits a flame shaped plastic cover from the cheapo candle. When the PWM code looked good I then built it with an ATtiny13a 8 pin 8-bit AVR microcontroller with a software PWM hack to minimize the current draw. It ranges from 4.3 to 6.5 milliamps when running with about 4.15 ma being used by the microcontroller. Still more than I'd like to have running from a couple of coin cells. Maybe a small LiPo battery would work ok, but then I would have to build in a charging port/system of some kind. I have one from a bluetooth headset I upgraded that might work...

    0
    AnandM54
    AnandM54

    11 months ago

    Awesome cool idea!! Brilliant

    0
    littlebadwren
    littlebadwren

    11 months ago

    This is so much fun....What a magical project!