Let's Make Robots!

Sun Chaser

TeleFox's picture
Act cute, try to keep itself charged
AttachmentSize
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.

Naked__Front-Left.jpgNaked__Seperated__Top.jpg
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:

Assembled__Front-Left.jpg

Assembled__Left.jpg

Comment viewing options

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

Looking good - the perfect gift.

The half round effect translucent BiColour-LED Eyes brilliant idea.

What is the EMF sensor though -  and how is it interfaced (is it analoge signal)?

TeleFox's picture

Originally it was just a coiled length of insulated wire attached to one of the digital input pins, but the problem was that due to stray capacitance the sensor would often lock-up and remain on after detecting a signal, especially if a statically charged person poked the little bot. In order words if you pet it or gave it a jab the little guy would just chirp incessantly until you gave him a good shake...
The new 'antenna' just uses a single short (~60mm) length of insulated wire with the end sealed off, connected to the input pin. Also connected to the input pin is a 30MΩ resistor that goes to to ground; this serves the purpose of bleeding off any static charge that the antenna might accumulate. The results is that when the electric field around the bot changes, such as when near a live AC powered device, a statically charged object, a person, etc, the antenna voltage fluctuates. If the effect is strong enough then some of these fluctuations will exceed the high voltage threshold of the input pin and the PIC will register that as a 'hit'. The sensitivity of the antenna can be increased/decreased by increasing/decreasing the length of the antenna.
I made a trial unit by connecting a short length of enamel-coated wire to the input of a 74HC04 inveter, and then connected that inverter output to another inverter input (for double buffering), and then connected an LED to that inverter's output. The result was a little breadboard device that could detect someone moving towards or away from it, or sensing live AC cables inside the walls. It also works very well in detecting my cat, he's quite prone to being highly charged. Later on I also added a little piezo speaker so you could hear the frequency of the signal being detected; AC produces a typical low hum, physical contact makes a popping sound, waving the antenna at the cat produces a distinct crackling sound.

ignoblegnome's picture

What a cool way of making a bot react to its environment. A very cool idea to store away for later.

Perhaps a tip/walkthrough is in order?

TeleFox's picture

Well, I am planning on making a more useful version of this sensor for a future project. I'm thinking of trying out some directionalised antennas so a bot can, for example, seek out live electronics... what it does when it finds them I have no idea =D

Stay posted, maybe I'll fast track this idea after the Mr. Basic project.

Gareth's picture

 Thanks for the info - yes Static is a curious substance (often confused with "Ether")

A while ago i attempted to make a Static detector.

By placing two strips of light silver (swiss chocolate) paper close together ,

they are electrically connected to each other and also to a metal stud you see on the left.

Placed inside a dry glass container - and hey presto a static detector.

When static electricity (ie by charging a ballon or cat (by rubbing it in your hair hehe)) comes close 

to the stud it transfere to the metal strips which oppose each other splaying the strips apart.

All i have to do now is point a IR at one of the silver plate and get some kind of a analoge out of it (ToDo list).

StaticDetector.jpg

TeleFox's picture
A pocket-sized 'gold leaf' style electroscope! Very nice =D
I wonder if the IR signal would be more easily measured if one of the 'leaves' was a rigid plate? One moving part instead of two might reduce fluctuations in the leaf positions.
TotoroYamada's picture
Love it, very alive! :D
Simon Z's picture

Haha,

Nice and fluffy! A friend of mine tried to convince me putting fluffy stuff on my robot, I'm really concidering it now after seeing yours. 

TeleFox's picture
Finally done! Good thing too, I need to pick up the pace on my Mr. Basic project...
Gareth's picture

I very much like the mix of sensors you have in "Sun Chaser" , gives it a lot of soul.

Its always nice to see Bots made in this way - multi-sensored for multi-personality.

What Current does "Sun Chaser" take?  (just wondering if it could be powered by solarcells)