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?

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);
}
}
}

Your picture is too big to view conveniently.

I find it almost impossible to figure out wiring arrangements from that "photographic" type of picture. A drawing of the connections is easier to understand - post a photo of the drawing.

You haven't identified the components in the picture.

How is the Arduino powered?

Those 9v batteries are a terrible source of power. They can't produce enough power and they run down too quickly.

Assuming everything is working at 5v and that the unnamed IC is a 7805 voltage regulator then it should be OK just to replace the 9v battery with the 12v power supply.

Note that you don't convert a 5v servo to a 12v servo. You "convert" the 12v to 5v so it can power the servo safely.

...R

A 12V servo has a 12V supply, you still route ground and signal to the Arduino to
control it. In other words the 12V and 5V supplies share a common ground, preferably
at a single common point (such as at the servo).

Can you control a 12 V servo with a 5 V control signal ?

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

The 9v battery is useless for powering the Arduino. It can also be powered from the 12v battery.

Apart from that it looks fine.

...R

If the 12V battery is lead-acid, you should have an inline fuse of appropriate rating
to protect things.

Breadboard isn't necessarily going to like the higher currents from a 12V servo,
everything has its limit.

MarkT:
Breadboard isn't necessarily going to like the higher currents from a 12V servo,
everything has its limit.

In the diagram the servo still seems to be powered at 5v from the 7805.

However, I thought the usual reason for higher voltages was to give more power at the same current :slight_smile:

...R

However, I thought the usual reason for higher voltages was to give more power at the same current

Not with a servo it is not, you might be getting mixed up with stepping motors running from a chopping regulator.

Grumpy_Mike:
Not with a servo it is not,

Watts = volts x amps. What am I missing?

...R

thx folks!!

"If the 12V battery is lead-acid, you should have an inline fuse of appropriate rating
to protect things."

hey mark, I'm a total newbie here so i was wondering where do i place the fuse in the circuit?

...plus i just found out that the 12v servo is digital!!!
http://www.crustcrawler.com/motors/RX28/index.php?prod=66

does anyone know where i can learn how to program in UART to control a digital servo with an arduino?

below is the new circuit

how to program in UART to control a digital servo with an arduino?

That is just Serial.print and Serial.read

where do i place the fuse in the circuit?

In series with the positive lead to the battery.

Watts = volts x amps. What am I missing?

That a servo has electronics in it and even if you could supply the motor with more voltage independently it would then get too hot and burn out.

Grumpy_Mike:
That a servo has electronics in it and even if you could supply the motor with more voltage independently it would then get too hot and burn out.

That's true if you supply a 5v servo with 12v. But not if you have a 12v servo.

..plus i just found out that the 12v servo is digital!!!

It would want to be gold-plated at that price. I will stick to $5 5v servos.

...R

That's true if you supply a 5v servo with 12v. But not if you have a 12v servo.

True but you would be rather silly running a 12V servo off 5V, it might not even work. Where as a stepping motor can be run to advantage off any high voltage providing you keep the current down to the limits. Even a resistor to limit the current will give you an increase in the potential top speed.

It would want to be gold-plated at that price

Well it has got a processor embedded in it so it runs with the minimum of overhead from the Arduino. It also has RAM and EEPROM in it. But having said that it does loop pricy.

User manual for that servo:

http://www.crustcrawler.com/motors/RX28/docs/RX28_Manual.pdf

That servo is not a standard R/C type servo, but rather one that uses serial communication to command the servo(s) attached to a serial bus via a serial protocol that includes a servo device ID, such that several servos can share a common "daisy-chained" bus that supplies data and power to the servos. It is no way compatible with the arduino standard servo library so cannot be used as you have proposed wiring to a arduino. I suspect that these are really just 5 volt servos that have built in +5 vdc voltage regulators inside the servos.

Grumpy_Mike:
True but you would be rather silly running a 12V servo off 5V, it might not even work. Where as a stepping motor can be run to advantage off any high voltage providing you keep the current down to the limits. Even a resistor to limit the current will give you an increase in the potential top speed.

Never mind. We are each talking about different things.

...R