The dimensions of the mini-sumo class in the Robot Challenge rules are very tight and place space at a very high premium. To save space, I like to try to keep my breadboard design within the limits of one mini breadboard. One handy way to save space is to package each colour sensor (e.g. OPB704 or similar) as a modularised 3-wire device. Two wires (black and red) are used to supply 0V and 5V to the sensor and the third wire (blue) is used to connect the output voltage directly to an analog input on the microcontroller.
I spent some time thinking about how the revised colour sensor circuit (described in my recent post, “Understanding infrared reflective colour sensors”) could be conveniently packaged in a simple 3-wire module and I came up with the following design:
Note that the brown wire in the photos above should really be red. In the description below, it is referred to as the “short red wire”.
The steps I used to assemble the device were:
1. Gather the parts
- Long wires: red, black, blue (8mm stripped at one end)
- Short wire: red (6mm stripped at both ends)
- Resistors: 220Ω, 100kΩ
- Colour sensor: OPB704
- Equipment: Snips, pliers, soldering iron, solder, magic hands (if available)
2. Trim the legs of the OPB704 to approximately 6mm. Apply a thin coating of solder to all four legs.
3. Prepare the blue wire and 100kΩ resistor
Twist together (neatly) the stripped end of the blue wire and one leg of the 100kΩ resistor. Rather than forming a continuous line with each other, the blue wire and 100kΩ resistor should form a “V” (see photo above). Apply a thin coating of solder to the twisted joint. Trim the exposed metal section at the joint to approximately 6mm in length.
INSERT PICTURE OF BLUE WIRE AND 100K RESISTOR CONNECTED
4. Prepare the long and short red wires
Twist together the stripped end of the long red wire and one end of the short red wire (they should meet in a “V” shape (see photo above). Apply a thin coating of solder to the twisted joint and, if necessary, trim to approximately 6mm length. Also apply a thin coating of solder to the other end of the short red wire.
INSERT PICTURE OF RED WIRES CONNECTED
5. Prepare the black wire
Apply a thin coating of solder to the stripped end of the black wire.
6. Prepare the 220Ω resistor
Apply a thin coating of solder to one leg of the 220Ω resistor and trim to approximately 6mm in length.
7. Attach 220Ω resistor to colour sensor
Attach the short solder-coated leg of the 220Ω resistor to the cathode of the LED, as shown.
INSERT PICTURE OF 220 OHM RESISTOR ATTACHED TO COLOUR SENSOR
8. Attach 100kΩ resistor to colour sensor
Attach the solder-coated joint of the 100kΩ resistor and blue wire to the emitter of the phototransistor, as shown.
INSERT PICTURE OF 100KOHM RESISTOR ATTACHED TO COLOUR SENSOR
9. Join the resistors
Twist the free legs of the two resistors together and apply a thin coating of solder, as shown below.
INSERT PICTURE OF RESISTOR LEGS JOINED TOGETHER
10. Attach black wire
Attach the solder-coated end of the black wire to the twisted resistor legs, as shown below.
INSERT PICTURE OF BLACK WIRE ATTACHED TO RESISTORS
11. Attach red wire to anode of LED
Attach the joint of the long and short red wires to the anode of the LED as shown below.
INSERT PICTURE OF RED WIRES ATTACHED TO LED
12. Attach short red wire to collector of phototransistor
Attach the free end of the short red wire to the collector of the phototransistor as shown below.
INSERT PICTURE OF RED WIRE ATTACHED TO COLLECTOR
13. Tidy up
All that remains is to tidy up the long wires. I like to twist them together tightly every few centimetres to make one neat cable. The wires can then be trimmed to the desired length and a pin header can be attached to the free end to make a sturdy connection to the breadboard. I like to put a 2-pin connector on the red and black wires so that they can be plugged directly into the breadboard’s power rails.