Is there a secret to getting the picaxe to power a pager motor, for example, one capable of swinging a small drumstick?
I'm working with 3 GM10s. 2 for the wheels via the L239D, and one for a "percussion actuator". The percussion actuator's not working for the controller:
The Setup:
1 gm10 wire connected to pin 4
1 gm10 wire connected to 0v
5.5 V single power supply
ANY combination of Darlington / no darlington / 330 ohm resistor / motor driver in or out
The Code:
high 4
.... what am I missing? Do I need a mosfet or a pull-down resistor or something? pwm?
-the motor works when connected to the voltage pin
Checking http://www.rev-ed.co.uk/docs/axe020.pdf on the bottom of page 2, it looks like one GM10 motor lead needs to be connected to your positive voltage source, not 0 volts.
Might need to connect a jumper between V1 and V2 too, and connect grounds as shown.
A picture of what you have A picture of what you have put together with sample code may help too. I’m a visual person when it comes to troubleshooting.
Do you have the darlington Do you have the darlington chip in place? Is there anything in there? As shown it should be Pin 0. Just to test things out remove the darlington chip and put a resistor connecting the bottom left and bottom right pins on the darlington (just like you would a connect a servo in the START HERE project without the yellow chip). Does Pin 0 HIGH work? If not someone with more experience with pager motors may need to help. I’ve only used server and motors on my picaxe board. I prefer to breadboard or solder something up instead of project boards.
Post your code then. Maybe it is code related. A photo of the set up may help too since you may have a jumper missing, not properly seated, wrong pin connected, etc.
maybe an output pin is not enough to drive it, but i never used them so i am not sure. Since it works if you connect it to V+, why don’t you use a transistor to drive it via the output pin?
PS: do you have a multimeter? If you do check if current is coming out of the pin so you can understand where the problem is.
Darlington needed You are trying to run a little motor, so the Darlington chip should be used. I had figured you were using one. Connect one motor wire to the Darlington output, and the other motor wire to the V2 pin next to it, then run your code on that pin, it should work.
I think that the transister via the output pin is the way to go (based on the documentation and Robotologist’s input). How do I do that? I plan on using a bunch of other components, so I can’t go with the Darlington. What sort of transistor are we talking here?
Test Try the connection out with the Darlington to see it working. Then you could try using a 2N2222 or 2N3904 transistor in the place where you want the motor connected. The base (B) of the transistor to the pin of the PICAxe, the Emitter to ground, and the Collector to one lead of the motor with the other motor lead to V2. It might be good to have a 220 ohm resistor from the PICAxe pin top the base, but might be ok without it.
Yep, looks good I had not mentioned the flyback diode, but that is a good addition to the circuit. For the diode something like a 1N5817 or even a common 1N914 (1N4148) could even work.
You are connecting to the output pin and the ground.
With the darlington: the left pin (red wire in your picture) is used as a ground. The middle one is allways V2 and the right one (black wire in your picture) ground. So if you make the output pin 0 high: the corresponding pin to the right of the darlington chip switches from “not connected” to Ground. You effectively hooked both wires of the motor to ground. So move the right wire in your picture 1 pin to the left.
I think that if you replace the darlington with a resistor, the picaxe output pin will not provide enough power for your geared motor. Wich is probably why that didn’t work.
You cannot replace the darlington with the motor driver. That one goes in the bottom socket.
Thanks for your help.you’re right. got it working with the darlington.
a resistor didn’t give enough power. maybe if I did two resistors to make a Darlington pair?
My problem is that I’m trying to get darlington power AND use LEDs, speaker, servos, and so on. So I was hoping to get that power on an individual pin. Any ideas?
I don’t think you can make a darlington pair using two resistors. A darlington pair is two transistors. Big difference!
If you want to use motors and leds and servos: I’d insert the L293D in the motor driver socket and user 330 Ohm resistors in place of the darlington. Have a look at the pictures on the First Robot page (Start here) That shows you clearly how to set it up.
That way you have at least 4 pins for leds, servos or speakers and the other 4 can be use to drive 2 motors (or use only 2 to drive 1 motor and the other two to power more leds). If you use the motor driver, you’re going to have to connect the motor to the holes marked A or B on the circuit board and not to the pins on the right side of the darlington socket.
As I said. Frits! explains all this with nice pictures at Start here
yeah, I think I totally didn’t phrase my question correctly, or else you didn’t read it correctly. I appreciate the help, though.
What I meant to say was:
Is there a handy way to use the darlington to power some dc motors forward only (e.g. a drumstick) and still be able to use LEDs, Servos, speakers etc. (I understand about the motor driver; this question is about pins 0-3 only)
As a possible solution, I was thinking about making my own darlington pair out of two TRANSISTORS for an individual pin. Is that possible/feasible?
Yes you can. You can also use both the darlington chip and the motor driver chip as long as you don’t use pins 0-3 through the darlingtonn AND the motor driver. If you hook up a led using the darlington, you hook it up the same way you did your motor, but you need to add a resistor on the + leg of the led. Servos and speakers can’t be controlled with the darlington.
The picaxe manual has a good reference for different kinds of setups: picaxe_manual1.pdf
Awesome! thanks a lot. I’ll have to get a copy of those diagrams.
In the meantime, I’ve come up with a different solution that works (for a speaker, anyway): I’m just using the pre-darlington output pin I soldered on my board for the SRF05.
However, I can see myself making my own darlington pairs in the future.