DIY Mason Jar Solar Lantern




Introduction: DIY Mason Jar Solar Lantern

About: I am a DIY hobbyist by passion and Power Engineer by profession. Most of my works are related to Solar Energy and Arduino. Apart from Electronics I love 3D printing, Woodworking and to make crafts from used …

In this Instructable, I am going to show you how to transform a glass jar into a piece of decorative solar lantern. I have designed a custom PCB for this project, so people with minimal electronics skills, can make it easily within an hour. The PCB can support a variety of LEDs to get different effects. This is an inexpensive and easy way to add charm to any outdoor space which gives off beautiful light well after the sunsets.

The Solar Jar depends wholly on the sun for power, which ultimately means it saves you more energy, and you don’t have to worry about unplugging once it is fully charged because the battery automatically stops charging once it’s full, and as long as the solar panel is facing the sun, you can rest assured that it will charge and ultimately give your garden a colorful illumination. The Solar Jar Lantern is equipped with inbuilt sensors. Once the sun begins to fade into the horizon, it automatically switched on leaving your garden with colorful rainbow light.

Update on 31.05.2022:

I have designed a DIY kit and a 3D Jar for this project and it is now available on my tindie store. Please support me there and help me to grow.

Download the STL files for Mason Jar from Thingiverse.


Components Used:

1. Solar Panel -2V ( Aliexpress )

2. Controller QX5252F ( Amazon )

3. 33 uH Inductor ( Amazon / Banggood )

4. RGB LED ( Aliexpress / Banggood )

5. Sliding Switch ( Amazon / Banggood )

6. 1N4148 / 5819 Diode ( Amazon / Banggood )

7. 0.1uF Ceramic Capacitor ( Amazon / Banggood )

8. AAA Battery ( Amazon / Banggood )

9. AAA Battery Holder ( Amazon )

10. JST male-female connectors ( Amazon / Banggood )

11. Double-sided Tape ( Amazon / Banggood )

12. Mason Jar ( Amazon )

13. Candle Flickering LED ( Aliexpress )

14. Fairy String Light ( Amazon / Amazon )

15. PCB ( PCBWay )

Tools Used:

1. Soldering Iron ( Amazon / Banggood )

1. Wire Stripper ( Amazon / Banggood )

2. Nipper ( Amazon / Banggood )

3. Hot Glue Gun ( Amazon / Banggood )

Step 1: How It Works ?

The heart of this light bulb is a very small 4 legged IC QX5252F. It works very similar to the "Joule Thief " circuit.

But the advantage of using this chip is that it does not require a bulky and heavy toroid. It does the same job using only a simple inductor, a single AA / AAA battery, and a LED.

It requires only an external inductor is required for making the Circuit. The LED current can be changed by using a different value inductor. The chart is shown in the above picture. I have used 33uH Inductor in this project.

Connection :

Pin-1 -> Solar panel positive terminal

Pin-2 -> Battery positive terminal and one leg of Inductor

Pin-3 -> All ground ( Solar panel, Battery and LED negative terminal)

Pin-4 -> Another leg of Inductor

Step 2: Modifying the Circuit

The original circuit given in the datasheet uses only an inductor as external components to drive the standard LEDs. But it does not work for RGB and few other types of LEDs. So I modified the circuit by adding a buffer circuit to the original one.

The buffer circuit is just a diode ( 1N4148 ) and a capacitor (0.1uF ) at the output before connecting the LED. The diode keeps the capacitor charged when the pulsating signal goes to 0 volts.

After adding the buffer circuit, you can notice that the RGB LED cycles through all 7 colors.

Update: I have replaced the diode 1N4148 with 1N5817 for better performance.

Step 3: PCB Design

I have designed a custom PCB for this project. You can download the Gerber Files from PCBWay

Note: When you place an order from PCBWay, I will get a 10% donation from PCBWay for a contribution to my work. Your little help may encourage me to do more awesome work in the future. Thank you for your cooperation.

Step 4: Solder the Diode

For Soldering, you will need a decent Soldering Iron, Solder and a Nipper. It is good practice to solder the components according to their height. Solder the lesser height components first.

Solder the diode ( 1N4148 ) in place of D1 on the PCB. The black strap on the diode indicates the negative terminal, which is also indicated on the PCB.

