This book is based on the idea of circuit modules. These modules can be put together in many different ways to build a variety of robots. Modules also have the advantage that their circuit boards are small and so will fit more easily into that small space in the cramped interior of the robot. A modular system can be improved, added to and revised without having to re-build the whole system.

There are several types of connectors suitable for robot circuits. The cheapest are the 0.9 mm or 1 mm terminal pins. These are pushed through the holes in the strips of the circuit board and soldered in place. The end of the connecting wire is bent into a little hook, and soldered to the pin. Soldered connections are very reliable but a trouble to undo if the connections are to be changed.

PCB terminal pins are similar to the basic terminal pins but are longer and usually gold-plated. They are pushed through the holes and soldered like the plain type of pin.

PCB terminal pins connect with push-on sockets. The sockets are supplied in break-off strips.

The matching sockets are broken off the strip, crimped around the bare end of the connecting wire and soldered to it. Contact is good because of the gold plating and the springy socket.

The designs for several of the controller boards make use of this kind of connector. This lets the connections between the controller and its peripherals be changed as required during the development of the robot's electronic system.

Header plugs and sockets are a good way of connecting modules that have two or more connections. The plug is soldered to the board and the socket crimped and soldered to the connecting wire.

A 6-way header socket shell (top) holds the individual sockets (left) and pushes on to the header plug (right), which is soldered to the board.

The plugs are available in 2-, 4-, 6-, and 8-way versions. The plugs and sockets have polarising ridges so it is not possible to connect them the wrong way round. This makes it important to wire them the right way round as the individual sockets are very hard to extract from the shell once they have been inserted.

PCB screw terminals are another way of making firm connections that are easily changed. We find them useful for the power supply lines as it is possible to insert two or more wires in the same terminal, and daisy-chain the power lines from board to board.


Power supplies 4wwwwwwvwvwwwwvwwwwwww^

The various types of power supply — batteries and PSUs — are discussed on p. 57. Here we work out what voltage the supply should have and go into more detail about how to provide it.

The first stage in planning the supply is to list the devices and circuits in the system and what they will need. All systems will include one or more PICs so start with this. The most recent PICs operate at any voltage between 2 V and 5.5 V. This wide range gives a degree of flexibility except that it does not include 6 V, which could be conveniently provided by four alkaline cells. The nearest is four NiMH (or NiCd) at 4.8 V. In practice, though rated at 1.2 V per cell they give 1.3 V when fully charged.

The system will almost certainly include one or more motors. Usually the motor is chosen for its dimensions and its running speed (and perhaps its price). Provided its operating voltage is not more than 12 V, we either run it at this voltage or on a lower voltage on which it will run fast enough.

Other devices in the system may have special requirements. For example, CMOS logic circuits of the 4000 series require between 3 V and 15 V, which is easily met, but the 74HC series need between 2 V and 6 V. They can not be run on the same supply as a 12 V motor. Some of the solid state buzzers and bleepers have a wide range of operating voltages but others have not, so check this point before you buy.

If everything can run at the same voltage it makes the circuit design much simpler. This is why it is preferable to use low-voltage (3 V or 6 V) motors that can run on the same supply as the PIC. Sometimes a 12 V motor, solenoid or relay is the only suitable type and we have to set up two supplies.

The power supply circuit, single or double, should also include an on-off switch and preferably an indicator LED to light when it is switched on. Some circuits for this are shown overleaf.

If the drive motors have their own supply it is a good idea to give them a separate switch. It is then possible to run the PIC and test it without the robot shooting all over the place.

Circuit for the supply of a single-voltage system. The source is a battery of four NiMH cells. S1 is a panel-mounting toggle switch. D1 is a standard brightness LED. The resistor limits the current through the LED to about 20 mA.

R1 470R

To motor control board


-OTo PIC etc

Circuit for the supply of a dual-voltage system (the Gantry, p. 297). There is a switch for each supply, but the 0 V rail is common to both supplies. Note the differing resistances of R1 and R2.

Calculating the resistance

There is a forward voltage drop of roughly 2 V across a conducting LED. The drop across the resistor is (Vsupply - 2). If the current through the LED is to be i amps, the resistance must be (Vsupply - 2)/i.

Example: If Vsupply is 4.8 V and the current is 0.02 A, the resistance R is:

R = (4.8 - 2)/0.02 = 2.8/0.02 = 140 Q Use the nearest value, 150 Q.

The controller circuit



Because the electronic system of the robots is modular, the controller board has little on it except for the PIC. The drawing shows the essentials.


S2 ' Reset

RA4 0

IC1 PIC16F690




With its 20-pin package the 690 provides up to 18 I/O pins.

The switch S1 is the power supply switch seen in the drawing opposite. The polyester capacitor C1 is to absorb voltage spikes on the positive supply line.

When power is first switched on, channels RA0 to RA2, RA4, RB4, RB5, RC0 to RC3, RC6 and RC7 are all analogue inputs. The rest are digital inputs. The analogue channels can be defined individually as digital and all channels except RA3 can be defined as outputs. Outputs are always digital.

When they are configured as inputs, the channels of Ports A and B (except for RA3) can all have weak pull-ups. These can be brought into action individually. The weak pull-up acts like a high-value resistor between the input pin and the supply line. The input is read as a logic high, unless it is strongly grounded to the 0 V rail.

Channel RA3 is an exception. It can be configured as a digital input with no weak pull-up. The circuit for this is shown in dashed lines. It requires an external resistor. If the channel is configured as MLCR, to reset the controller, it automatically has a weak pull-up and does not need the external resistor.

0 0

Post a comment