Inline graphics on this page: 66K

The circuits

Under the hood   

Under the hood

Most of it is inside the AT90S2313 microcontroller. The black pipe makes Dizzy's `eye' directional, so he can look for light and dark areas as well as motion - which he sees as rapid small changes in light level. The black paper hood does the same for his modulated IR receiver, allowing him to find his dining area.


Sampling brightness

Below on the left you see the `eye'; a light-dependent resistor (LDR), connected to port B3 of Dizzy's microcontroller. The light level is sampled by first using B3 as an output pin, to discharge the 22 nanofarad capacitor. Then the port becomes an input, and the cap is charged through the LDR. Dizzy measures the time it takes for the pin to pass the logical `1' switching level of the internal schmitt-trigger on B3. The longer it takes, the darker it is. Completing a sample may take anywhere between 1/1000 to 1/10 of a second, depending on brightness, and several samples are needed to detect motion. However, human motion is very rarely fast or slow enough to deceive Dizzy.

Finding dinner

To the right of the LDR you see the TSOP1733 modulated IR receiver, which Dizzy uses to find his dining area (marked by an IR beacon). This device needs 5V. As Dizzy's battery delivers only about 3.5V, he operates a charge pump (the two BAT85 diodes and caps around them) to increase Vcc for the TSOP. To reduce energy consumption, charge is only pumped when looking for the IR beacon, details of which you'll find below.
Dizzy circuit diagram

Fast food

To the right of the charge pump you see first the two feelers (F2, F1), followed by the battery and the two transistors used to switch the charging current on and off. When Dizzy is in contact with his dining area, he begins charging in cycles of 50 seconds of charge followed by 10 seconds of pause. At the end of each cycle, with the current still switched off, he measures the battery voltage. If it's higher than after the previous cycle, he gives the battery another 50 seconds of charge, and so on, until the battery doesn't profit from further charging anymore. Dizzy then disconnects and moves away from the dining area. If the predetermined cycle limit is reached first, something is wrong; Dizzy will then cut the charging current and call for help.
Dizzy's `brain' uses port D1 as input to determine whether contact with the charger is good. If contact is lost during charging, Dizzy will notice right after the next 10 seconds pause. He will then start his motors and re-establish a good charging position, to continue eating until his battery is fully charged.
The same port is also used as output when Dizzy wants to `talk'.

Feeling hungry

In the lower right corner of the diagram, a circuit somewhat similar to the `eye' samples the battery voltage. The 100N cap is discharged - making the BC559 conduct, so port D4 is pulled high - and then allowed to charge until the transistor stops conducting. The time is measured and proportional to the voltage. When Dizzy is running about, talking or just sitting there, appropriate limit values are used to determine whether the battery still contains sufficient charge. If not, he will try to find his dining area. If he doesn't succeed before the voltage drops too far, Dizzy will either lose his mind or stop and ask for help.

Software upload

Below the `eye' and IR receiver, connections between the microcontroller and a PC's parallel port are shown. Dizzy has a modular connector which fits the SP12 programming cable. As the kit contains a programmed AT90S2313, you won't need this for the time being. It is intended for future upgrades, though you might also use it to upload programs you wrote yourself (to a second AT90S2313).

                           Dining area

Dining area circuit diagram

Modulated IR

Dizzy's TSOP1733 IR receiver won't react to just any kind of infrared light. The modulation frequency must be just right, and the wave form has to be within certain limits. A generator built around four cmos NAND gates takes care of that.
As the receiver is very sensitive, the signal must be weak; else Dizzy might not be able to find the original source amidst reflections bouncing of nearby walls and such. Hence the LD271 (IR LED) is fed through a 330 ohms resistor. And to make sure that the little `bot will be able to see the dining area from anywhere in his terrarium, the normally rather directional LED is slightly modified.

Current source

A simple two-transistor current source (left of the 78L05) provides Dizzy with the required constant current flow, and also makes the dining area proof against short circuits. The current is stabilised at about the BC559's Vbe divided by the resistor across it: 115mA. Since the current flows at the rate of 50 seconds per minute, the average is 96mA. Dizzy's circuitry consumes about 6mA, leaving around 90mA for the battery. A full charge of the 140mAh battery would take something like 2 hours. However, Dizzy tends to eat when his tummy is far from empty, which means he'll take a couple of fairly short meals a day. The NiMH battery stands up to this very well; my oldest Dizzy has been running for about ten months continuously, and is still very much `alive'.

previous (voice) / next (parts list)