Let's Make Robots!

Picaxe motor output pin use


This is a nice little hack I discovered that allows you to use LEDs on your Picaxe-28 robot without taking up any other pins.

 

When the picaxe 28 board is used with the L293D motor driver chip, the picaxe chip sends power to the motor output on the board as well as the normal output pins. This can be used to  give the robot headlights, reversing lights, direction indicators or, for the evil robot emerging from the darkness look, light up eyes. With my motors and a 4.5V power supply, the current was kept low enough because the motors draw more current, so I did not need a resistor. but be careful, YOU MAY NEED TO LIMIT THE CURRENT, I AM NOT SURE.

The idea is fairly simple. When the direction commands are used, the controller sends power to one, or both outputs connected to the motor, and the motor driver chip converts this to the following output on the board motor connections:

both inputs low                             -motor halt

first output high, second low           -motor forward

first output low, second high           -motor reverse

both inputs high                           -motor halt

as the chip uses outputs 4,5,6 and 7, this means that when the motor runs forward,  output 5 is high for one motor, and 7 for the other. When in reverse, outputs 4 and 6 are used.pic28.jpg

 

 

When turning, one motor is forward and one is reverse, so the robot will turn in the direction of the reversed motor, so by connecting an LED to each reverse output, (a flashing one looks even better) you have some nice indicator lights. when both motors reverse, you will have reversing lights.

A bi-colour LED can be connected to any ground pin,  and the two (+) legs to a forward and a reverse, to make it one colour when forwards, anda different one for reverse.

 

These are just a few possibilities for this function, It may also be possible to  add other components.

Comment viewing options

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

I always build my own computers and it always ends up I get stuck when it comes to plugging in all the different little LEDs lol

 

Daniel Saltman

BostonDan@gmail.com

for some reason this didnt work on my robot, the leds stayed on and dimmed a bit when the motors were turning, odd, wonder why
The voltage is being chewed up by the motors so the LEDs get less and dim.
well yeah, the problem is not the things getting dim but not turning on or off like they should
Ahh you didnt say that the LEDs were supposed to be turning off. Can you post some code? Maybe make it a seperate forum topic so others can help or be helped if they have the same issue. Post a pic of the circuit too it may have somethign to do with how it is wired up.
For your purposes, LEDs have no internal resistance. Consequently, if you connect them across a fixed voltage source, they will attempt to draw as much current as you can provide. Id est: you MUST limit the current. Series resistor all the way, baby.
Explain more, draw curcuit?

:D i love this. I think I will never do a robot without it using this setup, from now on :) Thanks!

It is actually what this one also has: http://letsmakerobots.com/node/2037