Again a Braitenberg vehicle. This one is even smaller, than the previous one and comes on a custom PCB. It weighs 17 gramms, is driven by two pager motors, powered by a small lipo cell and controlled by an 8-pin ATtiny25V.
Schematic and parts
This tiny robot has a very low component count. At least for a robot, based on a microcontroller. That has, of course, some implications. It can handle only two sensors and the motors run only in one direction. A full H-bridge for both motors would need 8 transistors and more lines to control it.
So I decided to just use a single transistor to drive the motor. That means it can only run forward. Not a big deal for a Braitenberg vehicle.
Here is the parts list. Most parts are very common.
- ATtiny25V, 2 kB flash RAM, ATTINY25V-10PU-ND
- MPC1700 3.3 voltage regulator, MCP1700-3302E/TO-ND
- 2 * light dependent resistors (LDR)
- 2 * 10 kOhm resistor
- 2 * 470 Ohm resistor
- 2 * 2n3904 transistor
- 2 * 1n4148 diode
- 100n capacitor
- 100u capacitor
- Lithium-polymer battery, 3.7 V, 100mAh, HobbyCity
- 2 * fuse holder
- 2 * pager motor
- heat shrink tubes
- rubber tube
- custom PCB
- 6-pin ISP header
A bit tricky was to find the right rubber tube to build the wheels. I found these, which are normally used to connect tiny motors to a model stern tube. Because the inner diameter is a bit to wide, I used short pieces of cable isolation as an adaptor.
If you have pager motors with an attached weight on their shaft, you may want to take a look at the RobotRoom for instruction on how to get rid of the weights. I had no locking pliers, maybe that’s the reason why I ruined at least three motors. Mostly by twisting the shaft while trying to pull off the weight.
Software and programming
The software is straigt forward. Reading two inputs, the light sensors, and driving two ouput lines accordingly with a PWM signal.
But it turns out, that the software needs a lot of adjustments. First you have to figure out in what range the light sensors report values. Next, check at what PWM level the robot starts to move. Maybe even adjust the directional stability.
Programming the robot in circuit via the 6-pin ISP header didn’t work out in the first place. The programmer was not able to set the lines to high that were driving the transistors. So I soldered a socket in place and can now pull off the two 470 Ohm resistors. After programming I can re-insert the resistors. Can be seen on the left critter on the picture above. A bit awkward, but it works.
You should have a very clean surface for them to run on. If you put them on a table, as I did, be sure to have very good reflexes or put a kind of fence around them. Mine dropped off the table a couple of times. Mostly no dramatic damage, but the sensors got twistet and the motors sprung out of their holders.
Depending on the ambient light, the light source itself and the nature of the surface you may have to adjust the light sensors. As an example, if the surface is white and diffuses the light, then you would have to bend the sensors away from the surface, because the surface looks bright, even if the robot turns away from the light source.
Issues and conclusion
There are still a couple of issues to resolve.
- Software improvements, use ADC in free running mode and use hardware PWM to drive the motors
- Place the skid in the middle of the PCB.
- There is no protection of deep discharging the battery, no idea how to solve this.
- Add a small power switch.
Someone wanting to volunteer for some private beta testing and helping with improvements?
Besides these issues, these two critters are fun. There was a lot of testing, reprogramming and re-adjustment needed, to get them doing, what I thought they should do. But hey, that’s the way to learn something.