[ 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.

Step 1: Parts and Tools Required :

Picture of 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 :

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of  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

Picture of 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 :

Picture of 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 !!!


35fordrat (author)2014-12-28

I didn't see the code?

deba168 (author)35fordrat2014-12-28

It is in step-7

lgaravito (author)deba1682017-01-20

please help me

lgaravito (author)2017-01-19

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

ProfeC (author)2016-02-13

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!

lgaravito (author)ProfeC2017-01-19


deba168 (author)ProfeC2016-03-23

You are welcome :)

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

oculartechie made it! (author)2016-02-22

Thanks for the information. Built about 5 of these. Had to connect my LED to ground though. Thanks!

lgaravito (author)oculartechie2017-01-19


deba168 (author)oculartechie2016-03-23

Congratulations ...

Thanks for sharing the pics.

oculartechie (author)2016-02-06

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

deba168 (author)oculartechie2016-02-06

The schematic is correct. The RGB is common anode type.

rwhite19 (author)2015-06-19

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

david.manciet (author)2015-02-04

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.

deba168 (author)david.manciet2015-02-04

Yes it will work.Try to keep all the leds close to each other.

chrismarshal25 (author)2015-01-31

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?

deba168 (author)chrismarshal252015-01-31

Glad you love my projects :)

You can parallel the coin cell no problem for attiny85 and parallel the led for more brightness.

ninhkhang99 (author)2015-01-19

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

Saiyam (author)2014-12-29

Nice project :)

deba168 (author)Saiyam2014-12-30

I am glad that you like it.

kanong123456 (author)2014-12-29

Can I use Tactile Switch instead of sliding switch?

deba168 (author)kanong1234562014-12-29

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.

kanong123456 (author)deba1682014-12-29

Thanks for the reply!

I will try to get this done!

DyerMors (author)kanong1234562014-12-30

You can use a tactile switch if you design a soft latching switch, search on google you'll find tons of shematics! Even Dave Jones from EEVBlog have designed one very easy, i'll link you the schematics

deba168 (author)DyerMors2014-12-30

Thanks for the information.I did not know it.

But for novice I think it is complicated.Using a simple switch is better.

DyerMors (author)deba1682014-12-30

Ahah yes, the switch is a simplier choice indeed!

Before i forget, i love this project, i'm building one right now! I'll probably add more than one rgb led, controlling them with npn transistors! The more, the better, no? ahah keep up the good work

deba168 (author)DyerMors2014-12-30

Good idea :)

After completion please share the pics here.I am waiting for it.

kanong123456 (author)2014-12-29

I really appreciate this project and I am already preparing all the components needed. One more question: do I need the 10 uf capacitor. I didn't see it used in all the steps.

deba168 (author)kanong1234562014-12-29

The capacitor is need for programming by using an Arduino.After programming there is no role of capacitor.

KawaiiPotato (author)2014-12-28

Awesome Project :D

deba168 (author)KawaiiPotato2014-12-28


watchmeflyy (author)2014-12-28

Amazing job!

deba168 (author)watchmeflyy2014-12-28

Thank you :)

chinmay.das (author)2014-12-28

good work kudos!

deba168 (author)chinmay.das2014-12-28

Thank you :)

ZiggzaggZebra (author)2014-12-28

That's so awesome

deba168 (author)ZiggzaggZebra2014-12-28


mtairymd (author)2014-12-28

Very interesting project! Thanks for including the code/schematics.

deba168 (author)mtairymd2014-12-28

I am glad you like it:)

About This Instructable




Bio: I am an Electrical Engineer.I love to harvest Solar Energy and make things by recycling old stuffs. I believe ""IF YOU TRY YOU MIGHT ... More »
More by deba168:DIY Professional 18650 Battery PackDIY Acrylic RGB LED SignHow to Make a Bench Power Supply
Add instructable to: