Introduction: Solar Phone Charging System Featuring Sun Tracking

Picture of Solar Phone Charging System Featuring Sun Tracking

Solar power has become quite a star in green power generation recently. Especially here in Sydney, with the help of government policies, more and more buildings have solar power system on their rooftop.

As makers ourselves, making a small solar phone charger is becoming a fashion. There are many great entries in instructables about solar charger with portability in mind. They are great if you spend a lot of time outdoors.
Well people, I’m proudly present this instructable to you so that you can make your very own solar powered phone charging system with sun tracking.
Why tracking?
The sun moves 15 degrees every hour, angle of the incident solar rays directly affect the power output of the solar cell. A solar tracking gives 60% more power from the same solar cell.

Your will need
A solar cell – at least 6V, 1 Watt
A motor with gearbox
A circuit board
2x LM393 comparator IC, can be any similar comparator
A L293D H bridge motor driver IC
A IRF9450 MOSFET, or any similar P channel MOSFET
5k, 100k, 10k resistors
A 50k potentiometer
An IRF540 or similar N-MOSFET
One phototransistors (Darlington IR)
2 photocells or 2 photodiodes
Battery holder
Some 1N4004 diodes
Some sort of housing – I used my iPod touch case
And some batteries, I use NiMH here, you can also use Li-ion but the circuit may need to change

Soldering iron
Hot glue gun and hot glue
Drill could be useful too

Step 1: Let the Theory Begin (too Boring? Jump to Next Step Then)

Picture of Let the Theory Begin (too Boring? Jump to Next Step Then)

Solar cell is a current source; its output current varies with solar intensity. Therefore we can just charge a NiMH pack without additional circuit to limit the current. To harvest maximum amount of ‘juice‘out of the solar cell, we should pick a battery pack that matches the voltage output of the cell at its maximum power point.
We will need a diode to prevent current flow into the solar cell, which may contribute a 0.7 to 1V drop. And normally solar cell’s voltage is marked using the open circuit voltage. you may need to lower a 10% or so to get to the VMP.
If you are getting a 6V solar cell, then it is best to charge 3 NiMH in series. I have used an 8V solar cell, and I have 4 batteries charging in series, so about 2V each cell.

Step 2: Tracking Circuit Design

Picture of Tracking Circuit Design

For this circuit to work the pair of photocells or Light dependent resistor, LDR, has to act as eyes, giving lm393 comparators analogue signal about the sun’s position. And this pair is better built on a separate PCB from the main control board.
Voltage is divided through R1, 50k pot and R3, thus creating reference. The 50k variable resistor is use to set the NULL zone, or sensitivity. This way the system won’t be tracking every second of the sun’s movement. Saving energy spending to track the sun and also save the moment when the system rotates back and forth causing by its momentum.
The outputs of lm393 signal the H bridge chip to control the motor. Based on this design two comparators’ outputs will not be both HIGH at any given time; means there won’t be any error signal which cause the H-bridge to short out.
To conserve energy, L293d is usually disabled. The enabling signal came from LM393, when there is a HIGH from one of the comparators the voltage at EN1 will raise via the 1N4004 diode. Note here R6 has to be much bigger than R4 and R5.
Ground all the other inputs on L293d. this simple act can save about 20mA of current. I don’t know why L293d drain so much current on idle.
The small circuit at the left of the schematic, involving a phototransistor, a 10k resistor and a MOSFET, is designed to switch on battery power backup on the tracking system when the sun rise from the east while the panel is still left pointing to the west.

The phototransistor has to be a Darlington pair. You can test it by using a multimeter on continuity mode, placing the + test lead to the shorter pin on the phototransistor, and the – test lead on the longer one. It should be an open circuit when not infrared exposure. But once you turn the diode toward the sun your multimeter should peep.
This phototransistor is best place right behind the solar panel, and pointing to the east as shown below. Here the phototransistor is normally an open circuit, shutting off the MOSFET and the current can only flow from the solar cell to the batteries via diode D3. While the sun comes from the east will shine on the phototransistor making it a short circuit, raise the voltage across R7, and thus turn on the MOSFET. Now the diode D3 is bypassed and the current can flow from the batteries to the tracking circuit.

As for the MOSFET, any N channel MOSFET will work. But low gate to source threshold voltage is preferred.

It is time for the all important photocell sensor. You should construct the sensor on a different board, so it can be relocated easily. Connect two of these in series, and bend them outward slightly shown below. This configuration allows a bigger difference in solar energy on each cell, when the device is not facing the sun directly. This difference is small, but through the amplification of the comparators, controlling the motor is possible.

Step 3: Harvest the Solar Energy

Picture of Harvest the Solar Energy

There are many possible ways to use the energy stored. I use it to charge my phone. Boost convertor is required to regulate the voltage; the construction of such circuit will not be covered in this instructable. Designing a switch mode regulator is a tedious work, to achieve maximum efficiency also requiring a lot of tweets. It is best to buy one. Like minty boost from adafruit, or other boost module out there. I purchased a ptn04050 module from TI, and built a small supporting circuit around it.

To protect your NiMH battery pack, it is best to have a low voltage protection circuit. You can either buy a Lipo protection module, or build one according to this schematic.

The way the circuit function the IRF9450 acts as a switch, it only turns on when the gate-source voltage is high. As the circuit is just connected to the battery, gate-source voltage is zero. The MOSFET does not conduct. The push button PB1 is able to connect the gate or the MOSFET to the ground temporally. Switch on the MOSFET, and the rest of the circuit. The Vref is produce by the small circuit consist of a resistor and a BC549 NPN transistor. By tying the collector and base together on the transistor, the voltage across the collector and the emittor is constant at 0.6V.

This circuit will sustain itself until VOUT is less then 3.4V, determined by R2 and R3. It does not use any power on idle. Great for a care-free system.

Step 4: Putting All Together

Picture of Putting All Together

Now that the tracking circuit is done, secure everything in the housing you chose. Place the photocells anywhere you want as long as direct sunlight is achieved. Connect your solar panel to the port named solar in the schematic. Then your product may look like this.

Enjoy making your own solar system, the world could be greener everyday.


rachitm96 (author)2016-08-19

Hey h20 just wanted to know the specifications of the motor you used?

hotcheezy (author)2013-07-15

Hi H20steam, it's me again. I'm having some trouble with the circuit because it doesn't seem to work properly can you check my wiring. I'll upload a fritzing(breadboard) diagram. How would i check if the comparators are giving the right signal? and do i need to add a diode in the solar cell? and can i use the In4001 ones i don't have In4004. Thanks for your time

Nor MuharramA (author)hotcheezy2015-09-20

hello, can I ask you a few things, what kind of motor you use ?? and how do I know this circuit works?

h2osteam (author)hotcheezy2013-07-15

First you will at least 3 NiMH or NiCad batteries, just not enough voltage at 3V. and you will need a diode from the solar cell to the rest of the board, any diode that can handle the solar panel's rated current will do. I found couple mistakes in your wiring, i corrected those, take a look at the diagram. To do the circuit debug, first disconnect the solar panel, give >4V to the positive and negative rails. then cover up one of the light dependent resistor, LDR, see if the motor turns. try turning the pot until the motor starts turning. If that still doesn't work, then i advice you to carefully rewire the whole thing.

avelyn94 (author)2014-09-07

hey h2o can i ask you is your tracker still be able to function if the battery ran out of juice?

penguin6636 (author)2013-10-28

Could this circuit be used to a scaled up design (just the tracking part with some relays)? Could it be used to have several 100 watt panels tracking at once? I know it's crude but I'm just thinking potential.

h2osteam (author)penguin66362013-10-28

Absolutely. Just replace the l293d with relay motor drive, and you should be good to go. The circuit principle is the same regardless system size. As long as you made the modification to cope with larger panels there is nothing crude about it. Good luck

hotcheezy (author)2013-08-05

Thanks for your help. Couldn't have done all this without your help. I hope everything else is working properly I just tested phone charging part.

hotcheezy (author)2013-08-04

Got the part I ordered.and it works with iPhone 5 and iPad

h2osteam (author)hotcheezy2013-08-05

Congratulations. All working fine now? glad to help.

hotcheezy (author)2013-08-01

My batteries are around 10.4v fully charged. I have eight of these size AA batteries each at around 1.2v and they are 3000mAh each so 24000mah in total. Does that mean I'll use a step-down converter?

h2osteam (author)hotcheezy2013-08-01

Well does your solar panel produce enough voltage to charge them fully? if solar panel only give 9V OC then there is no point going for 10.4v battery pack. And if you want 10.4v pack, you will need a buck converter , sth like

BTW 8 3Ah battery in series gives you 3Ah in capacity. only when you parallel them their capacity add up.

hotcheezy (author)2013-08-01

Hi there my project is almost finished I will send some photos tomorrow because I don't have my camera with me. Anyways, I want this to charge my iPod touch. So that means I have to also buy a ptn04050 and also make a small circuit around it? Do you have the circuit diagram? Or can connect the OUT + - to a female USB and then connect to iPhone?

