19 August 07
My first ’bot
The guts of my first robot are coming along nicely.
I’m working from David Cook’s excellent book Robot Building for Beginners; it’s an easy read, and every topic — from circuit architecture to transistor internals — is crystal clear.
That’s what I’ve built today. A basic line-following circuit, with some schnazzy LED indicators. That photo is a link to a much larger version.
Obviously, this ’bot is still missing some things: motors, wheels, a chasis, and a cute name. That’s for future weekends.
I had the darndest time finding photo resistors. Neither Fry’s nor my local Radio Shack had them, but the manager at Radio Shack suggested I check out Al Lasher's Electronics. If you live in the Bay Area, come check this place out, it is amazing. The staff was helping folks debug circuits, and the store was a rambling maze of components and manuals. Geek paradise.
The Meat of it
Here’s a schematic of the circuit in that photo (and note: I didn’t design this - this is from David Cook’s excellent book).
The parts follow, from mundane to interesting.
- R1: 470Ω – a current limiting resistor for the headlights
- R2: 4.7kΩ – current limiting for the photo cell circuit
- R3: 10kΩ variable – for tuning the sensitivity of the two sets of photo cells
- R4 & R5 – right-side photo cells; yes, right — when the ’bot is finished, the headlights and photo cells will face the ground, so I find it easiest to imagine that the whole circuit is upside down
- R6 & R7 – left-side photo cells (the photo cells, in conjunction with the headlights, are what the robot uses to follow the line
- R8 & R9: 1.5kΩ – current limiting for the transistors that power the LED indicators
- R10 & R11: 220Ω – current limiting for the LED indicators
- D1 & D2: white – the headlights
- D3 - D5: yellow – the three yellow LEDs light up when the right side (left in the schematic and photo) photo cells have more light
- D6 - D8: green – same as D3 - D5, but for the left side (right in the schematic and photo)
Why 3 LEDs per side? As far as I can tell, because you can’t power three in series from a single 9V battery without a little help, and this way Cook could include transistors in the circuit. :)
Q1 & Q2 are PN2907 general purpose PNP amplifiers for powering the LED indicators.
The robot’s thinking is simple. The lone IC is an NTE943M low power, low offset, dual voltage comparator. It identifies which set of photo resistors is running at a higher voltage (a function of increased resistance, meaning which set is receiving less light), and lights the set of LEDs corresponding with the other set — the set receiving more light.
Coming soon, motors! And a body! Maybe painted like a cute ladybug!