Let's Make Robots!

Motor control

 I have the following small problems:

In the beggining I had them posted in the wrong place,

 So i moved them here:

Problem one: i tried hooking up two motors.

they both had one wire soldered up to V2, and the other one to outputs (6 and 7). i now typed this code:


high 6

high 7

pause 3000

low 6

low 7

pause 1000

goto main

notning happened. any ideas? 

PS: i dont have a motor drive.


Now for the next important question, 


does this look about right?


I just dont want to make my picaxe 28x1 go up in flames.

its a 5V regulator by the way. And yes, i am going to put a 9volter in there.


Comment viewing options

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


It's always a good idea to protect your expensive electronics with regulators. But I never worked with these voltage regulators. All I can do is read the docs I would find on internet. I'd rather let a more experienced LMR member answer this question.

I doubt that your microcontroller is capable of supplying enough power (current) to a motor, even if it is a little one.

From what you describe  I understand that you connected it like this:


Is that correct? I am making a lot of assumptions here. Please check all of them:

V2 has power? V2 has 5 Volt? or 9 Volt? Can you confirm this with a meter?
Your micro controller is connected to its own power V1? That is 5 Volt? Did you measure it?
Your motor works when you connect it directly to your power source? Which way is it turning? write down how you connected it!

Alright, you checked it all, now let's examine that circuit you built.  Your micro controller is behaving like a very expensive, but very little switch. Sometimes your output pin is connected to Vcc (V1= 5 Volt). This is called high in your program. Sometimes it is connected to ground. That is low.

Can you see how the current flows through your switch and motor when you tell it to go high or low?  Remember, electricity always goes from the higher to the lower voltage. Just like the water flows from your Swiss mountains to my Dutch basement.

;-) Rik

For your first question: It is never a good idea to hook up your motors directly to output pins. But since I think I'm seeing a tiny corner of a picaxe 28 starter board in your picture, i asume you hooked it up with the darlington chip in place. In that case it sounds like the motors are connected right. Show us pictures of the setup otherwise we have to guess how things are connected.

 In answer to your second question: The way to tell if you connect the voltage regulator correct, is to test it. You should get a multimeter and measure the voltage between the middle leg and the right leg (in the picture). Be sure to disconnect it from the picaxe first before you hook up the 9V. 

According to this http://www.datasheetcatalog.org/datasheet/stmicroelectronics/2143.pdf -  (if its a L7800 series - kindof hard to see) - that would be correct

pin 1 input
pin 2 gnd
pin 3 output  for up to 1.5 Amps

When interfacing electronics to motors I "should"  always use optocouplers, but I dont....

I don't ever allow digital inputs or output sink or source motor current.

From small to large motors you can wire it this way.  - it accepts TTL voltages (TTL is transistor to transistor logic) , which in a nutshell means 0 to .8 V is off and 2.2 to 5 Volts is on.



my robots
my garden

sorry if im a bit dull, but i dont get most of the stuff you guys are telling me. but i apprieciate the help all the same^^.

i just want to know how to hook up two motors, and the code i need to use them. but yes, they do work with 5V. in fact, theyre

too fast. way too fast.



Is it the english language that makes it hard to understand us? Or is it the technology stuff?

(or both)


oh, no its defenetly not the language. Im a fully bred 100% USA citizen.

sure, spelling isnt my strong suit, but it nevers was or will be.

Its mostly the Techy stuff and the drawings..... they make my head spin.

its not the volts that's the issue, it's the amperage.   The digital outs on an MCU are only going to supply maybe 100ma I think(don't know exact figure), you need to use a transistor, relay, or h-bridge as a switch, then the MCU just flips the switch, rather than actually supplying power directly to the motor.  regular hobby motors like you have pictured will need as much as 1A perhaps at stall.  plus, the feedback from the motors could possibly fry your MCU....

one of the above posts has a good drawing of how to connect a transistor to be your switch, but if you want the motors to spin both ways, you need an h-bridge, and for that I suggest you check out the first robot tutorial http://letsmakerobots.com/start if you are using picaxe, and http://letsmakerobots.com/node/2038 for arduino, or http://letsmakerobots.com/node/2074 for general info on h-bridges.

also, your motors need gearboxes, it doesn't look like they have any.....

good luck!

BTW: since you mention you are using a PICAXE 28x1, the picaxe first robot tutorial above will show you how to use a L293 chip with that board specifically, the chip itself should be cheap, sparkfun has them for <$3


The motors aren't geared so they will spin fast, but when you put it on the ground they likely won't move or will take a while to get up to any sort of speed. This is because torque is low very low. Check out the post Fritz did on gearing. It will give you a lot more info that you ever wanted!
No gearing on the motors = Low torque high RPM.