h2osteam (author)hotcheezy2013-08-01

I guess your battery pack would have less than 5V fully charged right? If so you will need a boost converter to provide a stable 5V output to a female USB port. Like this
note that Apple Ipod touch and iphone has charger protection circuit. They may not accept charging from this type USB boost circuit. Better make sure before you buy it.
At the time i made this system, ipod touch 2g was around. that wasn't too fuzzy about credentials of the charger. My circuit doesn't charge my Iphone 5 at all. You can fish around see if you can fool the iphone 5 to charge though. Your assignment :P cheers

hotcheezy (author)2013-08-01

Hi I noticed a mistake in the low protection circuit. The symbol for IRF9540 is supposed to be a P-channel but a N- channel. Is the source connect the battery+?

hotcheezy (author)hotcheezy2013-08-01

Oh. Your right..

hotcheezy (author)2013-07-29

So I tried again today and it worked looks like I really did underestimate the power of the sun. So now I'm moving on the the low battery protection circuit. But to charge the battery do I need this low protection circuit? Will the one before work just fine? I am still a little confused after reading about the low protection circuit part you wrote. Still not sure what exactly what it does. What do I connect to the OUT + OUT- ? And also the push button part does it act like a ON/OFF switch to this whole product? And if this is not the ON/OFF switch how would I add it? And is it possible to add some LED on the back of my casing to show the statues of the battery like how full it is?

h2osteam (author)hotcheezy2013-07-30

Hi there, it's great everything works fine for you. you don't need a battery low voltage protection circuit unless you plan to use those batteries to directly power something. say charge your phone.
For NimH batteries, one should stop discharging the cell once the individual cell voltage is below 0.7V to ensure its longevity. that is where the circuit comes in. the OUT+/- is the + and - to power the phone charger or other external load, and the push button is there to trigger the protection circuit not the whole thing. for example the protection circuit is default to use zero current and open circuit when you first connect it to the battery, once you trigger it the circuit will be powered from the battery and the OUT+/- is directly connected to the battery +/-. the circuit only return to open circuit once the battery voltage if below the set threshold. Therefore if you want to add a switch, put it between the battery and the input to the protection circuit.

hotcheezy (author)2013-07-28

Hey H20, So recently I worked in the design of this. And got nearly all the parts needed to build this. But when I switch from the battery to the solar cell. It just couldn't drive the motor. Maybe the current out put is too low? It says on the data sheet that it's Pmax = 2.5watts, VPM = 9 volts, IPM = 0.28 Apms,
VOC = 11 volts, ISC = 0.31 Apms, I checked the outputs of the lm493 and the enable pin but they were barely 3volts. Maybe it's because it's not very sunny. But the multimeter still shows the solar cell is giving about 8 volts. Not sure what's happening. And maybe the motor I bought might not work. It's a 12v dc motor 22rpm, 50Ma with no load, 240Ma with load.

h2osteam (author)hotcheezy2013-07-28

Yeah solar panels are not stable source for motor drive. Highly dependent on sun light. the system is design to work with a battery pack. the Phototransistor and MOSFET part of the circuit is designed to lend a helping hand when the rig wants to turn but haven't got direct sunlight. if in bright direct sun light, say noon-day sun, the system should work without battery pack.
I am actually working on solar powered electronics recently in my company. From what i know is that don't underestimate the power in sunlight. it may not look much brighter than a powerful desk lamp. trust me there is a lot of difference.

hotcheezy (author)2013-07-23

Will a IR detector work? i'm confused IR detectors are the same thing as phototransistors. The black on that i used was a IR detector.

h2osteam (author)hotcheezy2013-07-23

Most IR detector has very little amplification, IR transistor should have a much higher gain. If don't want to waste time finding the 'right' phototransistor then use what you got and build a circuit like this to replace the phototransistor + mosfet circuit.

hotcheezy (author)2013-07-22

It worked!!!!!!! Wow first time. So the problem was really the battery not being able to power both of them.... Now i'll work on the left side. So right now the problem is the phototransistor piece. I think i ordered the wrong thing. I did a little search on eBay on darlington Phototransistors but most of them were three pin ones. One stupid question how is this darlington phototransistor different from a normal phototransistor?
Does this one work?

h2osteam (author)hotcheezy2013-07-22

Darlington pair transistor is the equivalent of two npn or pnp transistors stack one the other, emitter of the first transistor is on the base of the other, thus the gain of the unit is the first transistor * second one.
The phototransistor part you sent me might work, but try the link i provide below first, it may have a better chance.

hotcheezy (author)hotcheezy2013-07-22

So i was wrong it was not the battery's problem... It was the chips problem.

