Take Charge of your Scribbler Robot's IR Capabilities continued
by Eric Ostendorff
Page Two
<< Back 1 |
2
Batteries & Charger
Get six new Nickel Metal Hydride AA batteries to power your robot. New cells are rated 2500 mAH or more. Perfectly charging six series NiMH batteries is beyond the scope of this article. We'll make a simple trickle charger to keep the batteries near full. Build the simple circuit shown in Figure 5 (left) on another small pc board. It uses an LM317T as a current regulator to drive a constant 125 mA into the robot, which we will leave "ON" all of the time. The 10-ohm resistor fixes the 125 mA current. Scribbler consumes ~20 mA just idling on the charger; we'll add an LED charge indicator that takes 5 mA, so the remaining 100 mA will charge the batteries, which barely get warm to the touch. That is a very safe rate, it should take 25-30 hours to charge completely discharged 2500 mAH batteries. If you reduce the resistor value, more current will flow, up to the limitations of your AC adapter.
Note: Expect to see Scribbler's original red LED power indicator blinking to indicate "low battery voltage" much of the time. Since we are using six 1.2 volt Ni-MH cells instead of six 1.5 volt alkaline cells, this indicator does not accurately reflect a low battery condition.
Figure 5
Note 1: If you're in a hurry, batteries will charge 20% faster when the robot is switched OFF.
Note 2: If the charger contacts get short-circuited, the LM317T will still limit output current to 125 mA, but it will slowly get hot. Fuse and/or heat-sink the 317 accordingly if you anticipate this possibility. The robot mods shown include a diode to prevent any danger if the robot's charging contacts get short-circuited.
Charging Contacts

Figure 6. The Scribbler shown after installation of charging
contacts.
Use 3/4" copper-clad metal hangar strap from the plumbing department (Lowe's # 85802, Home Depot # 842-238), a 10-foot roll is plenty for 8 robots & chargers. Tell a friend! The strap can be cut with tin snips or even scissors. It is clear coated and needs to be lightly sanded to solder and conduct electricity. Figure 6 shows where to mount two 1-1/2" pieces to the front of the body after soldering a 12" insulated wire to each. Remove six Phillips screws and open Scribbler up to add the modifications shown in the schematic in Figure 7. Drill two small holes in the lower body and route the wires from the external charger contacts inside toward the robot's battery contacts as
indicated in Figure 8.
The negative battery contact is at the right rear, and the positive battery contact is under the left motor. Just lift the motor up a bit while you solder the wire on.

Figure 7.
We'll add an LED "charge indicator" that lights up when the robot has a good connection to the charger. Drill the upper body for a small 3 mm red LED just left of the 3 green LEDs. Follow the pictorial in Figure 8 to add a 100-ohm resistor and rectifier diode. Connections are made internally to the battery terminals. Keep polarity consistent with the charger, and make the positive charging contact on the left (driver's) side of the front of the robot. Bend the outer copper contact so it fits around the body, and fasten it in place with foam double stick tape, or hot-melt glue. Keep outer copper surface shiny, clean and flat for reliable charging. When you're done, use test leads to make a proper-polarity connection to your charger's output and you should see your charge indicator LED glowing as shown in Figure 9.
Figure 8

Figure 10. The Scribbler has docked. It follows a line to
the docking station and stops moving when the wheel
stall sensor is triggered.

Figure 9. The charge light indicator is
glowing, indicating the circuit is operating
correctly.
The charger shown in Figure 10 is an environment optimized for the Scribbler's unique combination of sensors. It is made of wood, posterboard, and steel rod (OK, coathanger). The posterboard provides white inside walls and a thin white floor that the robot easily rolls up on. The IR beacon is mounted overhead on a steel rod above robot height, so the signal is lost once the robot gets underneath it. At that point, the robot uses its onboard IR emitters to see to the white charger walls. Finally, it finds and follows a black line into the charger contacts, and stops when the wheel stall sensor triggers.
The charger is detailed in Figure 11. I used one piece of lumber 1" x 3" x 48". Cut the height of the short 6" piece from 2.5" down to 1.5" so that your "leave charger" IR signal is easily received. Hold your joints together with screws and/or hot melt glue. Use the posterboard glossy side up to make a floor and white inside walls for IR reflection. Scribbler needs to see reflected IR to recognize the charger, and white walls reflect best. Tape, staple or glue the posterboard in place. My diagonal "line" is a 1" strip of flat black posterboard taped onto the white posterboard. This way, I can change it or move it easily. Sharpie or flat black paint may also work, but is obviously permanent and unforgiving.

