Introduction: Solar Powered Arduino Clock!

About: Tanmay Bhonsale a.k.a enceladus2000

Recently I've been interested in solar power and its applications.With the advancements in solar panel technology, solar panels have become much more efficient and cheap at the same time. However, they're still kinda expensive, so powering up an apartment with these stuff will set you back by hundreds, or even thousands of dollars.

So as powering your house is out of question for small time tinkerer like me, I thought of doing something on a smaller scale. So I came up with my cheap Solar Powered Rechargeable Clock, using a homemade Arduino board, an LCD, a powerbank and some other stuff easily available at electronics dealers like SparkFun. In fact this project is a culmination of several projects, like a Solar Power Supply, Solar Charged Powerbank, and a DIY Arduino Clock. In this Instructable I'll bee showing you how to:

  • Make your own Arduino Board
  • Use an RTC (real time clock) with Arduino
  • Use an Alphanumeric LCD display with Arduino
  • Make a Solar Powerbank Charger

So even if you don't want to make exactly the Clock that i made, you can still refer to this Instructable for how to make your own Arduino, use an RTC and LCD, and make a solar charger. The end result was an awesome solar powered clock with a lot of features!

  • Powered by renewable energy: The entire clock is powered by solar energy, which is clean and creates no carbon emissions.
  • No need of a Wall Wart: The clock is totally self-sufficient.
  • Efficient Solar Charger Circuit: The solar charger circuit uses a switching power supply which is extremely efficient compared to linear voltage regulators
  • Easy-to-make: The clock consists of several modules, which instead of being soldered together, are just connected with jumper wires. This makes it easy to make, troubleshoot, modify and hack!
  • Cheap and Compact.

Step 1: Project Details...

Cost: $40 if you buy stuff from SparkFun or Adafruit. $18-20 for me though.

Difficulty: Intermediate level

Time: 24hours, over a week's time...


  • Experience in soldering
  • Knowledge of Arduino
  • Basic knowledge of electronics


For Homemade Arduino board:

  • ATmega328P-PU
  • 16MHz crystal
  • 28-pin IC socket
  • Female headers
  • Button
  • Capacitors - 22pF
  • Resistors - 10K

For RTC Breakout Board (or you can buy a preassmebled one from Adafruit):

  • DS1307 IC
  • 4-pin IC socket
  • 32.786kHz crystal
  • Female Headers
  • Resistors - 10K
  • Coin cell holder
  • CR2032 coin cell

For Power Supply board:

  • LM2575 - 5.0v
  • DC Jack Connector
  • microUSB male plug
  • Capacitors - 100uF
  • Inductors - 220 - 400uF


  • 16x2 LCD display
  • Solar panel (3-10W)
  • Jumper wire (lots)
  • General PCB
  • Solder
  • An original Arduino for programming the Homemade Arduino

Step 2: Make Your Arduino Board...

Making an Arduino on a perfboard isn't very difficult at all. You'll probably spend 2-4 hours in total, so I suggest you do it over a couple of days. Soldering the Arduino requires a little soldering experience and proper tools, so if your a beginner check out this.

First solder all the passive components, like the sockets, headers, buttons, resistors, capacitors and thecrystal. I have not soldered the ATmega328 directly to the PCB, but instead soldered on 2 berf socket strips into which I'll place the microcontroller. This makes it easy for me to solder without worrying about frying my chip. You can solder the components in any arrangement you like, but if you want to do it the easy way, follow these steps:

  1. Solder all the passive components to the PCB, as shown below. NOTE: Soldering the bent male headers is only required if you plan to program you ATmega with an FTDI breakout. I have however shown a way to program the microcontroller with another Arduino, which is much easier.

  2. Now solder the jumper wires; vcc pin to the 5v header, A0 and A1 pins to their respective headers, and the wired to the ftdi cable. Refer to the circuit above for help.

  3. Now make the solder tracks on the PCB. The result is shown below...

    How to make solder tracks??? In the following pictures I have shown how to make a solder track connecting the ATmega's pin to the respective header...

    • Deposit a blob of solder on the pad(s) between the pins you want to solder, as shown on the above...

    • Melt the ATmega pin and the middle solder blobs with the solder iron, and while they're molten, add some more solder (not too much!) and remove the iron (but not the solder wire!). Remove the solder wire just before the lead completely solidifies. See the picure below...

    • Repeat the above step for the header pin too. Basically melt the two blobs of solder you want to join, and while they're molten, add more solder and remove the iron. This is the result...

  4. You have now completed the "Arduino" circuit on the PCB. It is also helpful to add more 5v and ground headers. I also added a male USB plug for conveniently powering the board...

  5. Check all the connections; see if you've forgotten anything, or if the solder tracks are incomplete, or if something is loose. Then pop in your ATmega328 chip...

    Yay! Your Arduino is complete!!!

Step 3: Make the RTC Breakout Board...

The RTC (Real Time Clock) is, in simple words, the timekeeper. I have used a DS1307 IC as the RTC. It uses a 32.768khz crystal to accurately keep time, and communicates with the Arduino using I2C. The DS1307 needs a 3v battery to keep time when not supplied 5v. I have used a coin cell for that purpose, and this chip uses such little power that the cell will last for 8 years!

Important Pins:

  • 5V Pin: When this pin is high then the ds1307 sends the data and when it is low it runs on the backup button cell.
  • GND: This is the ground pin for the module. Both the ground of the battery and the power supply are tied together.
  • SCL: It is the i2c clock pin - Which communicates with the RTC.
  • SDA: It is the i2c data pin - Which communicates with the RTC.

The breakout board makes using the RTC easy; you only need to use these 4 pins - 5v, Gnd, SDA and SCL. For making the board, refer to the circuit diagram given abovr. Here are the instructions to make one...

  1. Solder down the sockets, coin cell holder, 4-pin header, wire and components...

  2. Make the solder traces. Use the circuit diagram at the top for help.

    Yes is does look kinda messy, but the connections are secure. Test them with a continuity tester.

  3. Pop in the DS1307 chip and the coin cell.

    Remember to put the coin cell later on!!!

Now that you have made your RTC breakout board, it's time to move on to the next step...

Step 4: Connect the RTC to the Arduino...

You'll have to use an Arduino with USB Serial connection for this step. Connect the RTC breakout board's power pins and the SDA and SCL pins to the SDA and SCL pins of your Arduino. Different pins are assigned as SDA and SCL on different Arduino boards, so here are the pins for each board...

  1. Arduino UNO: SDA - pin A4, SCL - pin A5
  2. Arduino Mega, Due: SDA - pin20, SCL - pin21
  3. Arduino Leonardo, Micro: SDA - pin2, SCL - pin3

Refer to the pictures above for help.

Step 5: Set Time on Your RTC...

Now its time to work on the computer. Download the Time and DS1307RTC libraries. Import the libraries to Arduino IDE, and then start the IDE. Then go to File < Examples < DS1307RTC < setTime.

Upload this "setTime" sketch to your Arduino board (with the RTC board connected). Now, DON'T reset or remove your board from power. From the DS1307RTC library examples, open the ReadTime sketch, and upload.

Step 6: Make the 5V Regulator Circuit...

I have used an efficient SMPS (switching mode power supply) 5V regulator IC called the LM2575. This IC comes in many versions; 3.3v, 5v, 12v etc, so be sure you get the 5v version. Follow the circuit diagram above to make the 5v regulator circuit. I have used a DC power jack for connecting the solar panel (i.e input voltage). I have also connected a male microUSB cable to the 5V output so that i can easily connect to to a powerbank (as shown above in the pictures).

Step 7: Program Your Homemade Arduino...

Upload the ArduinoISP sketch to your original Arduino board.

Now, follow the above pictures to connect your original Arduino with your homemade Arduino. Connections are different for different Arduino boards, so I have included the connections for both the UNO and Mega. After checking all connections, connect the original Arduino to the computer. Then, paste the code from the attachment below into your Arduino IDE window.

Then, change your programmer to "ArduinoISP", like this...

Change your board too...

Now select "Upload Using Programmer"...

Your sketch should upload well!!!

Step 8: Connect Everything!!!

It's time to put the Homemade Arduino, LCD Screen and RTC board together. Follow the above diagram for help.

Step 9: Finish!

You can make any sort of enclosure you like! I made one using a Pringles can. I then covered it up with colored paper (i'm not very great at painting and decorating). The resulting enclosure l looks simple and neat. Then place all the components (Arduino, RTC, LCD, Power supply and powerbank) inside... Your clock is ready!!!

Adding Solar Power...

I have used a 3W solar panel (dimensions 10 x 20 cm) to power my clock. Keep the panel in a place which receives a lot of direct sunlight, like a balcony. Keep the clock inside. Here is a picture of my solar panel in the bright sunlight in my balcony...

Connect the solar panel's plug to the power supply board like this...

Then connect the output of the power supply board to the input of the powerbank...

And finnaly connect the output of the powerbank to the Arduino. The solar powered clock is complete!!!

MAKE ENERGY: A US-Mexico Innovation Challenge

Participated in the
MAKE ENERGY: A US-Mexico Innovation Challenge