Subscribe To Robotics | IntroDuction | History | Home

Friends Dont Forget To check the archieve at the left end of the page

Make Your Own Robot Tutoials

Simple Beetle Bot | Wired Robot | Combat Robot | Solar Engine |

Beam Symet | Photopopper | Beam Trimet | Line Follower |

Latest Updates
Driver Less Car | I-Sobot | MotherBoard | MicroController | Artificial Brain |

Camera Sensors Hardware | Remote Control Working


Thursday, November 22, 2007

Building a FRED Photopopper

Fred is my first 'photopopper' style bot. I had designed and built a similar bot before, but that one had three motors arranged radialy around a central axis. It didn't work nearly as well as Fred does.

The secret to Fred's success is the modified FLED solar engine circuit. I tried a FLED circuit, but the low-light performance was abysmal. I needed to put my 60W reading lamp 10 cm away from the solar panel before it would fire! This was clearly inadequate, so something had to be done. I tried putting in extra diodes, extra capacitors, extra resistors, and eventually settled on the design shown here.

Now Fred will pop away quite happily 40 cm from my desk lamp, which is the height that it normally sits when I'm reading. He will also pop all day when indoors, so long as a window is nearby to let in some diffuse daylight.


Switch-on: 2.4 Volts
Switch-off: 1.4, or 0.7 Volts, depending on what mood Fred is in.

43 (length) x 27 (height) x 38 (width) mm.