Figure 11
Figure 12. The Scribbler follows the black line toward
the docking station.
Figure 12 shows Scribbler following the black line towards the charger contacts. Scribbler' line-detecting is hardware-based and finicky. Software calibration would have been nice here, but no such luck.
My robot's sensors were predisposed to darkness, so I carefully used a hobby knife to open up the 4 bottom holes for more IR "flow". Keep the charger away from sunny windows and doors, since sunlight can saturate IR sensors and cause problems. I used the same copper-clad hanger strap for my charger's electrical contacts; two horizontal strips each held by a single short wood screw. Remove the clearcoat so the copper straps conduct properly. Bend them out slightly so they make good, springy contact when the robot is docked. A little experimentation is in order here. Before you hook up the wires, push the robot up against the contacts and use a multimeter to verify the contacts are getting robot battery voltage (~7.8 volts). Adjust as necessary. Verify polarity and connect the charger contacts to your current regulator. When the robot is docked and charging, the LED added to the robot will glow. As Figure 13 shows, I wired in a small analog milliammeter to monitor how much current is flowing. My charger beacon is held up by a simple coathanger-wire support. I drilled into the wooden walls of the charger and pressed the wire into it. The wire and IR LEDs are 4.5" above the surface. The beacon is powered from the AC adapter through wires running along the coathanger; it only draws about 25 mA. The two IR LEDs each are aimed horizontally, each about 20 degrees off center to send a wide signal into the room. Use strong coathanger rod or equivalent to hold your beacon circuit board rigidly to it. You must adjust your LEDs by experimentation, and you want them to stay where you set them. Figure 14 shows an overhead view of the charger, robot, remote, and AC adapter.

Figure 14

Figure 13

Figure 15
Download the PHASE 2 software by
clicking here (zip file). To view Eric's individual videos, follow this article to the end. This is a different program from Phase 1. You can drive the robot around exactly as before, but the Track routine has been replaced by a routine to seek your charger's beacon and dock with the charger. Remote control codes for Phase 2 are shown in Figure 15. Instead of the MUTE button, the POWER button is used to make Scribbler seek AND leave the charger. The docking/undocking procedure goes like this:
- Seek out and follow the IR beacon signal until it can't be seen anymore (beacon overhead, out of view).
- Drive forward until it finds the black stripe and turn right to
follow it.
- Wait for the wheel stall sensor to trigger after hitting the charger contacts, then shut off the motors.
- Wait for ONLY another POWER IR signal received.
- Back up a bit, turn right, and drive out of the charger a bit to get
past the IR beacon signal.
The PHASE 2 software works well for MY robot, MY charger and MY environment. It is also a great starting point for your robot, but you should expect to adjust both your software and hardware (LED height & alignment, black line, charging contacts, battery condition, etc), since there are many variables in how you built your charger and your room environment and lighting. Welcome to the world of robotics and custom programming!
First, change the software to use the COUNT results from the beacon testing you did a few paragraphs ago. Locate the 'trackcharger' routine towards the beginning of the Phase 2 software. Two "IF beacon" statements must be adjusted for your results. Let's say your COUNT values shown were usually 18 with an occasional 19. To be safe, let's accept values from 17 to 20 inclusive. Adjust the IF statements to transfer if the beacon values are outside this range:
IF beacon<17 THEN checkbase' limit pulse count reading low
IF beacon>20 THEN checkbase' limit pulse count reading high
So if the wrong beacon count (or no signal, beacon=0) is received, program execution jumps to the 'checkbase' routine, which checks if the white walls of the charger base are near enough to reflect IR pulses sent out from Scribbler. If so, the robot stops looking for the IR beacon and starts looking for the black line which will lead it towards the charger contacts The program is commented so you can follow the logical intent of the robot step by step. You must obviously test your robot and determine if and how something needs to be adjusted for your particular situation. This very simple robot, charger and docking routine does have limitations that you should be aware of:
- The charger will work best in an unobstructed area with a wide view of the room, as Scribbler needs open area to "see" the charger in a line-of-sight manner.
- When the robot loses the signal, it assumes that anything detected nearby is the charger and it will attempt to dock with it. Again, not a problem if the room is open and the path to the charger is wide open. But if it gets too close to a wall or furniture, Scribbler may get confused and get friendly with your antique armoire.
- White walls, rooms and floors will reflect IR very well and Scribbler may receive bad directional information from phantom beacon signal reflections. You may need to decrease your beacon's signal intensity by increasing the two 82 ohm resistors to 100 ohms or more.
- Scribbler may not receive your IR remote's signal when it is facing the beacon within homing range. It can only detect one signal at at time.Try to avoid driving it directly toward the charger, since you may lose control.
- After Scribbler has docked, it will only recognize another DOCK command to leave the charger (the "Power" button as I programmed it). Scribbler will back up, turn right and drive out a bit to get it away from the beacon signal so you can drive it from there. You can adjust the undock procedure in the Phase2 software if you like.
Scribbler's not perfect, but it's a nifty little robot that's capable of doing some very cool things. Mainly, teaching us! This article is an experiment to get hobbyists building things and tinkering down on the floor. We all learn by trying, failing, succeeding, speculating, and testing. But mostly by having fun. One of you young geniuses out there might just build ten different frequency beacons and master whole-house navigation with a $79 Scribbler. But I'll be happy if a few of you dust off those Scribblers that you have in the closet and play with them for a few hours, and I will count my effort a success. Happy Scribbling!
Links
To download the PHASE 2 software, click here. (zip file)
Video 1,
Video 2
(2 Quicktime videos. Please be patient; they are large files.)
View them on Youtube,
Video 1,
Video 2
Parallax,
www.parallax.com, (888) 512-1024
<< Back 1 |
2