Hi, Everyone I am B.S.S.SRIKAR
I have a plan to make a robot which 4 servo
but I don't know how 1 Arduino Uno can control 4 servos in a way which is simple, Can anyone please me as soon as possible.
Hi, Everyone I am B.S.S.SRIKAR
Do you know how to control 1 servo ?
Do you know how to use an array ?
Could you declare an array of servos ?
What do you mean by "simple" ?
Well, there may be various versions of that.
But consider this accessory board:
@Paul_B What is this board, I've never seen it.
Can you please tell me for what it is used...
But, it looks cool
I don't know
~how to use an array ?
~declaring an array of servos ?
It is used for any of a number of applications. It can control 16 PWM outputs to light LEDs or with proper switching FETs, control motors.
It can control up to 16 servos - that is what the 16 3-pin servo connectors are for.
You connect it to your UNO (not the best board for the purpose - a Nano is more appropriate) by the two I²C pins and using the corresponding library, set the timing for each of the servos. The UNO/ Nano does not have to do anything else; it can even go to sleep if it needed to.
Very cool, fairly cheap and makes the job pretty simple for up to 16 servos.
Oh ok Thank You
You sound very young but I was not impressed with how you controlled the servo in your video
- an Arduino pin can only supply a limited amount of current
- taking too much current from a pin may damage the Arduino
- the battery used cannot supply enough current to run a Uno and a servo for very long
- MalwareBytes says that the site you to linked to is a phishing risk
In what way do you want to control 4 servos ? What will control their positions ?
Yes, I am really young I am 10 years old and interested in Robotics from 3 years
I've learned these both from you
Yes one time Arduino didn't get sufficient amount of power and servo did not run on battery.
This is not true I think so...
I didn't get you, can you please explain me
Arduino will control their positions
Then you have done quite well so far
If the robot has 4 servos then what do you want them to do ?
1 servo is for right hand
2nd servo is for left hand
3rd servo is for moving the body at the hip
4th servo is to move the head acts as a neck
How do you want to control their positions ?
Possibly with potentiometers
If not, then how ?
I want to control their positions through smartphone app (I know how to develop apps)
So, if the app can send a value between 0 and 180 do you know how to receive it, perhaps using Bluetooth ?
Yes, It send some value like ex
1801 for (180 degrees for servo1)
1002 for (100 degrees for servo2)
All these data is sent from our smartphone via bluetooth
I suggest that you change what you send to make it easier to deal with. If you were to send say 1,123 for 123 degrees on servo 1 then it would be easy to parse out the 123, convert it to a byte and write it to servo 1
To make things even easier send the values with a start and end marker so that it looks like <1,123> That way it is much easier to deal with on the Arduino
Take a look at Serial input basics - updated for examples of receiving and parsing data
Thank You So much for this Idea
Also, for your initial testing, you can use Serial instead of Bluetooth - the parsing code will be the same. Indeed, you can get started without any servos hooked up.
Take a look at Serial input basics - updated
If you send a string like <1,123> then it would be easy to parse the data and move servo 1 to angle 123
The UNO can control up to 12 servos. You control each servo the same way: Assign it a pin with servoName.attach(pin); Then call servoName.write(angle) to have the servo move to the specified angle (0 to 180).