Let's Make Robots!
hornby_v_0_01.zip1021 bytes


Hornby (named for the guy who invented Meccano) is an autonomous line-following robot cobbled together from minimal parts. It is my first effort at a small-scale robot, and I hope it will help me refine my knowledge of what the Arduino is capable of on a minimalist level.

The key ingredient to Hornby's operation is a custom-built IR sensor circuit, which uses three pairs of "Infrared LED Emitter and Detectors" from Radioshack (part #276-142 for all those who frequent the Shack). The "emitter" is an LED light that sends out infrared light, whereas the "detector" is actually a photodiode that, as I understand it, allows current to pass through it if it's blasted with infrared light. Infrared light will not reflect from a black surface, whereas it will from a white, which is exploitable for the purposes of creating a sensor.

I have added the IR sensor array to LMR as a component, with the Fritzing file I used to make the circuit, for all who may be interested in making a similar circuit on the cheap (it cost less than $15 to build to relatively easy to find Radioshack parts.)

For mechanics, I wanted to use only a minimal amount of Meccano parts, as I figured that would keep complexity down and get me to the state of programming much more quickly than anything else. The "actuators" are twin motors ala the ever-so-hip Tamiya dual motor gearbox. I'm also using these fancy, thin rubber Tamiya-compatible tires. The official Arduino motor shield controls the motors. The shield is basically a trumped up dual H-bridge, and has current-detecting bells and whistles.

The entire Arduino Uno/motor controller brick of awesomeness is rubber banded to the Meccano base. Office supply engineering for the win. 

Update Log

October 17, 2012

This is the initial posting of the bot. At this stage, the programming still needs some tweaking. In general I need to experiment with the bot more, as while it seems to be detecting lines drawn on a peice of white cardboard well enough, it often goes too fast, and doesn't turn properly.

I believe the small Meccano plastic wheel in the back might mechanically not be cutting it, as the robot seems to have difficulty turning. Not exactly sure how to fix that, but I'll keep working on it.

And yes, I know everyone likes videos, and I will have one soon. I promise :)

October 18, 2012

I attached a video to this post to demo some of the difficulities I'm having with this bot at the moment. It seems to be having a torque problem, which I'm not exactly sure I understand. Hopefully the video explains my troubles a bit. Any ideas? At this point my only thought is that I need to use motors with higher torque. Not quite sure yet.

October 19, 2012

So, it turned out that the problem with this little guy was that the Tamiya twin-motor gear box needed to be re-geared to a high torque setting. I busted out the directions and rebuilt the gear box, and lo-and-behold it seems to work fine.

Someone had suggested that perhaps the problem was the voltage I'm using on the motors (a separate power source to the motor controller at 6v). It' true that the specs for the motors for the gearbox are 3v. However, if I use only a 3v AA battery box, the motors only seem to barely turn. Some of that, I'm guessing, is because the motor conroller itself eats up some of the power.

I also had to slow down the motors speeds during turns, as otherwise Hornby would overshoot the turns, and more or less keep going in a circle. Simply giving the motors an analogWrite of 150 during turns (as opposed to 255 during straightaways) solved that problem.

I may continue to experiment with this little guy by perhaps giving him some sound effects, or perhaps an LED face, but for the sake of what I was attempting to accomplish, it's basically complete. 

Mission accomplished on my first successful bot!


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Frank Hornby would love it!

birdmun's picture

letting us know if the current draw of the motors is different from one another, or, excessively high (excessive would be somewhere near the 2A limit of the motor driver. :) ).

The arduino shield uses a 298 which is capable of 2A Max per motor. A stalled motor will stereotypically(hopefully OB won't call me out on this) pull double the current of a NO LOAD motor.

Protowrxs's picture

Nice little bot. You might try a caster, omni wheel, or just a ball caster in the back.

Something that will let it try to swivel a little better. I've used one of those small furniture leg sliders as well as they are slippery. Just a thought.

Any video of it in action? I may give your line sensor setup a try - I've been looking for something simple for line/edge detection.

Cheers - Stephen

birdmun's picture

TCRT5000, or, the Q1114?

Protowrxs's picture

Yeah, I use the QRB 1114's on another bot not up here for odometry at the wheel. They are cheap enough, they just take up a bit of vertical space when mounted looking down. Thinking of putting one  up front on my Scuttle bot for edge detection. Haven't tried anything else yet though. Thanks for the suggestions.