Mousey the Junkbot FAQ

By Gareth Branwyn

Here is the collected questions and answers I’ve processed, via email and online discussion, for the past several years related to Mousey the Junkbot, the light-seeking robot made from a computer mouse I featured in my book, Absolute Beginner’s Guide to Building Robots, and in the Mousey project in MAKE Vol. 2. If you have additional questions, feel free to ask them in the “Projects” topic of the Building Robots board in Shop Talk, our conferencing area.

Image of Make:Philly Mousebot Contest Entries, Courtesy Jef Wilkins.

Q: Are there other resources related to Mousey, besides this website? A: You betcha. Since the publication of my book, Absolute Beginner’s Guide to Building Robots, Mousey has taken off (so to speak). He seems to have his own career now. I wouldn’t be surprised if he didn’t soon have his own agent. As I write this, the original Mousey just showed up at my front door. He was coming back from a “showing” at a Chicago art museum, representing MAKE (in an exhibit about the history of DIY). Here are some of the other places you can find Mousey materials:

* He was in MAKE Vol. 2. He even made the cover! MAKE made the Mousey project article into a free PDF download. You can get it here. It’s everything you need to build our favorite mousebot. (Altho it does contain a slight error in the circuit design – keep reading for the fix.)

* After the MAKE issue came out, a builder, named Jake, put up a series of building tips called Mousebot Revisted. If you’re building Mousey, you should definitely check this out before starting your build.

* Mousey has quite the fanbase on Flickr. Various groups, such as Make:Philly, and individuals. have built their own mousebots and photo-documented their efforts. Search on “mousebot” and “mousey” in the MAKE pool to scoop up the Lion’s share of them.

Phillip Torrone’s Mouseys in the MAKE Flickr Pool.

* Make:Philly is an organization, inspired by MAKE magazine, that holds regular gatherings where members get together to build stuff. One of their meet-ups included a Mousey-building contest. One of the organizers, Josh Kopel, created a PDF page of hints, tips, and a re-done, corrected circuit digram. He also shows you how you can add a second bump switch, either a second whisker on the front, or a bumper in the back. Here’s a link to the PDF.

* Mousey the Junkbot: As seen on TV! On March 6th, Mark Frauenfelder, editor-in-chief of MAKE, and the illustrator for my book, was on The Colbert Report. He brought several projects from the magazine with him. One of them was a Mousey. Everything was going just swell, until Stephen Colbert drove Mousey off of the desk, where it broke into many pieces. Much hilarity ensued. After Mousey plummeted to his doom, Colbert quipped: “You built, not a robotic mouse, but a robotic lemming,” and looking offstage to his producer, sheepishly, he asked: “Is that in our budget? Can we replace robots?” The whole segment was really fun. You can see it and some follow-up blog discussion on MAKE’s blog.

Mousey the Junkbot on The Colbert Report, with Stephen Colbert and Make’s Mark Frauenfelder

Mousey started off life with a different name, Herbie. The original LM386-based circuit upon which Mousey was based was designed by Randy Sargent, then a student at MIT. It was originally designed as a line-follower (the two light sensors designed to keep themselves on either side of a black line on the floor – and therefore the bot following the line). Soon, builders modded this original design to follow light instead. Dave Hrynkiw of Solarbotics used a light-following Herbie in his book Junkbots, Bugbots and Bots on Wheels. Then, I created the Mousey the Junkbot version, encasing the Herbie circuit in a mouse case, and created the eyestalk light sensors. Now Solarbotics has further evolved the Herbie/Mousey robot family with Herbie the Mousebot, a wonderful kit that ingeniously uses three electrically=connected PCBs to create a mouse body, of the bio-rodentia variety. It has two whisker sets on the front and an optional clear LED on the back so you can get one Herbie to chase another. It’s a really fun kit to make. Here’s my review of it.

A gorgeous example of a Herbie robot, using Sargent’s original circuit, built here by Grant McKee. In an illustration in Make Vol. 2, this was identified as the original Herbie. It isn’t. I’ve never seen a photo of Herbie 1.0