You can follow the following steps to solder all the components :

1. Push the component legs through their holes, and turn the PCB on its back.

2. Hold the tip of the soldering iron to the junction of the pad and the leg of the component.

3. Feed solder into the joint so that it flows all around the lead and covers the pad.

Once it has flowed all around, move the tip away.

Step 5: Solder the Inductor

Solder a 33uH Inductor ( 1/2 watt ) in place of L on the PCB.

First, bend the two legs as shown in the above picture. Then insert the leg into the PCB and finally solder them.

Trim the extra legs by using a nipper.

Step 6: Solder the Capacitor

Solder a 0.1uF Ceramic Capacitor in place of C1 on the PCB. This type of capacitor does not have polarity, so you can solder it anyway, it will work.

After soldering the capacitor trim extra legs.

Step 7: Solder the IC QX5252F

The heart of the solar lamp is IC QX5252F. It comes with a TO-94 package, the 4 legs are very close to each other.

So I have given space between the legs during designing the PCB.

Hold the IC QX5252F in one hand and stretch the legs a little apart as shown in the above picture.

Insert the IC into the holes labeled as " QX5252F " on the PCB. Be sure you are inserting in the right direction. The outline of QX52525 is drawn on the PCB to avoid confusion.

Then finally solder it and trim the extra legs.

Step 8: Solder the JST Connectors

I have used two JST connectors for connecting the battery and solar panel.

Solder the two JST ( Female) connectors as shown in the picture.

The polarity (+) is marked on the PCB.

Step 9: Solder the LED

You can now solder a 5mm LED onto the PCB directly. But to test a different kind of LED, here I have soldered a two-pin female header. By using this, I can easily swap between different kinds of LEDs one by another.

In the next few steps, I will test with the following LEDs:

1. Strawhat LED

2. Colour Changing RGB LED

3. Candle Flickering LED

4. Fairy String Light

Step 10: Slide Switch

The last step is to solder the slide switch. Insert it into the PCB where it is labeled " SWITCH ", then solder it.

Trim the extra legs by a nipper.

Step 11: Drill a Hole in the Lid

You have to place the solar panel over the jar lid. To pass the solar panel wires into the mason jar, make a hole by using the drill.

Pass the JST connector wires through the holder made in the lid.

Step 12: Mount the Solar Panel

Solder the red wire to the positive terminal and black wire to the negative terminal of the solar panel.

Then mount the panel on the top of the lid by using double-sided tape.

Step 13: Mount the Battery Holder

First solder the battery holder terminal with the battery JST connector.

Insulate the soldering joint by using the heat-shrink tube.

Mount the AAA battery holder just side to the circuit board.

Finally, connect the battery connector to the circuit board. Insert the battery into the battery holder.

Step 14: Mount the PCB

Align the circuit board to the center of the Jar lid.

Mount the circuit board by using double-sided tape.

Then connect the solar panel connector to the circuit board.

Step 15: Charge the Battery

Now slide the solar lamp switch to ON position and then place the Jar in the bright sunlight.

The solar cell will charge the battery.

Step 16: Test the Lamp

For a quick test, insert the LED into the female header.

Then slide the solar light switch to the ON position and cover the solar cell with your hand. The light should be turned ON.

Here I have used the 5mm Strawhat LED. The output of the lamp resembles a flashlight.

Step 17: Adding More Effects

You can use your creativity to produce a various attractive effects to the lamp.

I have filled the jar with acrylic pebbles to get the glittering effect.

Step 18: Adding Rainbow Effect

Here I have a two-pin RGB LED. Insert the LED into the female header.

Then close the glass jar lid and enjoy the slow and fast color-changing rainbow effect.

The acrylic pebble scattered the light in different directions which looks very attractive.

Step 19: Adding Candle Flickering Effect

Insert a candle flickering LED into the female header in the PCB.

Close the lid, and see the flickering effect.

Then I have added the acrylic pebbles, to get the more attractive light effect.

Step 20: Adding Fairy String Light

Initially, I was not sure, whether the PCB will support a fairy string light or not. But when I tested it, I was really amazed that it works with charm. But I will recommend you not use too long string, because it may exceed the current handling capability of the IC QX5252F.

First I cut the fairy string light from the battery box. Then stripped out the insulation from the terminal wires.