Solar Cells:
One 33 x 24 mm Panasonic 5 Cell amorphous array (Part # BP-243318).
Storage Capacitors:
One NEC 0.033 Farad capacitor, with a 47uF cap in parallel to lower the internal resistance at switch-on.

Two namiki pager motors, with extra padding on the shaft, directly resting on the ground.

Electronic components:
2 x BC337 NPN transistors
2 x BC327-25 PNP transistors
2 x Red Flashing LED (FLED)
2 x 3.3 K resistors
2 x 33 K resistors
2 x 4.7 uF capacitors

Fred is quite an active bot compared to my other mobile bots. At 11:00 in the morning sun, he takes two seconds to recharge after a big step, and one second to recover from a small step. Sometimes he takes big steps, sometimes he takes small steps. When he takes a big step, the capacitor discharges all the way to around 0.8 Volts, but when taking a small step the cap discharges to only 1.5 or so volts.
This results in interesting behavior. It seems that he takes small steps when directly facing the sun, and big steps when facing at 90 degrees or more. If Fred starts out facing into the sun then he will take lots of quick, little steps of maybe 45 degrees and follow the sun around the sky.
But if you start with the bot facing away from the sun, or at 90 degrees, then he will take giant 180 degree strides, alternating sometimes with little steps to aim more towards the center of the light pool.

Construction and development:

I originally breadboarded a single FLED solar engine, and tested the circuit using this setup. This resulted in the poor performance that many FLED SE builders have experienced and cursed. I'm the sort of person who doesn't give up very easily (My friends just call me stubborn!) so I toyed with the circuit until it reached the stage it is now.

I started by experimenting with the 3.3k resistor. I found that the reason that many FLED SE's lock up in lower light levels is that the FLED is being kept high by this resistor. Current is going through the motor, through this resistor, feeding the FLED, but every time the FLED fires, it discharges a little bit from the storage cap. If the light level isn't sufficient to replace the charge lost each time the FLED fires, then you reach an equilibrium point where the SE appears to 'lock up'. I tried adding a diode in series with this resistor, but that didn't solve any problems - in fact it created some more! The SE would lock up at 0.6 volts instead of the more usual 2.2 V!

By this stage I was thinking about making the popper phototropic as well. I added a phototransistor to the anode of each FLED. This raised the switch-on level, but made the bot nicely follow the light.

I then thought about putting a capacitor in series with the FLED. My reasoning being that since the FLED only has to trigger the two transistors, not actually hold the base down, then you only need a little spike, not a long on-time. This proved to be the key to good performance. Of course, I also needed another resistor to discharge the 4.7 uF cap in between FLED flashes. I found that the best place to put this was on the motor terminal, instead of the base of the PNP transistor. The reason for this is that the motor terminal swings a lot more than the base of the PNP (2.2 V as opposed to 0.7 V), so it helped to 'latch' the circuit more easily.

My problem now was that the damn phototransistors were affecting the switch-on level too much. I wanted the bot to have a lower switch-on level in low light (because the solar panel won't produce as much voltage) but when I wired the PTs in that configuration, the switch on level would shoot up to 2.9 volts! This was way too high for me, so I decided that since no-one was looking, I would dispense with the PTs altogether and see how much the FLEDs were affected by changes in ambient light. To my delight, Fred saw the light and turned towards it! The changes in ambient light were enough to change the characteristics of the FLEDs, and make Fred choose the brighter side over the duller side when ready to fire a motor.


If you have a look at the schematic for Fred, you will notice that there is no way to 'tune' the circuit if one side of your photopopper is more likely to turn on than the other in equal light.
Bad luck.

The way I tuned Fred is that I selected two FLEDs that were as equal as I could find, in the selection that I had. The FLEDs are the most critical part of tuning. Get them right, and the rest just takes care of itself. So how do you choose two FLEDs that are about equal? Simple.
All you need is a solar panel (or a power supply with a 2.2k resistor in series), and a reasonably large storage capacitor. Put the solar panel, the cap, and two FLEDs in parallel, + to +, - to -. Short out the cap, and wait for it to charge up. The FLEDs should come on at around the same time, and should flash with equal brightness as the storage cap charges up. Go through your selection of FLEDs to find two that are as similar as you can find.

A better way to do it is with a multimeter. Put the meter on resistance measurement, put the FLED in a dark environment, and measure the resistance. Do this for all your FLEDs. I was amazed at how much variation there is in a batch of the same FLEDs: I had measurements from 0.5 MegaOhms to 8 MegaOhms. FLEDs within 95% of each other should work fine. Putting a 0.5M and a 8M FLED into the one popper will give a very lopsided outlook on life.

Measure the resistance twice to see how much your test setup has changed between measurements. This will give you an idea of how sensitive these components are.
Of course be careful not to let your fingers touch both leads at once! This will distort your measurement a lot.

Here you can see all the parts that you need to get going:

Here's a parts list to get you started: (from left to right, back row first)

1 x 3300 uF capacitor - DigiKey
2 x fuse clips - Hardware store
2 x 0.22 uF tantalum capacitors - DigiKey
2 x BC327-25 PNP transistors (2N3906 can be substituted) - DigiKey
2 x BC337 NPN transistors (2N3904 can be used instead) - DigiKey
2 x pager or similar motors- Solarbotics, MPJA, Big Micro
2 x 33k resistor (orange orange orange, or orange orange black red) - DigiKey
2 x 3.3k resistor (orange orange red, or orange orange black brown) - DigiKey
2 x red FLED (Flashing LED) - DigiKey
1 piece of 3mm heatshrink - DigiKey
1 paper clip
1 solar panel (at least 2.4 volts) - Solarbotics, Adaptobotics

The storage capacitor here is 3300 uF. You can try any value up to 0.047 F, but 2200 - 3300 uF will work the best.

? And here's a schematic to refer to later on:

To start with, you should breadboard the entire circuit.

If you don't have a solar panel, then you can replace it with a battery (more than 3 volts) and a 2.2 k resistor in series with the battery. Hooking a battery up directly will probably damage your transistors, so remember to use at least a 470 Ohm resistor when using batteries.

To find two matched FLEDs, you will need a multimeter. Put the meter on resistance measurement, put the FLED in a dark environment, and measure the resistance. Do this for all your FLEDs. I was amazed at how much variation there is in a batch of the same FLEDs: I had measurements from 0.5 MegaOhms to 8 MegaOhms. FLEDs within 95% of each other should work fine. Putting a 0.5M and a 8M FLED into the one popper will give a very lopsided outlook on life.
Measure the resistance twice to see how much your test setup has changed between measurements. This will give you an idea of how sensitive these components are.
Of course be careful not to let your fingers touch both leads at once! This will distort your measurement a lot. If you absolutely can't find two FLEDs that are similar, then you will need to use the schematic at the bottom of this page to balance your FRED and stop him going in circles.


Put some light on the solar panel, and watch the motors. If one of them fires then well done! The most common mistake here is to not let the motor leads make good contact with the holes. This will result in a cap voltage that will sit at about 0.7 volts. Put some extra solder on the motor leads or solder them to some normal hookup wire to sove this problem.

You should be able to make a particular motor fire by covering that FLED with your finger. This will put that side into darkness, so that side should fire. If you can make both sides fire like this then congratulations! Go on the construction.

If only one side fires, then take the FLED out for that side. Then debug the side that isn't firing. If your other side now fires then your FLEDs are mismatched and you either need to find some better matched FLEDs or use the schematic at the bottom of this tutorial.


Lets start with some mechanics. While your soldering iron is heating up, grab a pair of pliers and the paperclip.

You need to cut both the inside and the outside loops of the paperclip at the point where the inner loop bends. This will give you aroundd rectangle, the size of which is dictated by the size of your paperclip.

By the time you've gotten that puzzled out your soldering iron should be well and truly hot. Tin (put solder on) the top of both fuse clips and the outer bends of the paper clip. Make sure that you heat all metal pieces up till they are very hot - and don't have the motors in the fuse clips when you do this! Attach the fuse clips to a fuse or something that doesn't mind heat. The solder should flow on easily, and shouldn't be able to be picked off later with a file.

Don't leave the motors in the fuse clips for the next step. Use a couple of old fuses or pencils or something, but don't use motors. You now need to put the paper clip on top of the solder blobs, and attach both fuse clips to the paperclip. This is harder than it sounds. Remember to orient the fuse clips at 45 degrees to the paperclip (so they are at 90 degrees to each other) and get the little tab on the fuse clip around the right way so that your motors will actually fit in the way they are intended (pointing away from each other, not towards each other).

This is what it should look like when you're done:

(Note the amount of solder I used. This isn't due to mechanical ineptitude... at least that's my excuse and I'm sticking to it!)

Now wait until it's all cooled down and stick your motors in. Check that the angles are vaguely symmetrical. If not, start again :-)

Now attach the negative lead of the capacitor to the center of the top rail of the paperclip. The paperclip should be on the opposite side of the motors to the capacitor. Bend the capacitor lead around the paperclip, and belt it with some heat and solder. Make sure that the positive lead doesn't touch the bottom rail of the paperclip. You are going to stick the solar panel on top of the cap and motors, so make sure that they create a flat surface to anchor the solar panel to.

Now it's time to start on the hard part: the electronics.

Firstly note the differences between BCxx type and 2N39xx type. This tutorial is aimed at using BC style transistors. If you're using 2N39xx transistors then the pinouts are different, so you'll have to be very aware of how your transistors should go in.

Put the BC327's into the body of the FRED, next to the capacitor, and connect up the emitters:

Now put the BC337's into the FRED, connecting up their emitters as well:

If you are using 2N39xx transistors, then these diagrams are incorrect. Flip these diagrams horizontally, and they will be right.

*** Important ***

Check, check and recheck all the transistor connections. Go back to the transistor pinout diagram and the schematic, and make sure that all the right pins are connected to the right places. It's easier to do it now than later, trust me.

If you don't do it now, you will be doing it later.

Now connect the base of the BC337 to the collector of the BC327: Note: Thanks to the eagle-eyed Joel Hirtle for picking up the mistake that was in the last sentence!

You will now need to put the 3.3k resistors in, connected between the collector of the BC337, and the base of the BC327:

Here's what it will actually look like from above:

Now lay the 33k resistors to the side of the 3.3k resistors and connect one end of the 33k to the back end of the 3.3k:

Now connect your 0.22 µF capacitor between the forward ends of both the resistors:

You now need to attach your FLEDs to the robot. Bend the FLEDs in the angle shown here: (the negative side of the FLED is at the top of this picture)

The negative lead of the FLED should now be attached to the blob of solder on the top of the robot that conects the negative lead of the capacitor to the paperclip.

The positive lead of the FLED is attached to the 33k resistor and 0.22 µF capacitor:

All that remains now is to attach the motor leads and the solar panel. To check the motor lead polarity, grab a 1.5 V battery, and connect it up to a motor. Figure out which way around gives you a forward kick. Do this for the other side as well. (one batch of pager motors went different ways - the only way to know is to do this check). Now, attach the lead of the motor that you had attached to the positive terminal of the AA to the positive lead on the capacitor. Attach the other lead of the motor to the back end of the 3.3k resistor on the side that the motor lives on.

This shot isn't that clear, but you should be able to see the orange leads from the motors here. The black leads seem to be lost in the ether... Now for the final connections: the solar panel. Connect the positive lead of the solar panel to the positive lead on the capacitor, and the negative lead to the paperclip:

Now for the acid test: Hold your creation up to a light globe or the sun. If the motors fire, then well done! If not, then check all your connections again. This circuit is a bit chaotic in nature - if the 'dark' motor doesn't fire the first time around then it might fire the second time around. Don't give up hope the first time the 'wrong' motor fires. Remember: your circuit worked on the breadboard, so it should work when freeformed. You did breadboard it, didn't you?

If you are having trouble getting your FRED engine to fire well, put a 1 uF cap across the motor terminals. This is a bit counterintuitive but for some reason this makes the motors turn on harder. Thanks to Kyle Simmons for this tip!

For the more adventurous, here's the schemtic of the complete FRED popper, complete with touch sensors, and a balance pot to make sure that your little FRED goes in a straight line. The bits in red are there to balance out any differences in the FLEDs, and the blue parts are there so that you can add tactile sensors to your creation. Good luck!

No comments: