Discussion forum for the BasicX family of microcontroller chips.
|
i have a servo and i simply want it to move when i tell it too. The servo has 3 wires - a black, a red, and a white. There are 3 pins on the board for a servo. I have a separate 5V power source, with a positive and negative wire coming from it. I have the right code for the servo to work. so how do i connect the wires? bc i swear i have tried everything under this sun and i just plain give up. so somebody pls help me. thanx matt |
|
|
|
I'm assuming that you have TWO power sources then, whatever is powering the BX24 and what's powering the servo. Even if they come off the same transformer through different regulators, this is how to do it. The servo's white wire is your "signal"; attach this to a BX pin. Attach the servo's black wire to your servo's power supply's ground, or -. Tie this into the BX24's powersource's ground. (i.e. all the black wires should somehow connect.) The servo's red wire goes to the positive on the servo's power supply. There should be no connection between the servo positive and the BX24 positive; it doesn't attach to the pin or to that regulator. For example, you could have a transformer powering an LM7805 (5V regulator) and an LM7806 (6V regulator). On the regulators, both source and ground wires connect to the transformer's source and ground. The LM7806 output (which is positive) provides the BX24's power on pin 24 (which is also regulated but somewhat fragile, hence the 7806), while pin 23 (BX ground) ties all the way back to the shared ground between the transformer and the regulators. Pin 12 (for example) would connect to the white wire of the servo. The servo black wire ties all the way back to that source ground again, and the servo red wire ties to the LM7805 output. If using a battery instead of an LM7805 as the power for the servo, you still tie the grounds together. Otherwise the signal can't do it's thing. Other gotchas: Make sure you use the correct pin. Make sure your pulse is between 1ms and 2ms; that's all the servo can accept as input. Put your servo pulsing in a delayed loop; I use Delay(0.02). Hope this helps. At 12:12 AM 11/18/2001 -0500, Matthew Mangione wrote: >i have a servo and i simply want it to move when i tell it too. The servo >has 3 wires - a black, a red, and a white. There are 3 pins on the board for >a servo. I have a separate 5V power source, with a positive and negative >wire coming from it. I have the right code for the servo to work. so how do >i connect the wires? bc i swear i have tried everything under this sun and i >just plain give up. so somebody pls help me. thanx matt |