[ Play Video ]

I wanted to create something for upcoming New Year gift to present my parent.At the same time I saw a competition on MASON JAR is going on in instructructables. So it only made sense that I would use mason jars to make simple DIY lamp.Making mason jar lights is really, really easy!.After all this is what I came up with.It is the perfect blend of rustic and tech, don’t you think?

This is a dark activated color changing mood lamp. Its brains is a ATtiny85, but you could also use an Arduino.It has a light sensor which sense the light condition and decide when the room light is turned off.This then will light a RGB LED and slowly fade through different colors.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Parts and Tools Required :


1. Mason Jar (Amazon)

2. Attiny85 (eBay)

3. 8pin DIP socket (eBay)

4.Coin Cell (eBay)

5.Coin Cell Holder (eBay)

6.Resistors (1x10k and 1x 50ohm)

7.LDR (eBay)

8.Common anode RGB Led (eBay)

9.Sliding Switch (eBay)


11.Perforated Board

12.Tracing Paper

13.Duct Tape

14. Arduino and Jumper Wires

15. 10uF electrolytic Capacitor


1.Soldering Iron

2.Hobby Knife

3.Glue Gun

Step 2: Schematic and Working :

The brain of the lamp is Attiny85. The LDR and 10K resitor makes the light sensor.The sensor output is connected to the attiny analog pin-3.The sensor detect when the room is dark and tell attiny to give varying pwm signals to the RGB led.According to the different values of PWM signal the color of the RGB led changes.For power switch I used a sliding switch.


The ATtiny85 only has 2 PWM pins.But to change the color of a RGB led we need 3 PWM pins.This limitation is overcome by using software PWM.This means that you can fade in and out of all 3 colors using any of the pins on the ATtiny.The software PWM works by setting the pin HIGH and then LOW at different rates so that the LED looks like it's dimming. This is called Persistence of Vision or POV. The LED blinks so rapidly that the human eye can't detect that it is flashing at all, and it sees instead that the LED appears to be dimming.

Step 3: Preapare the Perforated Board

The lid of the jar is circular.So I first cut a rectangular board by using plywood cutter.Then I trimmed the edges with a tin cutter.Hit and try until the board fix in to the lid.

Step 4: Solder the Cell Holder and DIP Socket

First place the Coin Cell holder and DIP socket as shown in figure.

Then solder it.

Step 5: Install the Switch

Drill a hole for installing the sliding switch.I used 6mm drill bit for making the hole.use a drill bit according to your switch size.Then install the switch by applying hot glue.

Note : I forgot this stage,so make the hole after placing the cell holder.When you will make this project, drill the hole before soldering any components on to the board.

Step 6: Solder Everything As Per Schematic

After soldering the components, join the soldering points by wires.Refer schematic during this stage.

Add a current limiting resistor to the anode.In my case it is around 50ohm.

Note : Instead of using single resistor you may use 3 resistors with three cathodes.Both works fine.

If you want to power it with 5V then you should change the resistors value.

For calculating the current limiting resistors click here

Step 7: Program the Attiny85

There are many great sites and other instructables that give step by step instructions on how to program a ATtiny85 with a Arduino. The reason I used the ATtiny85 was because it is a cheap chip and the size is very small .

I program it on a bread board.If you have a shield then it is very easy.

The details of program an attiny is explained here

The code is attached bellow.Change Light threshold value from 0 to 1023. Lower number means activation at lower light level.

If you are using a Common cathode RGB led then Change HIGH to LOW and LOW to HIGH in the code.

Step 8: Frosting the Jar

You can use your imagination to find a way to diffuse colors uniformly. Color diffusion is necessary to achieve best results.So frosting of jar is needed.The best way to frost the mason jar is by using frosting spray paint.

For frosting a glass jar you can see here.

You can buy the frosting spray paint from eBay or Amazon

In my country I did not find it ,So choose a short cut method.I used a tracing paper to diffuse the light.

Cut the tracing paper with width equal to the height of the jar.Roll the paper and insert in to the jar.If you have a frosting spray then you can use it.

I satisfied with my cheap solution.

Step 9: Mount the Board

Stick duct tape to the board.I used scotch tap.Then place it inside the lid and stick the tap to the lid inner edges.

Make sure that the LDR is bend toward the top, in such a way that it exposed to light.

For better response of LDR use jar with transparent lid.

Then close the lid.

Step 10: Test the Lamp :

To test the lamp slide the switch to ON position and switch off your room light.You will get a surprising gift.

I have a lot of fun while making my own jar mood lamp.If you are thinking to make this, I am sure that you are probably the new proud owner of an adorable little mason jar mood lamp.

If you enjoyed this article, don’t forget to pass it along!

Follow me for more DIY projects and ideas.

Thank you !!!

Mason Jar Challenge

First Prize in the
Mason Jar Challenge

Homemade Gifts Contest

Participated in the
Homemade Gifts Contest

Make it Glow!

Participated in the
Make it Glow!

1 Person Made This Project!


  • Assistive Tech Contest

    Assistive Tech Contest
  • Reuse Contest

    Reuse Contest
  • Made with Math Contest

    Made with Math Contest

36 Discussions


2 years ago

somebody please help me this is so extremely hard to make HELP ME PLEASE SOS! i dont understand anything but it is really cool and looks really easy if you understand


3 years ago

I'm in the process of making this and finally got the battery holders and switches in. As soon as I opened the bag for the holders (that are recommended), I noticed that they are too small. They are for LR44 and not CR2032 batteries. I think that the link should go to something like this instead of what you have listed :-(. I could probably use three(3) of the smaller batteries in series, but it would then have a larger footprint and might not fit in a standard mason jar.

Other than that, the instructable is easy to follow, even when using a common cathode RGB LED.

Thanks for sharing!

2 replies
Open Green EnergyProfeC

Reply 3 years ago

You are welcome :)

Good Luck and don't forget to share the picture after completion.


3 years ago

Thanks for the schematics! For the LED, should you connect it to GND instead of V3?

1 reply

4 years ago on Introduction

How long would you say the battery lasts? as I would like to make a project similar to this


I'm wondering what i have to do if i want to use 3 led instead of 1 like resistors or something, i gonna make one for a gift i hope it's gonna work.

1 reply

For the 2nd time, i'm really fascinated by ur projects, n makes me wanna try again :D your projects are cool, i really love it :D

anyway, how if i make double cells connected in parallel, to enhance the endurance of the cells, would it be okay for the ATtiny85 carrying that current?

and how if i put another 1 more RGB led in parallel (all RGB pins coupled together) to make the lamp brighter?

or do u have another way to make the lamp brighter somehow?

1 reply

4 years ago on Introduction

Hi! i love your project and i try to make it, but IC ATTiny45/85 it's very difficult to buy it. So Can I use another IC and show me how to use it? plese

No because tactile switch makes a momentary contact.You need a switch which can permanent contact when on and no contact during off.

It is not mandatory to use a sliding switch. You can use a toggle switch.