help with placing diodes and upgrading 5v servo to 12v servo

Hey Folks,

Looking for some help in regards to making this project safer and more powerful. Basically the set up has 2 light sensors feeding back information to an Arduino one . The servo will rotate left or right depending which light sensor is receiving more light or remain still if the light sensors are of equal value. The circuit is working properly as u can see in the YouTube video link lower down.

…but here’s the questions

  1. could this be better setup?

  2. does the circuit need a diode? if so where and what kind?

  3. how does one go about upgrading it to a 12v servo and 12v power supply?

https://www.youtube.com/watch?v=vj87_QD8o40

http://i1374.photobucket.com/albums/ag4 … fd5e96.jpg

and here is the code for my sketch…

#include <Servo.h>

Servo robinsServo;

int servoPin=9;

int sensePinA=0;

int sensePinB=5;

int A=0;

int B=0;

void setup()

{

Serial.begin (9600);

robinsServo.attach(servoPin);

}

void loop (){

{

Serial.println(analogRead(sensePinA));

Serial.println(analogRead(sensePinB));

A=analogRead(sensePinA);

B=analogRead(sensePinB);

delay (500);

if (A < B)

{

robinsServo.write(110);

delay (15);

}

else if (B < A)

{

robinsServo.write(70);

delay (15);

}

else

{

robinsServo.write(90);

delay (15);

}

}

}

How does the Arduino get it’s power ? I appears from the USB cable and not the 9v battery. If so then all the 9v battery is supplying is power to the servo, via a 7805 voltage (5v) regulator ? I note your Fritzing diagram has an error re: the ground and 9V power to the 7805 (it’s not a transistor). Other than that I don’t see anything wrong nor any need for a diode. I would say that a 9v “transistor” battery doesn’t provide a lot of current nor a lot of lifetime. 4 AA batteries in series would give you more current (if the servo needs it) and about 5v, close enough that you could eliminate the 7805 regulator and associated circuitry.

http://en.wikipedia.org/wiki/Nine-volt_battery

http://www.pololu.com/blog/2/understand … h-is-not-a

As for going to a 12v servo … can you provide a link to one ? I think they use the standard 5v servo control signal but I’d want to be sure. As for wiring … you better have a really heavy duty power supply/battery and appropriately sized wiring … no protoboard in the power path. How much torque do you need ?

The markings on the 3 pin device with a heatsink in the picture is a kind of p-(MOS)FET. Not a 7805 regulator. Though in the video this is contradicted, as he says it regulates the power from 9 to 5 volt. Makes no sense.

It definitely seems to be wired wrong any way you look at it. The positive (red) wire coming out of the battery is wired to the middle pin of this device, which also is wired to what seems to be the ground rail, as some other wires conduct the current to battery minus (black wire). So this definitely shorts the battery as it currently is. (no pun intended)

Not knowing what model this (Mos)fet is, I dare not risk guessing what pin is the gate, source and drain is. One would expect the gate to be driven by the Arduino somehow to cut power to the Servo. But this is not indicated.

@robinmitchell Please explain what this device is. A 7805 regulator is very different from a Mosfet/transistor, even though they can be made in the same kind of package.

Thx for the quick response I hope this newer image clarifies things…

http://i1374.photobucket.com/albums/ag4 … 7247e6.jpg

Per your upper diagram, the mystery device is a 7805 voltage regulator, not a transistor. But now I have to ask why you are using it in your “dream” configuration. Isn’t that supposed to be a 12V servo ? If so (again, a link to the item would be helpful) then it runs off 12v, connect it to the 12v battery directly, power and ground. Eliminate the 7805 and it’s 2 capacitors. Do keep a ground wire connecting the 12v & servo to the Arduino ground. The rest of your protoboard circuit looks OK.

FWIW - you could even eliminate the 9v battery and run the Arduino off the 12v battery as well. It could look like …

I note that some of these 12v servo are true digital servos, they don’t use the normal 1-2 msec pulse every 20 msec for a control signal, they use a TTL level serial data stream, as would be sent from a UART. In your case you’d probably want to use a “soft” UART.

http://arduino.cc/en/Reference/SoftwareSerial

Thx U Mee and Max!

sorry here is a link to the servo http://www.crustcrawler.com/motors/RX28 … Manual.pdf

i didn’t realize there was a difference…it is a digital servo so your right about having to know UART …

UART gulp!! u wouldn’t happen to know a great resource where i can learn how to do that with that servo?

and is there no need for a protective diode for the servo motor in the circuit?

Cheers and Thanks again,

Robin

Not only uart, according to that pdf the servo needs the serial commands to be sent as rs485 electrical signals. So you will likely need another interface board for that, as afaik arduino cannot send those. But I’m not very familiar in that.

The pdf manual seems pretty extensive on what commands you can send and what it means. Some examples can be found in some other dynamixel document. I gues you need to search that too.

Yeah the OP certainly dove into the deep end w/that servo. I would have to question that choice and see if that level of complexity and cost is truly needed.