BTW: While we’re looking into Mousey’s family tree, check out this rarity. It’s an image of a precursor to the Solarbotics’s Herbie the Mousebot kit.

And if you don’t think mousebots are supposed to be lively, check out this video of the kit beta in action.

Q: Are there any significant mistakes in the instructions given in your book or the MAKE article that I should know about before I get started? A: Yes, a couple . A builder, Gareth Adams, found a mistake in the subcircuit for adding sensitivty to Mousey’s light sensors. Wilf Ritger, creator of this circuit hack, pointed out on the Yahoo! BEAM group that the circuit as I have it in my book, and as it appeared in Dave’s Junkbots book (which is where I got it) is incorrect. The same mistake appears in the MAKE Vol. 2 version of the project. The current circuit diagram shows the correct wiring. PLEASE NOTE: This means that the breadboarding illos and photos in the book and on the site are also incorrect. Please refer to the circuit diagram when breadboarding. If you’ve already built Mousey with the incorrect connections, it shouldn’t be a big deal to reconnect them as shown. Thanks to Gareth (not me, the other one) for finding this bug. ALSO: In the book version of the circuit diagram, the orientation of the IR eye sensors got switched around in the illustration. If you just follow the diagram above, you should be okay. As far as I know, there are no other significant mistakes in the Mousey book chapter or the MAKE project. Any other issues, corrections or improvements are dealt with below.

Q: Can you post a Parts Lists and suggest places to buy the parts online?
A: Here is the complete parts lists for the Mousey project. Solarbotics has a parts bundle for Mousey. You can get it here. The lists below include the individual Solarbotics parts numbers and numbers for other suppliers (on the few items Solarbotics does not carry). Here are the suppliers’ Web addresses:

Mousey the Junkbot Bill of Materials