Then insert it into the female header to connect the LED. Place the string light inside the Jar and it's done.

You can make a few similar jars and place them in your garden or lawn. Now enjoy your new solar jar.

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

Follow me for more DIY projects and ideas.

Thank you !!!

Make it Glow Contest

Participated in the
Make it Glow Contest

Be the First to Share


    • First Time Author Contest

      First Time Author Contest
    • Fiber Arts Challenge

      Fiber Arts Challenge
    • Sculpt & Carve Challenge

      Sculpt & Carve Challenge



    Question 11 months ago

    Hi I have build this but the led don't flash it stay one colour I have changed the inductor fro 33uh to 270uh still don't go through the colour sequence


    Question 1 year ago on Introduction

    Hello I’m hoping you can help me. I’ve never done anything like this before so my questions might sound stupid. I want to put solar lights in my nephews favorite toy truck. I have the solar box which has a AA 1.2v 600mah battery. I’m trying to find out what LED Diodes I need to use. I found these on Amazon (see attached pic) but I don’t know if they are correct because it says they are 20ma. Can you please help me?


    1 year ago

    In your modification (adding a diode and capacitor) you'll have better results using a schottky diode like 1N5818. With its lower forward voltage drop and much faster switching time there's a noticeable increase in LED brightness.


    Reply 1 year ago

    Thank you for your valuable feedback. I will make the changes.

    Vandy BethG
    Vandy BethG

    1 year ago

    I don't understand about the PCB. Can I not order the completed PCB? Your link seems to take me to a site where I would download plans to make the PCB myself, but building PCBs is not in my skill set.


    1 year ago

    Great project for beginners but do not agree with some of the comments, its the part of creating something, not buying off the shelf equipment.
    I do wonder about the heat dissipation capability of the mason jar, batteries often do not like heat and something like this in the full sun can in fact explode under the right circumstances.
    So I advice some small warning. (do correct me if I am wrong and maybe I am overly cautious!)


    Question 1 year ago

    your project is simple but has many good idea for the people who want to start playing with LEDs. it is like a text book on LED. I have one question that based on my understanding most LED need at least 2V to turn on but your project needs jus 1.5V-2.0V. would you please what kind of magic you put in.


    1 year ago

    I thought it a neat project. However, you need to assemble a way to purchase the requisite parts w/o having to purchase fifty units of this (Gimax 50pcs QX5252F) or thirty of that (10 x 1/2W 33uH Inductor) and "20pcs/lot F5 5mm Fast/Slow RGB Flash Red Green Blue Rainbow Multi Color Light Emitting Diode Round LED Full Color DIY" plus "(100 Pieces) Chanzon 1N4148" as well as "650 Assorted Ceramic Capacitors" just to avoid shopping at the Dollar Store!


    1 year ago

    It's certainly true that you could take apart some mass-produced gadget and stick it in a little jar for a similar effect. There are plenty of projects on Instructables that are of that flavor.

    But that's not all that's going on here. The author has created a very approachable project that beginners can make more or less from scratch, and they have explained enough of the electronics to illustrate to beginners that things like that are within reach. I have learned many things from such projects on Instructables and elsewhere.

    But, yeah, not a Mason jar. :-)


    1 year ago

    Great project and nice PCB! I wonder if it would be better to put the switch between the inductor and the diode -- that way you can turn off the lights if you want to. I don't think it is necessary to turn off charging the battery.


    1 year ago

    Agree with Vyper. This is a great project for learning or just for the fun of assembling. However, just cutting a hole in a mason jar lid & sticking a dollar tree solar yard light in it gets the same result.


    1 year ago

    Not to be a jerk but, not a mason or mason style jar/lid... easy enough to adapt though.
    In the soldering section you state that you need a multimeter, and then never use one.
    In another section you say "Now you connect the oscilloscope at the LED terminal", Which is neither in the tools used list (neither is the multimeter) nor is a oscilloscope something *most* people are going to just have laying around


    Reply 1 year ago

    Thank you for spoting the errors in the text.


    Reply 1 year ago

    the saddest part while it's a good project I could go to the Dollar(Pound) store and pick up a solar light (often including the battery too) for $1-3 and take it apart to mount on/in a mason jar for less than the pcb and parts un-assembled <granted yours looks more versatile>


    1 year ago

    I voted for you.