hotcheezy (author)hotcheezy2013-07-22

So i went out today to test the ones i bought. and it sort of worked. The sun was quite strong. It seemed to only to beep if i point directly at the sun but if i tilt a little than it'll stop beeping...

h2osteam (author)hotcheezy2013-07-22

I have to apologize first. I confused the name for that IR photo~thing. some call it darlington pair photodiode, some call it NPN phototransistor, I don't know. Like you i can't find anything w/ darlington photodiode/ phototransistor, so i guess that is not right. Try this part number if you can find a buyer : BPW85B NPN infrared phototransistor.
I can't guarantee it is the right one. It's been a long time since i bought one of those. If that still doesn't work i can design a circuit for you to work around it. cheers

hotcheezy (author)2013-07-22

It worked!!!!!!! Wow first time. So the problem was really the battery not being able to power both of them.... Now i'll work on the left side. So right now the problem is the phototransistor piece. I think i ordered the wrong thing. I did a little search on eBay on darlington Phototransistors but most of them were three pin ones. One stupid question how is this darlington phototransistor different from a normal phototransistor?
Does this one work?

hotcheezy (author)2013-07-21

Hey again, so I think I narrowed the problem.It seemed that it I remove the l293D completely the Lm393N would work perfectly fine. And I measured the enable pin, 1A and 2A and they all gave me about the same as the battery's voltage. So maybe the l293D is drawing too much power? I did some more testing with the L293D and it seemed that one motor was moving and the other didn't(left side). And also you were saying about stuffing a 1M resistor from enable pin to ground. Are you talking about the left side enable pin or the right side's.

h2osteam (author)hotcheezy2013-07-21

Actually since you narrowed L293D is the issue then you dont have to add that 1M resistor just leave you current circuit alone for now. See if you can find another l293d to replace it. the chip might be damaged or just faulty from the beginning. if your left side H bridge is stuffed, then see if the right side one work, use the right side instead save you $. Just connect the 'enable' from the side you dont wanna use to GND to reduce interference. You should be set then. hopefully

hotcheezy (author)2013-07-18

Hey H20 me again, i've ran in to some problems. so the comparator is working fine. but the L293D didn't respond so i measured the voltage going to 1A and 2A both are fine t around 7.2volt but the enable pin was around 1.82volt so maybe something is wrong with my wiring or my power supply? BTW i'm using a 7.4V 350mAh Li-po battery. i have uploaded an image down below. thank you!!!

h2osteam (author)hotcheezy2013-07-19

Hi i notice couple mistakes in the drawing, dont know if your actual wiring is like this. the top side of your L293D as drawn has both GND pins connected to the positive rail, which is wrong of course. And it will be better, though not necessary to connect Pin 9 of the chip to GND so the other side of the H bridge won't be oscillating.
Check if you actually got 100k resistor there not some other lower value. you can also stuff a 1M resistor from the enable pin to GND instead.

hotcheezy (author)h2osteam2013-07-19

Yeah the GND wire were not correct in th drawing. Ah i checked everything...
Shouldn't the enable pins be connect to a 5 volt supply? Why the ground? BTW what is do place a 100k there (R7)? Is it to prevent too much current? And also is the output 1 on the comparator use to power the enable and 1A but output 2 only goes to 2A so if the sun is to the left it doesn't move? And also why is the two diodes connected to the ground? I understood what's happening on the left but not so much on the right... One more thing is the capacitors used for? Sorry if I asked to much just wanted to learn.=)

h2osteam (author)hotcheezy2013-07-19

Hi there. The reason enable on the L293 is not wired to Vcc permanently is to reduce standby power consumption, it draws ~5mA enabled and only ~0.1mA disabled. to make things clear, the diodes from comparator outputs forms a simple OR logic, so either comparator goes HIGH put out a HIGH logic after the diodes and enable to H bridge chip. The R7 100k resistor is to allow a default LOW state if neither comparator gives HIGH.
Take a read of this
The circuit should allow the motor to turn to the direction of the sun, if your circuit does the opposite, just reverse the connection to the motor. :P
Capacitors acts like small battery store electrical energy in electric field. and can provide large current when needed for a short period. Adding a capacitor in circuit can smooth out supply rail voltage drop by any sudden current draw by the circuit.

h2osteam (author)hotcheezy2013-07-19

BTW i would not advice you use a Lithium battery for the real solar charging instead of a Nickle based battery.
Lithium battery can be dangerous if not charged using the right charger, too much of the charge current or too high of charging voltage can cause it to puff or catch on fire.
Since my design has no battery protection what so ever, it's best to just use the more robust NiMh batteries.

hotcheezy (author)2013-07-18

Oh I just thought that a logic 1 is suppose to be a 5volt for the l293D. I have been doing DIYs for about a year now.

h2osteam (author)hotcheezy2013-07-18

You know what, when i was new to DIY i though the same. Actually logic one can be any voltage as long as the target device can recognize it as a HIGH logic. In this case L293D sees any voltage above 2.3V as a logic HIGH, you can see these info in the datasheet. So feel free to just supply that chip with 8V like the rest of the ICs.
As another example, these days PC CPUs uses only 0.4-0.7V, their logic HIGH is merely 0.2V. So yeah...

hotcheezy (author)2013-07-18

Hi H20stream, so far i've got the comparators tested and it worked yay! It was very frustrating at first because i've totally forgot about the pull-up resistors at the output. Anyways, i have a question. if my battery source was for example like 8v then won't the output of the comparator be also 8volt and it goes to the enable pin of the L293D which operates at 5volt so wouldn't that cause a problem to the system? Thank you very much with this project.

h2osteam (author)hotcheezy2013-07-18

Hi hotcheezy congrats on the success in your circuit. Hope you can get the whole thing working soon.
Regarding to your question, if you use 8v for supply then yes the comparator output will be at 8V level.the L293D can handle up to 36V, why do you want to limit its supply to 5V?
However if you set you heart on a 5V L293D, then having a 8V logic input can cause problem. Solution - add voltage divider to the comparator output to obtain a 5V level and link the divider output to L293D input.
BTW how long have you been doing DIYs?

hotcheezy (author)2013-07-16

So it appears it's still not working, I wonder if it will still work if I just use the 3volt ni-mh. But I did some testing with the photo transistor and it seem that while pointing it to the lamp in continuity mode it did not beep. So maybe I got the wrong part? It looks like a LED but it is black.

h2osteam (author)hotcheezy2013-07-16

Well when you test the circuit just ignore the n mosfet and the phototransistor, remove them and the solar cell, wire 5V to the positive and negative rail on your breadboard. test the rest of the circuit first. when you shine light on one of the LDR which looks like the first picture with zigzag pattern, get a multimeter and see if the either one of the output on the LM393 changes state. Furthermore check your L293D is working by connecting one of the input to 5V and one to GND, if the motor spins that would be fine. Otherwise either change a new chip or check your wiring.
BTW phototransistor looks just like a clear LED as the second image. They can be wired 2 ways, one way is longer lead to positive which changes resistance according to IR level. The other way as you might have guessed is in reverse, if you have the right part multimeter in continuity mode with red lead on the shorter lead should Beep if you point a IR source like a incandescent lamp or TV remove at it.
Feel free to contact me on my Email if you have more issues:

hotcheezy (author)2013-07-15

Hi again, so I was just wondering what exactly happens after everything is made? Does the motor turn or something? Because I just completed the circuit and nothing seem to be happening. Thanks for your help.

h2osteam (author)hotcheezy2013-07-15

Hello there, congrat for completing the circuit. And yes the circuit is designed so that the motor will turn according to the relative location of the sun. the panel should attempt to face the sun.
I advice you to double check your circuit. making sure the comparator is giving the right signal. if you need more details i can write up a debug procedures for you.

hotcheezy (author)2013-06-10

Hi, i was looking at the schematic i downloaded from above and i noticed a capacitor component labeled C4 and i was wondering if you could tell me what the value if for it. Is it a 0.4u? or something? and also the ground in the schematic is it going to the negative of the solar cell or the battery?

h2osteam (author)hotcheezy2013-06-11

Hi, yeah, C4 should be 100nF or 0.1uF. it is non crucial. And yes you are right the ground is common at both the negative of solar cell and the battery.

LoktarAly (author)2013-05-05

Sir i would like to make this as well pls send the all schematic diagrams of Solar phone charging system featuring sun tracking, Thank u so much!!!

h2osteam (author)LoktarAly2013-05-05


hotcheezy (author)2013-05-05

Hi, Can you post a link to where you bought the phototransistor? Are the phototransistor similar to a normal transistor?

h2osteam (author)hotcheezy2013-05-05

Hi hotcheezy, try this part number for the phototransistor:Phototransistor Receiver L-53P3C. From this ebay link
Phototransistor is turned on by IR light instead of base current for a normal transistor

hotcheezy (author)2013-05-04

how do u control this thing? do u use an Arduino?

About This Instructable




More by h2osteam:Electronic Music Box Powered by Arduino (sort of)Electronic Music BoxClap and let there be light
Add instructable to: