loading

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

PARTS :

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)

10.Wires

11.Perforated Board

12.Tracing Paper

13.Duct Tape

14. Arduino and Jumper Wires

15. 10uF electrolytic Capacitor

TOOLS:

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.

Working

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

I didn't see the code?
<p>It is in step-7</p>
<p>please help me</p>
<p>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</p>
<p>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 <strong>they are too small</strong>. They are for LR44 and not CR2032 batteries. I think that the link should go to <a href="http://www.ebay.com/itm/5-x-Black-CR2032-Button-Battery-Clip-Holder-Box-Case-black/281674898088?_trksid=p2047675.c100005.m1851&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D35605%26meid%3D04711c320a0c4c8aac3eb1a0498f5020%26pid%3D100005%26rk%3D4%26rkt%3D6%26sd%3D371251421324" rel="nofollow">something like this</a> 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. </p><p>Other than that, the instructable is easy to follow, even when using a common cathode RGB LED. </p><p><strong><em>Thanks for sharing!</em></strong></p>
<p>what</p>
<p>You are welcome :)</p><p>Good Luck and don't forget to share the picture after completion.</p>
<p>Thanks for the information. Built about 5 of these. Had to connect my LED to ground though. Thanks!</p>
<p>HOW DID YOU DO IT!?!?!?!?!??!?!?!? THIS IS IMPOSSIBLE SOSOSOSOSOS</p>
<p>Congratulations ...</p><p>Thanks for sharing the pics.</p>
<p>Thanks for the schematics! For the LED, should you connect it to GND instead of V3?</p>
The schematic is correct. The RGB is common anode type.
<p>How long would you say the battery lasts? as I would like to make a project similar to this</p>
<p>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.</p>
<p>Yes it will work.Try to keep all the leds close to each other.</p>
<p>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</p><p>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?</p><p>and how if i put another 1 more RGB led in parallel (all RGB pins coupled together) to make the lamp brighter?</p><p>or do u have another way to make the lamp brighter somehow?</p>
<p>Glad you love my projects :)</p><p>You can parallel the coin cell no problem for attiny85 and parallel the led for more brightness.</p>
<p>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 </p>
<p>Nice project :)</p>
<p>I am glad that you like it.</p>
<p>Can I use Tactile Switch instead of sliding switch?</p>
<p>No because tactile switch makes a momentary contact.You need a switch which can permanent contact when on and no contact during off.</p><p>It is not mandatory to use a sliding switch. You can use a toggle switch.</p>
<p>Thanks for the reply!</p><p>I will try to get this done!</p>
<p>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 http://i.ytimg.com/vi/Foc9R0dC2iI/hqdefault.jpg</p>
<p>Thanks for the information.I did not know it.</p><p>But for novice I think it is complicated.Using a simple switch is better.</p>
<p>Ahah yes, the switch is a simplier choice indeed! </p><p>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</p>
<p>Good idea :)</p><p>After completion please share the pics here.I am waiting for it.</p>
<p>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.</p>
<p>The capacitor is need for programming by using an Arduino.After programming there is no role of capacitor.</p>
<p>Awesome Project :D</p>
<p>Thanks..</p>
Amazing job!
<p>Thank you :)</p>
good work kudos!
<p>Thank you :)</p>
That's so awesome
<p>Thanks..</p>
<p>Very interesting project! Thanks for including the code/schematics. </p>
<p>I am glad you like it:)</p>

About This Instructable

21,953views

447favorites

License:

Bio: I am an Electrical Engineer.I love to harvest Solar Energy and make things by recycling old stuffs. I believe &quot;&quot;IF YOU TRY YOU MIGHT ... More »
More by deba168:Solar Powered WiFi Weather Station  3 Useful Things From an Old Laptop DIY Mobile Boombox 
Add instructable to: