Let's Make Robots!

Sun Chaser

Act cute, try to keep itself charged
SunChaser.asm14.54 KB

Not much to say about it at this point; this little guy is basically going to be a living ornament.
He's looking pretty ugly at the moment but once I've finalised the power systems I plan on building a wire frame to cover everything above the legs, and then I'll wrap the frame in fuzzy black fabric. The obscure glass tube dangling around on the right of the main photo is going to be the 'beak', which lights up when the bot chirps using the piezo speaker. The two pairs of LEDs flopping around on the front will be epoxied to two flat glass disks to act as eyes, which light up green or red depending on remaining power and other status conditions.

The main behaviour routine is basically as follows:
• Wake up - when power is restored he chirps a little 'waking' tune and flashes his eyes green.
• He checks to see if the light is stronger in front or behind him using the front/back LDR couple; if behind he spins around until the light source is in front.
• Once the light source is in front, he attempts to lock onto the light by turning CW or CCW based on the readings from the front-left/front-right LDR couple.
To reduce the amount of flailing around there's a certain laziness factor which causes the bot to fire the motors less often if he's repeatedly changing direction, which happens when he's pointing almost directly at the strongest light source.
Bot is now set to ultra-lazy in order to save on power.
• Every now and again, using erratic readings from the EMF sensor as a 'seed', he'll emit little chirping noises.

Other behaviours are:
• Once aiming approximately at the strongest light source, the bot checks to see if the light level is above a preset intensity - if it is not then the bot makes an "I'm going to sleep" chirp and shuts off all peripherals to save power. The bot will wake up again should the light level increase or if the lighting conditions change so that the light is stronger behind him.
• The bot continuously checks a mercury tilt sensor that trips when he is tilted more than 90° in any direction from the vertical axis. If he falls over, he makes a sad little chirp and then basically goes to sleep until he's put the right way up again. This stops him wasting power and potentially getting himself into an even worse situation by thrashing around.
• As well as controlling the eye LEDs, the internal voltage sensors check to see if the supply voltage exceeds preset values: currently one is set to 3.0V and the other is set to 3.7V. If the supply falls below 3.7V, the bot will become more lethargic in its activity, and if the supply falls below 3.0V the bot puts himself into low power mode by disabling the motors and shutting off some of the LEDs.

Here you can see the two PCBs seperated.
The lower board (top of frame) contains the EDL supercapacitors, a ULN2803A and 2 BC327 PNP BJTs. The supercaps provide backup power to cover for short periods when available sunlight is obstructed. The ULN2803A is an 8 channel 500mA Darlington Pair array, which I use to control the LEDs. 2 of the Darlington Pairs are used as the low-side transistors in an H-bridge that drive the motor, while the BC327s act as the high-side of the bridge. There's also a pair of normal caps for motor smoothing.
The upper board (bottom of frame) contains the PIC16LF628A μcontroller, the piezo disc, the mercury tilt sensor, the EMF antenna, 2 pairs of LDRs (one front/back, the other front-left/front-right), the low light LDR sensor, the voltage reference sensors (those two small red LEDs are actually part of the voltage reference), and finally a 74HC04 non-Schmitt inverter IC. The 628A handles all the control, but as a smaller baseline μc it doesn't have a 'true' ADC module, so I use the 74HC04 to clean up the signals from the LDR sensors and the voltage references. If I connected the sensors directly to the 628A inputs then there would be no clean transition at the trigger point thanks to 'forbidden zone' hysteresis between Vih and Vil (high and low input trigger levels). The 74HC04 changes output state at almost exactly Vsupply/2, which makes it very useful for testing changes in the light balance of the LDRs, and for getting a yes/no reading from the analog voltage references.

I'm making this bot for one of my sisters as part of a birthday present, so looking/acting cute and not requiring much maintenance are essential. Fortunately he's programmed using ICSP (In Circuit Serial Programming), so I can modify the software very quickly by plugging him into my PICKit2 USB programmer.

Edit 20/8/09: Fixed up the supply voltage sensors, both are working now. As usual I've tweaked the code again slightly, I'm uploading a code of the latest version.

Edit 4/9/09: Hmm, lots of other things getting in the way recently, most noticeably a large computer vision programming project. Back in the game now though, code has been significantly updated again. Solar Panel arrays are all fabricated, so I'm looking to start on the final assembly.

Edit 20/9/09: Finally got this little guy finished! Quite pleased with how the whole thing turned out. I've added a video of him in action, and I'll add a few more photos below:



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

When the motor's not running the current consumption is ~50mA, jumping up to ~100mA when the motor activates. If the motor is thrashing back and forth the extra inertial loading causes consumption to reach ~140mA, which is not so great.
My current solar array is generating 4V @ 65mA in moderate late-afternoon sunlight, so I really need to squeeze some more efficiency out of the switched mode power converter to ensure he can get a solid charge built up during the middle of the day.

I'm still trying to decide whether I want to leave him with just solar + supercaps, or make the 3xNiMH cell pack a permanent addition (currently it's just there for testing). The NiMH cells are rated @ 2600mAh, so I'd estimate about 1.5 days power from a full charge and no sunlight.

Thanks for the info - your hybrid idea sounds very fitting and a good solution.

I have a number of solarbot ideas which also have to overcome the "Current" supply - so i will be glued to your further developments.

Having it solar-charge its self will also give it a bit more "Self Awareness/Presence" (my solarbots switch on and off at all sorts of weird times - its like having a friend around).

Now that he's completed, the maximum current consumption is only ~80mA (bot turning, LEDs and piezo on). While happily locked onto the light source the current requirement is <10mA, which is easily overcome even in overcast conditions.

I've tested the solar array in good mid-afternoon indoor conditions, and the maximum output is around 6.4V @ 90mA, but understandably this is highly variable.

Cool! :D Looks like some kind of extraterrestrial plant :) Hope to see it "living" soon! What supply voltage sensors did you use?

I made some gimp homebrew sensors for checking the supply voltage =D
It turns out that common LEDs have quite a smooth voltage/current profile, so I connected various types that I had lying around to a 4.5V supply via a 500kΩ trimpot and measured the voltage drop across the LED as the resistance was changed. I found that there was very little deviation in the voltage drop provided the resistance was at least a few 100kΩ.
Since I'd already installed the 74HC04 for the LDR sensors, I had a few inverter slots free (3 of 6), so I used these as sensor filters. The final setup for the 3.7V reference was:


The LED provided a forward voltage drop of ~1.5V and the diode had a drop of ~0.35. The 74HC04 has a threshold point of Vcc/2, so the output behaviour is:
IF [V+ Supply] - [1.5V+0.35V] > [V+ Supply]/2 THEN OUTPUT=0 ELSE OUTPUT=1
which can be rewritten more conveniently as:
IF [V+ Supply] > [3.7V] THEN OUTPUT=0 ELSE OUTPUT=1

The 3.0V reference was built in the same way, but with the ~0.35V diode omitted.

Cute and creative.

The description of its behaviour is good and detailed; adding more insight into something that doesnt look very fancy on judging from the picture. I have no experience with the processor you're using so its fun and interesting seeing something new. 

I'm looking forward to more updates and video showing this little creature.