1 – Junked Computer Mouse (or new el cheapo one)
2 – Small DC motors (Solarbotics Part #RM1A)
1 – Double-Pole, Double-Throw (DP/DT) 5-volt Relay (SB Part #RE1)
1 – LM386 Audio Operational Amplifier (SB Part #LM386)
2 – Light Sensors (IR *Detectors* taken from mouse)
1 – SP/ST Toggle Switch (SB Part #SWT2)
1 – SP/ST Touch Switch (taken from mouse)
1 – 9-volt Battery Snap (SB Part#BHold9V)
1 – 9-volt Battery (the checkout line of your grocery store)
1 – 2N3904 or PN2222 NPN-Type Transistor (SB Part #TR2222)
1 – 1k-Ohm to 20k-Ohm Resistor (Range available from Solarbotics)
1 – 1k-Ohm Resistor (SB Part #R1.0K)
1 – 10uF to 100uF Electrolytic Capacitor (range available from Solarbotics)
2 – Spools of 22 to 24-guage stranded hook-up wire (one black, one red) (available at Radio Shack, or use salvaged wire)
4 – 6-1/2″ pieces of 22-guage solid hook-up wire (two red, two black) (available at Radio Shack, or salvaged)
1 – Wide Rubber Band
1 – Small piece of scrap plastic (about 1/4″ x 2-1/2″)
1 – Small piece of Velcro or two-way tape (optional)

Q: How come you’re supposed to use the Infrared emitters from the mouse as Mousey’s light-sensitive eyes? Why not the IR detectors?
A: The reason why we use the emitters and not the detectors from the mouse encoder wheels is that the IR detectors are designed to only turn on and off at a specific light level. The emitters, although they were designed to SEND infrared signals, will also respond to a wide spectrum of incoming light levels (just as any Light Emitting Diode, while it’s designed to emit light, is also sensitive to light). For the IR emitters, we do a number of things to make that light response more sensitive. First, we connect the Gain pins (1 and 8) on our LM386 Op-Amp chip, which boosts the signal strength, then we use “reverse biasing” (switching the positive and negative leads on the emitters) to pump up the signal even more, and then we add our sensitivity booster sub-circuit, which gives us another gain. All of this turns the lowly mouse IR emitters into reasonably light-sensitive robot eyes.

Q: I’m confused about the wiring on the light sensors. Why do you switch the wiring that you solder to the IR emitters?
A: This can be a little confusing (especially to those of us who are dyslexic). We thought the easiest way of handling the reverse biasing of the emitters was to first determine which pin is cathode (-) and which is anode (+), and then, solder the red (+) wire onto the CATHODE (-) side and the black (-) wire onto the ANODE (+) side. From here, you just treat the red and black wires as if they were positive and negative (even tho they’re actually reversed). Does that make sense? So what is happening here? By reversing the direction of the current flow through the emitter, it makes them more light sensitive.

Q: Can I move my “eyestalks” around or do they need to be positioned as they are in the project photographs?
A: You *can* bend the stalks apart and forwards and backwards. Part of the idea behind the eyestalk design is that you can mechanically “tune” the sensors by adjusting the position of the eyestalk wires. The fronts of the emitters (which have a little clear dome on their faces — think of them as pupils) should be facing the light source at all times.

Actually, you can also play around with any positioning, to see what sort of action you get by reflected light (from a shiny floor and a gaze that’s turned downward, for instance). But try such experiments only after you’ve got Mousey working properly with eyes front n’ center.

Q: So, LEDs can act as light sensors? That blows my mind.
A: All LEDs have photoconductive properties, if you reverse bias them (swap anode and cathode). Thing is, conductivity is not that high except under very bright conditions, so for practical use in a project like Mousey, IR LEDs work best, or obviously, a proper photodiode, photoresistor, or our mouse IR emitters (which are actually IR phototransistors).

Here’s an excerpt from the website about the light sensitivity of FLEDs (Flashing LEDs):

“Ben’s use of this circuit for a photopopper takes advantage of an interesting feature of FLEDs — they are photo-sensitive. In particular, light shining on a FLED causes that FLED’s SE to be inhibited (to perform more poorly). So if you’re building a phototropic FLED -based BEAMbot, you may have problems in bright light (both SEs in your ‘bot are being inhibited, so neither side of your ‘bot wants to fire) — you can address this by partially shielding your FLEDs with heat-shrink tubing, or some paint (be careful here, you’re trying to give your ‘bot sunglasses, not blinders). Meanwhile, if you’re using a FLED-based SE on a non-phototrope, you’ll want to completely cover the FLED (with heat-shrink tubing, or black electrical tape, or dark paint…).”

Q: I’m confused by the Mousey circuit diagram in your book, Absolute Beginner’s Guide to Building Robots. It shows that the cathodes of the IR emitters connect to pins 2 and 3 on the LM386 chip (instead of anodes, the black wires). What’s correct?
A: Crap! I can’t believe I didn’t notice that mistake in the book’s artwork. Somehow it got switched on the art. I can’t believe I didn’t notice this during editing. Here’s a link to the corrected diagram.

Here’s what I’m putting in the Bug Report:

Mistake in Circuit Diagram!: The Mousey Circuit Diagram in the book and the one on this website has a mistake in the emitter eye hookups. Somehow the bevel on the IR emitter packages got switched and we didn’t notice during editing. The leads on the emitters aren’t labeled, but because the bevel indicates the cathode (-) side, it looks like you’re supposed to hook the cathodes to pins 2 and 3 on the op-amp chip and the anodes (+) to power. Oh contraire! You want to hook the anode (+) sides to pins 2 and 3. It gets confusing because of the whole “reverse biasing” technique used here (running power through the emitters in reverse to make them more photoconductive). Just remember that you want the negative emitter leads to go to power and the positive leads to go to the pin 2 and 3 inputs (it’s counterintuitive, but that’s what you do). In the book, we recommended soldering a red wire onto the cathode leads on each emitter and a black wire to the anodes, and then just treating the wires normally (red wires plug into power, blacks into the chips input pins). Don’t know if this helps or confuses matters. Thanks to builder “Mousey Fan” for catching this error. Sorry about the confusion. Barbie sez: “Building robots is hard!”

Q: I love that illustration (of the circuit diagram) and the illustrations in your book. Who did them?
A: Mark Frauenfelder, of Boing Boing fame. And yeah, he did such a nice job, on all the illos, but especially that one and the servo hacking diagram from Chapter 7 (and, of course, the trading cards, which we hope to one day put up on the site). We budgeted all the illos at an hour a piece, but the servo hack image took Mark like six hours. It’s so hard doing a technical book like this and trying to make the images both attractive, easy to understand, and accurate. On many of ’em, I would do sketches, we’d scan them in, Blake (my son) would add stuff, clean up, label parts, etc., we’d send them to Mark, he’d draw, send back, we’d send them back with changes, etc. Maddening, and time-consuming. Given all that, I think they turned out really well. And then there was the photography and the Photoshop tweaking… Have
thanked Jay yet? Jay Townsend was the photographer. He did an amazing job too.

Q: Can you offer some advice on speed control for Mousey? I’ve built the circuit and can see the motors spinning very fast speed. I am afraid that when I put everything together my Mousey will be dashing around out of control.
A: The easiest thing to do is to just change the contact profile of the “wheels,” in other words; use a steeper angle on the motor mounting such that LESS of the gear/wheel comes in contact with the ground. You can also use a tire material with a slicker surface (rather than rubber) for the wheels which will “waste” some of the excessive torque.

It IS true that Mousey is extremely lively. I like this about it. Both the walker project and this one have a very biological feel to them. The walker has a persistence that’s very bug-like, and Mousey acts very jumpy and nervous like a bio-mouse. You want to try to achieve that balance where it’s right on the verge of chaotic. If I built mine over again, I would make the angle a bit steeper to reduce some of the traction.

Also keep in mind that the motors just sitting there tethered to the breadboard are much livelier than they are once they’re carrying the full weight of the mouse case, the 9V battery, the relay, the switches, and everything else. You can get an idea for how the motors will behave in the bot by using poster putty to temporarily affix them to the notches you cut in the mouse case bottom at different test angles (I talked about this in the book). Also temp. fix the battery and just toss all of the other parts in the case as well. Hook the motor wires between a switch and the battery, flip it on, and then try to grab the switch again to turn “this crazy thing off!,” as Mousey takes off like a bat outta hell. I did this when I first got these motors, to make sure they were appropriate. I put everything in the mouse (except, of course, the mouse case top).

I’ve gotten a lot of email from builders who find the Mousey too speedy, making it feel more like a demo-derby racer than a photovoric robot. So, we’ve done some testing on various ways of possibily slowing our mechano-mouse down. We tried adding resistance to the circuit — in series with the motors and on the chip’s power pin. Neither of these worked. Adding resistance in this way seems to screw with the op-amp chip’s ability to do its job (which is to dynamically equalize its output to the two motors). There may be some other way to re-design the circuit to add resistance (and therefore slow down motor RPMs), but I don’t have the time nor the inclination to go this route. The next thought we had was to tweak the “tires,” experimenting with different materials that would change how the rubber meets the road (so to speak). On the original Mousey, we used LEGO Mindstorms corragated plastic tubing. This stuff seemed fairly slick, but we wanted to try something even slicker. Before doing this, my bot-building assistant Jesse Hurdus tried making some “thick” rubber tires from rubber bands. Instead of just using one thickness of rubber band (as I suggested in the book), he wrapped the band around three or four times. It seems counter-intuitive (you’d think these tires would provide even greater traction and speed), but these bigger rubber tires seem to do the trick. They slow the vehicle down to an extent that the feedback loop between light/sensors/chip/motors is more effective. We also made the angle of the motors steeper, as was mentioned in an earlier post. The problem here is that, unlike Herbie versions of this bot design, which usually don’t have cases, with Mousey, you’re constrained by the lid of the mouse case when altering the motor angle. We made ours as steep as possible while still allowing the top to go on. We recommend you do the same. You can also go in the other direction and make the motors relatively flat on the case bottom. This works well if you use actual tires on the wheels, which a lot of builders do. We’ve seen builder make four-wheel Mousey’s (see photo at the beginning of this FAQ) with one passive axle and one powered. We recommend using the poster putty option and experimenting.

Q: I don’t have breadboarding gear. Can’t I just go ahead and build the robot. There aren’t that many parts. Could that much really go wrong?
A: Breadboarding is an essential part of electronics. A board and a jumper kit don’t cost that much. By breadboarding, you’re guaranteeing that all of the components are working and you’re verifying that the circuit design is correct and that you’ve interpreted it correctly. If you then assemble/solder up the project and it doesn’t work properly, you know that it’s not the circuit design itself or any of the constituent components. This makes troubleshooting a whole lot easier. So, everybody reading this, PLEASE, for the love of all that’s mechanical and brought to life by frisky electrons: breadboard, breadboard, breadboard! It’s amazing how much email I’m getting from builders with problems that stem from skipping this crucial step.

Q: I have the Mousey circuit working, but the LM386 chip is getting really hot, so hot, touching it gave me a small blister. Is this normal?
A: In a word: No. You must have been a short circuit someplace. The chip (or none of the other components) should get what would be described as “hot,” warm maybe, but not THAT warm. Look carefully at all of your wire connections and solder joins and look for crossed wires or bridges of solder that might be shorting the circuit.

Q: You claim this is a beginner’s robot project, and it’s in a book for “Absolute Beginners.” The soldering seems kind of hard and you have to buy breadboarding stuff, a multimeter and a lot of other high-priced tools. How can this be considered “beginner”?
A: I’m getting a lot of email from people complaining that this and the other projects in my book are too hard for a beginner. It’s ROBOTS, people! No real robot project is going to be easy. And these are scratch-built robots. When I ask these folks if they’ve built any of the kits first that I review and recommend in the book or done the soldering practice I recommend, they ALL say no. If you are a beginner and you jump in trying to learn soldering and robot building with one of these projects, it is do-able, and it’ll be quite the learning experience, but it will also not be without some genuine frustrations. I guess it’ll separate the true bot builders from the wannabes ’cause you’ll need patience and persistance, two qualities that a robot engineer needs in large quantities. But that said, I do recommend that people get their skill set down and some easier kits under their belts before tackling the projects. And as to the “expensive tools,” you’ll need all of this stuff if you plan to build any other bots or other electronics projects, and most of it is NOT expensive. The most expensive tool is the Digital Multimedia and you can even get a really respectable one of those inexpensively if you look for sales or buy one on eBay.

BTW, builders: When you buy parts, always get extras of components that are cheap. These IC chips, caps, resistors, relays are all inexpensive so get more than you need in case you blow any or they don’t work to spec.

Q: I did not want to wait for the motors from Solorbotics, so I went to Radio Shack and got some motors, the smallest ones they had. I want to slow Mousey down by attaching a large gear to do some gearing down affect, but I can not find a gear to match the teeth. Any help would be greatly appreciated.
A: The motors you got are probably the Mabuchi 1.5-3V models. Did they cost like US$2.99? Those are surprisingly great motors for the price. If I’m not mistaken, they’re used in the gearmotors for the WowWee Robosapien. Designer Mark Tilden has used these motors before, in the B.I.O.-Bugs and the Beastland Dragons (his two previous bot projects with WowWee).

For this particular project, however, they have some problems, tho. They EAT batteries. Much less power-efficient than the Solarbotics RM1 (which is also a Mabuchi, BTW). They’re also a lot heavier. Using two of these motors would nearly equal the weight of three of the RM1s. This might not be such a bad thing in terms of slowing your bot down. I think they’re also slower than the RM1s, which again, may not be such a bad thing in this instance. This may all add up to mean that, using these motors, you don’t have to gear down ’cause these other factors increase the mechanical resistance of the overall bot. The biggest problem is that…well…they’re big. More case-cutting, more fitting, more trouble getting the lid on the case. Then you’ve got gears and gear attachments/housings to consider. We specifically chose this motor because it fit the weight, power, and size constraints of this application. Improvise with this in mind.

Q: The LM386 chip has only 1 output on pin 5 controlling the speed of 2 motors independently that are on the same line. How is this possible? Am I missing something?
A: This LM386 chip is designed as an audio amplifier. It’s supposed to compare two input values and amplify the difference. It doesn’t matter what that difference is, just so long as there is one. It sends the amplified signal to the output pin. As the chip “struggles” to equalize the difference in the inputs, it changes the power on the output pin. It is this power fluctuation that is used to “steer” the motors based on the changing values of the two light-driven inputs.

The LM386/Mousey circuit uses a split-power output, meaning that if we have two power draws on the line, which we do, it will attempt to split the power needs evenly. But if we have uneven input, as when one “eye” is receiving more light than the other, the output reflects that in more power going to one motor than the other. These power fluctuations and then equalizations (when the two eyes are getting equal amounts of light input) allow Mousey to steer towards a light source.

This is an amazing little chip for what it can do. I was describing the circuit to a geek friend last night and he was in awe of the fact that you can make a “real” robot (read: one that has a true sensor-brain-actuator chain) out of something as lowly as an el cheapo chip designed to make speakerphones speak and analog modems go squeek-SKWACK-shsssssh, etc. I’m in awe of folks like Randy Sargent of MIT (who created the original Herbie circuit), Mark Tilden, and others who can create these minimalist robot brains out of lowly analog components.

BTW: has a nice library of datasheets for components used in BEAM (and BEAM-related) robots. Included here is the LM386 sheet:

Q: Are there any alternatives for the LM386 chip?
A: I know of no Herbie-circuit hacks using other op-amps. I’ve seen a similar photovore built from the venerable 555 chip, but I haven’t built one.

Grant McKee’s adorable Herbie built on a 555 timer chip

Q: I have read your explanation of how the LM386 chip works and I still don’t get it. Can you elaborate?
A: Okay. I’ll try. When the light value is the same (across both inputs), both motors receive equal power and steer the robot directly towards the light source. If one sensor is getting more light, it will split the difference to the power output. So, with a 9v battery, when light is hitting the eyes equally, both motors will each feed off of 4.5v and spin at the same rate. If the input becomes unbalanced, the voltage on the pin might rise to 6v, so one motor will have 6 volts to draw on, but the other will only have 3 available, turning that motor about half as slow. But the chip wants the values to be equal, so it will react by changing the power levels as the robot moves (as it amplifies and outputs the difference between the two inputs), always trying to lock onto an input of equal value on both input pins (steering the bot towards the light in the process).

Q: What do I need to know about resistor wattage ratings? I see that some are rated 1/4-watt, some are 1/2-watt, even 1/8-watt.
A: 1/4-watt is most common for these types of low-volt/low amp circuits. 1/8-watt resistors can also be used. This rating refers to the number of watts a resistor can safely dissipate, as heat, before it fails, fries, blows up, etc. 1/4-watt resistors are more than adequate for this circuit and readily available at retailers like Radio Shack.

Q: Why is a 5V relay used if the battery is 9V?
A: The coil on the 5V relay is activated at 5V, but it’s rated for much higher voltages (I think up to 24 or 30VDC on the contacts, don’t know the upper limit on the coil itself). The 5v relay is used because it’s a ubiquitous component found in many low-power electromechanical switching applications (such as our humble little circuit).

Q: I have a button switch not from a mouse that I want to use for the bump switch. How can I tell which of the three terminals on the switch I should use?
A: Ah. Good question, and a good opportunity to address some I didn’t in the book: selecting switches. Switches of this type (a button switch with three pins) are frequently marked on their case (or “package”). The print may be tiny. If it is marked, it will likely say “NO,” “C” and “NC.” These stand for “Normally Open,” “Common,” and “Normally Close.” If they are marked, you want to connect your circuit to the “C” and to “NC.” Normally Open simply means that the switch is open (i.e, off” when the switch is NOT depressed. A Normally Closed switch would power the circuit until the switch was triggered. Not good in our case.

If your switch package is not labeled, no biggie. Just set your multimeter to volts and attach your probes to two of the terminals (the center one will assuredly be Common). When you get juice flowing through the terminals with the switch in one of the On positions (facing away from Common), that’s your NO terminal and the one you want to use.