Thanks to this video I found out how to attach my power supply, couldn't find it anywhere on how to do it properly! Thank you for such a clear tutorial!
Thank you so much for these codes and the video, I have been trying to move servos independently at the same time for two years now and the last 6 hours where mindbogglingly difficult to understand but your video and codes where exactly what I was looking for.
you are very welcome. I am pleased that it helped. Good luck and stay safe. We are all in difficult time. Please don't forget to subscribe. it helps my channel. Thanks.
Thank you so much for this tutorial. i requested this video few weeks back and now here it it. We really appreciate it 😊 looking forward for small bipedal tutorials from you sir
Thanks again Ahmad, great as always. I have 2 of these arriving today, previously i was bread-boarding them but even with just 8 servos it gets very messy, and i smoked 6 servos yesterday due to confusion caused by the wire-mess, this should tidy it up!
You are welcome. Yes. lots of wires. I put them on a cardboard . Perhaps you wired the power supply incorrectly. Connect the power first when there is not other wires. good luck.
Hello ... I wanted to thank you for posting this and other videos... they really helped me along. I can pretty much follow every step but I have run in a seemingly simple yet frustrating problem. I would like to run multiple loops at the same time to different angles. Now I do know that I can just state and they "seem" to run almost simultaneously : pwn.setPWM (0,0,120); // inital state motor 1 at 120 degrees pwn.setPWM (1,0,90); // inital state motor 2 at 90 degrees delay(1000); pwn.setPWM (0,0,170); // motor 1 moves plus 50 degrees to new state pwn.setPWM (1,0,10); // motor 2 moves minus 80 degrees to new state but I loved your loop script ... that lets me control the speed using a loop like this void loop() {
Hello, I found a solution / work around and as I have looked around many people had the same problem so this might help them too: >> if the first motor should go from 0-180 and at the SAME TIME a second motor should go from 0-90: (or any other value in the same direction) for( int angle =0; angle angle = 0-180 pwm.setPWM(1, 0, angleToPulse(pos2) ); // motor 2 (at pin 1) will go to "pos2" distance --> angle / 2 = 0-180 / 2 = 0-90 } Now it took me a while to figure out when the motor don't go in the same direction for example motor 1 goes from 0-180 (= +180) and motor 2 from 90-0 (=-90) so I came up with this "math" solution. pos2 = ("angle"-180) / -2 , this means at 0 --> (0-180)/-2 = 90 --> at 90 --> (90-180)/-2 = 45 --> and by 180 --> (180-180)/-2=0 and that WORKS !!!! I have now 5 servos running in one loop all with different angles and in both directions... HOPE this helps everyone with the same problem :D
I am glad you found the solution. Last night I saw your comment and wanted to respond but it need long response so I waited to respond at the right time.
Amazing, if only using 6 Servo motors with high torque still need this PWM driver? If true why don't we just use PWM pins on arduino, what's the difference? Looking forward to your feedback!
Hi, servo just need PWM signal. So it works with any device . Torque does not matter. By the way you are watching version 2 or V2. You must watch V1 so you know how to calibrate. Also there are V3,V4 and V5.
I have explained and mentioned how much current is needed. This video is version 2 or V2. I have v1 to v4 so you will find answer and I don’t remember the value.
Hi, Great video. Thank you very much. I have question now. Is it possible to control multiple 360 degree servo for continuous rotation with the PCA9685 module???
Hello and welcome. continuous or 350 servo is not real practical servo. you better use stepper motor. here are my videos on continuous servo th-cam.com/users/robojaxTVsearch?query=360
Great videos! How can this be modified to use a switch or pushbutton to sekect and actuate one of the 16 servos only? I would like to use the servos to control model railroad turnouts. Thank you.
Thanks for the detailed video. Do you know the max current I can draw from one channel? I am planning on connecting 6 servos that'll need around 1 amp draw each.
Hi, I'm really appreciating your patient instructions on these videos. I have a question about using the PCA9685, it seems that assumes the use of Arduino pins A4 and A5 (or the dedicated SCL and SDA pins), but I'm using an ESP32 and I'm not sure how to modify the sketch to designate the pins I want to use for i2c communication, and for that matter how to initialize the pins on the ESP32 for that designated use? Is that something you can help with?
I'm one of the oldest viewers of your channel...i appreciate your work in educating people on TH-cam...I'm a student,i learn IOT truly based on your channel!! Can you make a video regarding "CONTROLLING SERVO WITH NODE MCU(ESP8266) with pca9685 servo controller.. please provide code for controlling with the android phone... Thanks in advance 😘
I am glad you found my tutorials useful. I am pleased hearing that you learn from it. I have some other IoT project coming soon and will post videos on Servo and Motor using ESP8266 and ESP32 soon.
Nice video. I have a query, I bought Servo Click module from mikroE. It has same PCA9685 chip. Do you have any idea how to know about its I2C address? I want to interface this servo click module with Arduino Mega via Mega shield.
Thanks for this video. I'd like to control 16 servos individually for model railroad turnouts using 16 toggle switches so that the servos swing in different directions, thereby changing the alignment of the turnouts depending on the position of the toggles.
You are welcome. Here are my other Servo related videos where I have made them for different applications. th-cam.com/channels/kcBSig_Iu4ZnAIeCeG1TVg.htmlsearch?query=servo
if you know how to use HC05 and watch version 1 V1 of this video, I have explained every line and every part so you should be able to control it. But HC05 is extra. now ESP32 has builtin Bluetooth and using Arduino you can program is very easily. I have a lot of examples on ESP32 Bluetooth here is the search result th-cam.com/users/RobojaxTVsearch?query=esp32+bluetooth
Hi, can you please demonstrate how to control 12v geared motors with pca9685. Specifically I need the right way to power up the 12 v motors and control them using pca9685 module. I mean can I directly connect my motors to the battery and control them using pca9685 through pwm signal. Which module would you suggest to power up atleast 4 12v dc geared motors from my battery that can be fed with pwm signal from pca9685.
I have it on my list. But the problem is we will have 16 push buttons or type the the command to make it work. So I have been hesitant doing it. Perhaps I have to make my own app then it would be very customizable.
Can you use a trigger(switch) to control each servo? For example, I want servo 1 to move 20 - 100 degrees (programmed in the code) and it stays at 20 degrees until I push a button (trigger) then it moves to 100 degrees. Once the button is released it moves back to 20 degrees. I see a lot of videos about this servo control board, but none that show physical buttons (triggers) to operate the servo.
Hello, this is Version 2 video. I have V1 to V4 you may learn something to use for your purpose. I have tones of videos on servo and push buttons. Here is how to find Specific TH-cam Video in a channel bit.ly/findTH-camVideo
If I want to control 6 servos once ,should the pca board be given 5 volt only or if exceeded.above 7 volt it may damage rhe board or servo ??? I am using mg996r servo
does not matter. Pease watch the V1 (version 1)of this module as this video is V2. if your servo need 100V or 7V, connect separate voltage to your servo. Just use this board to control it, not power it up. if you don't skip and understand how it works, it is would be easy.
Hi sir, thats a helpful video. I want to ask, is it possible to make servo movements smoother like the program "sweep" in the example Arduino ide if using that module?
is the min and max value for all the servos in your setup the same? I think the answer is no. How are you accounting for/ how will you account for the difference?
if you get all servos for the same manufacturer they are more likely to be with the same specs. I will see if I can update the code or perhaps V5 of this video to add that feature.
asslamoalikom sir, your video was very helpful, thank you very much, but I've a problem so pls answer me. I am using PCA9685 with arduino uno to control 9 servos( 4 Mg995+5 Sg90) and powering the servos with an external power of 5volt 2 Am but the problem is that whenever i connect mg995, altogether, with Pca9685 they work perfectly, but whenever i try to connect more servos (sg90) with it, they either get damaged or they dont work, why is that so,i've connected all the wires correctly with correct power supply and coding but the servos dont work, why??? pls answer me, i am waiting
Thanks for the excellent tutorial! I would like to use 5 of the high torque servos (MG996R) for a project of mine. Do you think the PCA9685 is a good choice or would you recommend a different module? What would you recommend as an external power source for this setup? Looking forward to your feedback!
Just add delay in the loop like delay(50) which adds 50 milliseconds delay. Play with the number. The larger the number the slower the speed of servo motor.
there are series of videos. This is V2. you can have a look at V1, and V3, V4. link is in description or search my channel. if you don't know how to search Find Specific TH-cam Video in a channel bit.ly/findTH-camVideo
can i ask something plz can we put 6v as an externtal power cause my metak gear sero works with 6v and can i program 35KG metal gear motor with this pca? by the way great video
Nice! I have two of these modules, yet if I use the power terminal blocks they don't seem to provide any current at all. When I instead connect the power directly from my batteries to the V+ pin, the servo does move but my batteries get REALLY warm and start producing a burnt smell, which is obviously a bad sign. Do you have any idea what is going wrong there? I have this problem with both of the modules, so it doesn't appear to be a manufacturing mistake in one of them...
Hello, I don't know about your battery. But I mentioned it in V1, V2, V3 and V4 of these series videos that you can should power it only if your servo voltage is exactly the same as your battery because voltage is not changed if you connected to the board. it is just a wire.
@@robojax thanks! I'm using a buck converter to output 5V, and I'm now actually suspecting that either that buck converter is the problem, my batteries are already fried internally, or both, since I also have this problem when I just power a DC motor without this board. Thanks for the response anyway!
Hi Robojax. Thank you for this great Video. i would like to control several servos independently with one switch each. do you have a code for me? And a wire-plan?
Is it possible to move two servos to different angles simultaneously with this module? I'm setting up an important project, but I'm having a hard time doing it.
Yes. I just watched the video making sure I have explained how to control servo with this and for sure I have explained it fully. Please watch the code section over and over again so you know how it work and modify the code. good luck.
In the current issue of MRH 2020-02 - February 2020, Model Railroad Hobbyist magazine, there is an article using servos. Would it be possible to do the same thing with the arduino and a pca9685? I have 16 servos on my layout to control and a PCA9685 would be ideal, but would like to be able to set them up while intalled on the layout, like the article describes. This is by far the best channel yet that i have found on this stuff and thank you for your time, Bob
Hi, You are welcome. I have no access to the article. I just visited the magazine's website but March issue it not free. I have 4 video versions for this module and have over 10 more videos on servo.
If you connect single LED with resistor in each output, yes it will work and it you can dim it with this library. But you would have to change the pulse width. This is Video V2. You have to watch V1 of this video to learn how. The link to V1 is in the description or search for it.
hi Mr shamshiri...thanks for the informative tutorial i want to know that how to control a servo motor with arduino using rs232 communication...can you help me in that plz?
Assalamu alaikum Salman,, You are welcome. this module is using I2C communication so either you have to get a library or hardware that converts RS232 protocol to I2C. It needs separate video and because this is too specific, I won't make such video.
I have tried like your tutorial but i am not getting the output, all motors are malfunctioning. What is the solution. And i have used 5.6volt 10 amps SMPS for power supply
I can't get this to work, it's so simple to connect i don't understand it not working. I checked all the servos with the tester, they run when i use normal servo.attach code, but not with the Adafruit library. I tested the servo output pins and they are all under 1 volt, why would that be? I have tried with Enable to ground and with Enable disconnected (recommended elsewhere) but no joy.
Hi great video I am new to all this I want to Control five servos but I need to be able to move them with a Remote control could you help me with that please
Hi, here are my videos where you learn how to use IR remote with Arduino th-cam.com/users/robojaxTVsearch?query=remote watch them, learn and use it for the PCA9695 good luck.
selam aleykum brother. First of all I want to say that your videos are top notch. and i would like to apologize in advance for my bad english. but anyway i have a question for you. If I understand correctly then it is possible to power the servo driver and the arduino via the vin pin with the same power source. Since I have no way of operating the arduino nano with the USB connection, I would like to operate everything with a 6v or 9v battery. How would I have to connect the whole thing together so that everything works.
walaikum salaam, yes you can connect the same voltage to Nano and servo. But the servo motor voltage rating must match that of Arduino Nano. what do you mean how? if motor and Nano voltage is the same, then simply connect the board + and _ to the battery and the servo motor power and GND pins to the same battery. So simply check if the servo can operate with 6V or 9V. if not, then you can connect them. for example if servo is 5V and you got 9V, then you need a step down converter to convert the voltage form 9V or 6V to 5V suitable for servo motor.
Hi Sir, I have one question I have servo the same as shown in your video. the problem with it is it has jitter. is there a way we can stop jitter by using the library generally I use detach() but Adafruit has no function od detach() is there any way to stop jittering.
hi, jittering most probably is due to malfunction of the servo. to understand if this is caused by the library, use the basic servo library and connect ONE servo directly to Arduino and test it.
@@robojax can you redefine the code for 16 servos with smoother movement at same time same which we can get from servo sweep library example code. It will be great help.
Please watch V1 of this video. the link is in the description. If you want to customize it, then watch the code section carefully and you will know how it work. good luck.
@@robojax Thanks very much for the very quick reply. I have watched all the videos and learnt loads. I can now control angles and speeds perfectly. I have set up several inputs which I want to control individual servos to move to a set position. I have a working sketch for the inputs and a working sketch for the servos but I cant get them to run together. Any chance you can point me in the right direction ?? Thanks Eddy
yes. that's why I made this video to show you. just change the speed for specific servo. Most people don't watch the video and akd don't learn. if you have a project or just want to learn, please watch the V1 of this video and then V3 and V4. you will learn a lot. Good luck.
Up to 1MHZ as shown in the datasheet cdn-shop.adafruit.com/datasheets/PCA9685.pdf but when it comes to servo, it is determined by servo motor which is very very slow.
Hello,, you are watching wrong video. this is Version 2 or V2. the video is has 4 versions. Check the right version in the description. There is Wifi version.
this will need full new code to be rewritten. You will learn how to connect 2 or more potentiometer from this video th-cam.com/video/_uz7YcOzvjU/w-d-xo.html and then watch V1 of PCA9685 to see how we send values to each servos and the values you get from pots should be mapped to the values need for each servo. it should work. If you don't watch both videos and try to understand it, it will not work. I have not left anything out. Good luck.
Xin hỏi vì sao khi tôi cắm cáp usb kết hợp với nguồn 5v vào arduino nano thì servo hoạt động tốt, nhưng khi rút cáp usb và chỉ cắm nguồn 5v thì servo hoạt động không ổn định
@@robojax tôi đã cắm GND giống như video của bạn, nhưng cắm nguồn vào chân Vin, theo video của bạn là cắm nguồn bên ngoài vào chân VCC, như vậy có đúng không
Quick question. I ran I2C addressing.ino and get the address of my PCA9685 is I2C device found at address 0x03. Do I put 0x03 in() ? Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
I love your videos!! I was just curious how you would go about installing a push button to go one direction with PCA9685. I tried reversing the angle from 0 to 180 to 180 to 0 but did not work. I'd greatly appreciate your input. Thank you.
I am glad you found them useful. if you wan to learn simple servo , here is the video th-cam.com/video/7woqNH_qby4/w-d-xo.html but in V3 video of this I used single push button th-cam.com/video/6P21wG7N6t4/w-d-xo.html so you can learn from the simple servo and implement it here. Other than it would need separate video to explain.
This is Version 2 (V2) of the series. please see V1 to V4. this speed is the maximum, Simply add delay between each step to slow it down. Please subscribe. I appreciate it and helps my channel grow. Thank you
C:\Users\Predator\Documents\Arduino\libraries\Adafruit-PWM-Servo-Driver-Library-master/Adafruit_PWMServoDriver.h:26:10: fatal error: Adafruit_I2CDevice.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~~~~~ compilation terminated. exit status 1 Error compiling for board Arduino Mega or Mega 2560.
Sorry when you post a file address or a link TH-cam is treating it as spam and I just saw it. Your error is dues lack of library. Install library and the issue is resolved.
what do you mean by "if you don't use it"? we use it drive multiple servo. Arduino can't do it itself. if you add the current from each servo, the total would be huge and Arduino board can't handle it.
You are welcome. I did not include the amount of current because each servo will consume current at different rate. the small servos will need 50mA to 150mA and multiply it to 16. I am using a power supply.
Hello friends!! Greetings from Chile, I have 3 PCA 9685,connected,the first moves servos without problems, but the second and third do not move the servos, they turn on with their red light , it will be a sketch error, I want to move 32 servos to different positions, this is the sketch test: #include #include Adafruit_PWMServoDriver servos1 = Adafruit_PWMServoDriver(0x40); Adafruit_PWMServoDriver servos2 = Adafruit_PWMServoDriver(0x41); Adafruit_PWMServoDriver servos3 = Adafruit_PWMServoDriver(0x42); unsigned int pos0=125; // ancho de pulso en cuentas para pocicion 0° unsigned int pos180=575; // ancho de pulso en cuentas para la pocicion 180° void setup() { servos1.begin(); servos2.begin(); servos3.begin(); servos1.setPWMFreq(50); servos2.setPWMFreq(50); servos3.setPWMFreq(50);//frecuecia PWM de 50Hz o T=16,66ms } void setServo(uint8_t n_servo, int angulo) { int duty; duty=map(angulo,0,180,pos0, pos180); servos1.setPWM(n_servo, 0, duty); servos2.setPWM(n_servo, 0, duty); servos3.setPWM(n_servo, 0, duty); } void loop() {
@@robojax Hi, I appreciate your answer. It doesn't make any mistakes, just the first board with x40 direction, move the servo smoothly, the other two with x41 and x42 directions with the welded pins do not move the servos, turn on all 3 with the red light, maybe it's a mistake in my sketch, but you tell me that it's okay, my sketch publishes it in the previous question for you to see. Thanks a lot
There are like 30 videos on this board from 3 to 4 years ago, none since, because they do not work. I have never in 2 years got one of these boards to do anything.
This Version 2 or V2. May be start with v1 and do NOT skip. I have not said anything extra and if you don’t follow and fully watch, this is what happens . Over 50 thousand people have used this project and code has been download. So please watch one last time but fully without skipping. Good luck
where is the problem? if you are getting error on Arduino IDE, post the error . This not enough. the V1 of this video have been viewed over 100,000 times and 1000s of people are have used it . You must be skipping the video. Have patience, watch it fully without skipping as I have not said anything irrelevant in the video.
@@robojax hi! first i'm from México city, i have a question, My project is a robot hand, i use 8 servos, Arduino uno and a pca9685, can i use ay they dame time the Hc-sr04 ti activate My robot hand?
Thanks to this video I found out how to attach my power supply, couldn't find it anywhere on how to do it properly! Thank you for such a clear tutorial!
this is a great video for beginner like me. Thank you so much sir.
You are most welcome
Iam from India, just watched your video, you are awesome 👌
Just watch your V1 previously and this V2 is cool! thank you for sharing
Glad you like them!
Thank you so much for these codes and the video, I have been trying to move servos independently at the same time for two years now and the last 6 hours where mindbogglingly difficult to understand but your video and codes where exactly what I was looking for.
you are very welcome. I am pleased that it helped. Good luck and stay safe. We are all in difficult time. Please don't forget to subscribe. it helps my channel. Thanks.
Thank you so much for this tutorial. i requested this video few weeks back and now here it it. We really appreciate it 😊 looking forward for small bipedal tutorials from you sir
You are welcome. I am glad it is useful to you.
Thanks again Ahmad, great as always. I have 2 of these arriving today, previously i was bread-boarding them but even with just 8 servos it gets very messy, and i smoked 6 servos yesterday due to confusion caused by the wire-mess, this should tidy it up!
You are welcome. Yes. lots of wires. I put them on a cardboard . Perhaps you wired the power supply incorrectly. Connect the power first when there is not other wires. good luck.
Excellent i really enjoyed this video
Glad you enjoyed it
Hello ... I wanted to thank you for posting this and other videos... they really helped me along. I can pretty much follow every step but I have run in a seemingly simple yet frustrating problem.
I would like to run multiple loops at the same time to different angles. Now I do know that I can just state and they "seem" to run almost simultaneously :
pwn.setPWM (0,0,120); // inital state motor 1 at 120 degrees
pwn.setPWM (1,0,90); // inital state motor 2 at 90 degrees
delay(1000);
pwn.setPWM (0,0,170);
// motor 1 moves plus 50 degrees to new state
pwn.setPWM (1,0,10); // motor 2 moves minus 80 degrees to new state
but I loved your loop script ... that lets me control the speed using a loop like this
void loop()
{
for( int angle =0; angle
Hello, I found a solution / work around and as I have looked around many people had the same problem so this might help them too:
>> if the first motor should go from 0-180 and at the SAME TIME a second motor should go from 0-90:
(or any other value in the same direction)
for( int angle =0; angle angle = 0-180
pwm.setPWM(1, 0, angleToPulse(pos2) );
// motor 2 (at pin 1) will go to "pos2" distance --> angle / 2 = 0-180 / 2 = 0-90
}
Now it took me a while to figure out when the motor don't go in the same direction for example motor 1 goes from 0-180 (= +180) and motor 2 from 90-0 (=-90)
so I came up with this "math" solution. pos2 = ("angle"-180) / -2 , this means at 0 --> (0-180)/-2 = 90 --> at 90 --> (90-180)/-2 = 45 --> and by 180 --> (180-180)/-2=0
and that WORKS !!!!
I have now 5 servos running in one loop all with different angles and in both directions... HOPE this helps everyone with the same problem :D
I am glad you found the solution. Last night I saw your comment and wanted to respond but it need long response so I waited to respond at the right time.
@@jeanmarcvanrijswick7633 hi thanks for this can you please provide the full code please from beginning. I am facing the same issue.
Amazing, if only using 6 Servo motors with high torque still need this PWM driver? If true why don't we just use PWM pins on arduino, what's the difference? Looking forward to your feedback!
Hi, servo just need PWM signal. So it works with any device . Torque does not matter. By the way you are watching version 2 or V2. You must watch V1 so you know how to calibrate. Also there are V3,V4 and V5.
Great video sir.... Question...How much current do we need to supply to power 16 sg90 servo.... And how much do we need to power 16 Mg996 servo motor
I have explained and mentioned how much current is needed. This video is version 2 or V2. I have v1 to v4 so you will find answer and I don’t remember the value.
Hi, Great video. Thank you very much.
I have question now. Is it possible to control multiple 360 degree servo for continuous rotation with the PCA9685 module???
Hello and welcome. continuous or 350 servo is not real practical servo. you better use stepper motor. here are my videos on continuous servo th-cam.com/users/robojaxTVsearch?query=360
Great videos! How can this be modified to use a switch or pushbutton to sekect and actuate one of the 16 servos only? I would like to use the servos to control model railroad turnouts. Thank you.
Hi, I have tones of videos on push butto with serveros. here is one th-cam.com/video/J_kbyAY1rLM/w-d-xo.html but you can search and learn from them.
Thanks for the detailed video. Do you know the max current I can draw from one channel? I am planning on connecting 6 servos that'll need around 1 amp draw each.
This is the code I was asking to you thank you so much to you.
You are welcome.
Hi, I'm really appreciating your patient instructions on these videos. I have a question about using the PCA9685, it seems that assumes the use of Arduino pins A4 and A5 (or the dedicated SCL and SDA pins), but I'm using an ESP32 and I'm not sure how to modify the sketch to designate the pins I want to use for i2c communication, and for that matter how to initialize the pins on the ESP32 for that designated use? Is that something you can help with?
This is version 1 or V2 and I have got 3 more video’s including esp32. Please see links in description
I'm one of the oldest viewers of your channel...i appreciate your work in educating people on TH-cam...I'm a student,i learn IOT truly based on your channel!!
Can you make a video regarding "CONTROLLING SERVO WITH NODE MCU(ESP8266) with pca9685 servo controller.. please provide code for controlling with the android phone...
Thanks in advance 😘
I am glad you found my tutorials useful. I am pleased hearing that you learn from it. I have some other IoT project coming soon and will post videos on Servo and Motor using ESP8266 and ESP32 soon.
@@robojax I'd love to see that vidoe as I cannot get the NodeMCU CH340g to work with the PCA9685 at all!
Is it always necessary to start from a known position, it can you just send it a new angle with this code?
Nice video. I have a query, I bought Servo Click module from mikroE. It has same PCA9685 chip. Do you have any idea how to know about its I2C address? I want to interface this servo click module with Arduino Mega via Mega shield.
Hello, use I2C address scanner from Robojax.com
Hey robojax would it be suitable to make pwm economizer to reduce relay coil consumption? Is it noisy?
Thanks for this video. I'd like to control 16 servos individually for model railroad turnouts using 16 toggle switches so that the servos swing in different directions, thereby changing the alignment of the turnouts depending on the position of the toggles.
You are welcome. Here are my other Servo related videos where I have made them for different applications. th-cam.com/channels/kcBSig_Iu4ZnAIeCeG1TVg.htmlsearch?query=servo
Thank you so much . This video is exccellent!!!!
Dear sir, can we control these servos with hc05 Bluetooth module using pca9695. if yes please help me into this. thanks in advance.
if you know how to use HC05 and watch version 1 V1 of this video, I have explained every line and every part so you should be able to control it. But HC05 is extra. now ESP32 has builtin Bluetooth and using Arduino you can program is very easily. I have a lot of examples on ESP32 Bluetooth here is the search result th-cam.com/users/RobojaxTVsearch?query=esp32+bluetooth
Great video thanks for tutorial!
Hi, can you please demonstrate how to control 12v geared motors with pca9685. Specifically I need the right way to power up the 12 v motors and control them using pca9685 module.
I mean can I directly connect my motors to the battery and control them using pca9685 through pwm signal. Which module would you suggest to power up atleast 4 12v dc geared motors from my battery that can be fed with pwm signal from pca9685.
Hi, for each motor you will need driver like L298N or other rated driver. Then use this
Can you make a video on how to control Servo from pca9685 via Bluetooth?
I have it on my list. But the problem is we will have 16 push buttons or type the the command to make it work. So I have been hesitant doing it. Perhaps I have to make my own app then it would be very customizable.
@@robojax yeah that what I wanted I'll be waiting for you to upload it Thanks
Can you use a trigger(switch) to control each servo? For example, I want servo 1 to move 20 - 100 degrees (programmed in the code) and it stays at 20 degrees until I push a button (trigger) then it moves to 100 degrees. Once the button is released it moves back to 20 degrees. I see a lot of videos about this servo control board, but none that show physical buttons (triggers) to operate the servo.
Hello, this is Version 2 video. I have V1 to V4 you may learn something to use for your purpose. I have tones of videos on servo and push buttons. Here is how to find Specific TH-cam Video in a channel bit.ly/findTH-camVideo
Absolutely great video, loved it. Just have one quick question. Does it make any difference if my servos are digital?
Thank you. Not at all. I believe in on of the videos (V1, V2, V3 or V4) I had a digital servo connected.
When running 16 servos simultaneously how do you code for the different Min and Max values?
Do you mean different min and max that for all servos or for each servo? I believe I have provided that.
If I want to control 6 servos once ,should the pca board be given 5 volt only or if exceeded.above 7 volt it may damage rhe board or servo ??? I am using mg996r servo
does not matter. Pease watch the V1 (version 1)of this module as this video is V2. if your servo need 100V or 7V, connect separate voltage to your servo. Just use this board to control it, not power it up. if you don't skip and understand how it works, it is would be easy.
I have concerns about powering 14 very large (65kg of torque) servo motors. soul i just use separate source of power and use only pwm line for them?
Yes indeed, this video is. Station 2 or v2 but there Pete up to 4 versions if you want I see different ways this model is used.
Why is the frequency set to 60Hz? the data sheet of the SG90 states cycle of 20ms, which means 50Hz.
Hi sir, thats a helpful video. I want to ask, is it possible to make servo movements smoother like the program "sweep" in the example Arduino ide if using that module?
Hello, yes you can . please watch V1 and other versions. I've given enough examples.
is the min and max value for all the servos in your setup the same? I think the answer is no. How are you accounting for/ how will you account for the difference?
if you get all servos for the same manufacturer they are more likely to be with the same specs. I will see if I can update the code or perhaps V5 of this video to add that feature.
asslamoalikom sir, your video was very helpful, thank you very much, but I've a problem so pls answer me. I am using PCA9685 with arduino uno to control 9 servos( 4 Mg995+5 Sg90) and powering the servos with an external power of 5volt 2 Am but the problem is that whenever i connect mg995, altogether, with Pca9685 they work perfectly, but whenever i try to connect more servos (sg90) with it, they either get damaged or they dont work, why is that so,i've connected all the wires correctly with correct power supply and coding but the servos dont work, why???
pls answer me, i am waiting
Walaikum salaam, the only reason I would say is the incorrect wiring . Codes can’t damage
Thanks for the excellent tutorial! I would like to use 5 of the high torque servos (MG996R) for a project of mine. Do you think the PCA9685 is a good choice or would you recommend a different module? What would you recommend as an external power source for this setup? Looking forward to your feedback!
You are welcome. Yes it will work . Servos need signal. In one of my demos I don’t remember which v1 to v4 I’ve used one of the mentioned servo.
Can you help me with a problem? What code do i need to drive the servo motors slower in their rotation.
Just add delay in the loop like delay(50) which adds 50 milliseconds delay. Play with the number. The larger the number the slower the speed of servo motor.
Я говорю на другом языке, но я понял каждое его слово.
А самое главное - схема как-то сработала :D
Я рад, что это сработало для вас. Я использовал Google для перевода этого текста, но я могу читать и писать по-русски. Забыл говорить.
Thanks for the tutorial, how to setting the speed each servo?
there are series of videos. This is V2. you can have a look at V1, and V3, V4. link is in description or search my channel. if you don't know how to search Find Specific TH-cam Video in a channel bit.ly/findTH-camVideo
Hello, when i connect 6 servos to mine it work fine but if i add more they start shaking do you have any advice.
Hello, it seems have power issue. make sure you have external separate power supply.
Robojax what type of power source do you use
@@folarindavies I use a 9V block
can i ask something plz can we put 6v as an externtal power cause my metak gear sero works with 6v and can i program 35KG metal gear motor with this pca? by the way great video
The input voltage should match your servo motor voltage. if your servo works with 6V use that if it needs 12V , then connect 12V.
@@robojax great thanks a lot but the 35kg servo can be programed with arduino and pca?
Is it possible to control servos and motors on the same board at the same time?
this for servo motors and NOT DC motors.
@@robojax I relised that after posting. Not sure why i thought they worked with DC motors too. Thank you for the reply.
Nice! I have two of these modules, yet if I use the power terminal blocks they don't seem to provide any current at all. When I instead connect the power directly from my batteries to the V+ pin, the servo does move but my batteries get REALLY warm and start producing a burnt smell, which is obviously a bad sign. Do you have any idea what is going wrong there? I have this problem with both of the modules, so it doesn't appear to be a manufacturing mistake in one of them...
Hello,
I don't know about your battery. But I mentioned it in V1, V2, V3 and V4 of these series videos that you can should power it only if your servo voltage is exactly the same as your battery because voltage is not changed if you connected to the board. it is just a wire.
@@robojax thanks! I'm using a buck converter to output 5V, and I'm now actually suspecting that either that buck converter is the problem, my batteries are already fried internally, or both, since I also have this problem when I just power a DC motor without this board. Thanks for the response anyway!
Hi Robojax. Thank you for this great Video.
i would like to control several servos independently with one switch each. do you have a code for me? And a wire-plan?
Hi, Please watch version V1 to V4 and if you can't find what you are looking for then I can't help.
Is it possible to move two servos to different angles simultaneously with this module? I'm setting up an important project, but I'm having a hard time doing it.
Yes. I just watched the video making sure I have explained how to control servo with this and for sure I have explained it fully. Please watch the code section over and over again so you know how it work and modify the code. good luck.
In the current issue of MRH 2020-02 - February 2020, Model Railroad Hobbyist magazine, there is an article using servos. Would it be possible to do the same thing with the arduino and a pca9685? I have 16 servos on my layout to control and a PCA9685 would be ideal, but would like to be able to set them up while intalled on the layout, like the article describes. This is by far the best channel yet that i have found on this stuff and thank you for your time, Bob
Hi, You are welcome. I have no access to the article. I just visited the magazine's website but March issue it not free. I have 4 video versions for this module and have over 10 more videos on servo.
@@robojax The issues are free, feb and mar have the info. Either way thanks.
I have these PCA 9685 I bought from you and wonder if its possible to use it to run LED lights. If its , what library would work?
If you connect single LED with resistor in each output, yes it will work and it you can dim it with this library. But you would have to change the pulse width. This is Video V2. You have to watch V1 of this video to learn how. The link to V1 is in the description or search for it.
hi Mr shamshiri...thanks for the informative tutorial i want to know that how to control a servo motor with arduino using rs232 communication...can you help me in that plz?
Assalamu alaikum Salman,, You are welcome. this module is using I2C communication so either you have to get a library or hardware that converts RS232 protocol to I2C. It needs separate video and because this is too specific, I won't make such video.
@@robojax walaikum salam...thanks for your response
I always suspected you can use PCA 9685 this way. This video confirms
Good to know. Thanks.
I have tried like your tutorial but i am not getting the output, all motors are malfunctioning. What is the solution. And i have used 5.6volt 10 amps SMPS for power supply
have you noticed this Version 2 or V2? start with V1.
I can't get this to work, it's so simple to connect i don't understand it not working. I checked all the servos with the tester, they run when i use normal servo.attach code, but not with the Adafruit library. I tested the servo output pins and they are all under 1 volt, why would that be? I have tried with Enable to ground and with Enable disconnected (recommended elsewhere) but no joy.
When the module outputs signal, it would be 5V PWM . this means the chip is not getting signal from Arduino or bad wiring.
@@robojax So i won't see 5V until the sigal is active? The wirig is fine, simple conections all tested. Thanks Ahmad.
Buen control de varios servos.
This is just version 2 v2, there are v3, v4 and v1. Check them out.
Hi great video I am new to all this I want to Control five servos but I need to be able to move them with a Remote control could you help me with that please
Hi, here are my videos where you learn how to use IR remote with Arduino th-cam.com/users/robojaxTVsearch?query=remote watch them, learn and use it for the PCA9695 good luck.
selam aleykum brother.
First of all I want to say that your videos are top notch. and i would like to apologize in advance for my bad english. but anyway i have a question for you. If I understand correctly then it is possible to power the servo driver and the arduino via the vin pin with the same power source. Since I have no way of operating the arduino nano with the USB connection, I would like to operate everything with a 6v or 9v battery. How would I have to connect the whole thing together so that everything works.
walaikum salaam, yes you can connect the same voltage to Nano and servo. But the servo motor voltage rating must match that of Arduino Nano. what do you mean how? if motor and Nano voltage is the same, then simply connect the board + and _ to the battery and the servo motor power and GND pins to the same battery. So simply check if the servo can operate with 6V or 9V. if not, then you can connect them. for example if servo is 5V and you got 9V, then you need a step down converter to convert the voltage form 9V or 6V to 5V suitable for servo motor.
Thanks for the answer,
by board do you mean the servo shield?
Hi Sir, I have one question I have servo the same as shown in your video. the problem with it is it has jitter. is there a way we can stop jitter by using the library generally I use detach() but Adafruit has no function od detach() is there any way to stop jittering.
hi, jittering most probably is due to malfunction of the servo. to understand if this is caused by the library, use the basic servo library and connect ONE servo directly to Arduino and test it.
You are great inspiration
I am glad you like it.
@@robojax can you redefine the code for 16 servos with smoother movement at same time same which we can get from servo sweep library example code. It will be great help.
Please watch V1 of this video. the link is in the description. If you want to customize it, then watch the code section carefully and you will know how it work. good luck.
@@robojax ok but I watched everything
I got the code for smooth movement of servo with simultaneously movement for all 16 with hcpca library. Very fine n precise without any jitters.
How can the PC 9685 module be used with radio frequency modules???
Connect your receiver to Arduino, decocode the channels and the rest is staying the same.
Loved the videos. Is there a way of adjusting the servo speed ??
Yes. The current speed is maximum. Add delay to slow it down. I might have some code for that but forgot. check all 4 versions. this is V2
@@robojax Thanks very much for the very quick reply. I have watched all the videos and learnt loads.
I can now control angles and speeds perfectly.
I have set up several inputs which I want to control individual servos to move to a set position.
I have a working sketch for the inputs and a working sketch for the servos but I cant get them to run together.
Any chance you can point me in the right direction ??
Thanks Eddy
Thank you so much! Now I can start making a quad legged robot :D
You are welcome. Thank you for not skipping the ads and keep watching them. This will help me a lot.
Can you run DC motors and servos together on a single PCA9685 with Arduino mega 2560?
No you can't run it with this library. You would have to modify it to get result.
how to link gyro + PCA9685 on Same arduino nano
Sir, is it possible to run all 16 motors together but with different speed?
yes. that's why I made this video to show you. just change the speed for specific servo. Most people don't watch the video and akd don't learn. if you have a project or just want to learn, please watch the V1 of this video and then V3 and V4. you will learn a lot. Good luck.
how fast can I update all 16 servos with the PCA9685, assuming 400 kHz I2C on a 16 MHz Arduino? so far it seems a bit slow for my needs.
Up to 1MHZ as shown in the datasheet cdn-shop.adafruit.com/datasheets/PCA9685.pdf but when it comes to servo, it is determined by servo motor which is very very slow.
where can i download your code for esp32 using pca8685 controlled by smart phone
Hello,, you are watching wrong video. this is Version 2 or V2. the video is has 4 versions. Check the right version in the description. There is Wifi version.
Good job
thanks. Thank you for not skipping the ads and keep watching them. This will help me a lot.
if i am using a 5v power source how many amperes does it need to have?
it depends on the servo motors you are using. just measure the current for ONE and multiply by the number of motors you are using.
How to control 5 servo with 5 potentiometer in pca9685 with ard uno?
this will need full new code to be rewritten. You will learn how to connect 2 or more potentiometer from this video th-cam.com/video/_uz7YcOzvjU/w-d-xo.html and then watch V1 of PCA9685 to see how we send values to each servos and the values you get from pots should be mapped to the values need for each servo. it should work. If you don't watch both videos and try to understand it, it will not work. I have not left anything out. Good luck.
Good preview
Thank you.
Terima Kasih 😍😘😘
sama-sama.
Sir what is used to control it can u tell me plz
Hi, I can't tell you better than video. you are watching V2, you should watch V1 of this video The link is in the description of this video
hi, im running a setup with 5 servos instead of 16, but none of my servo motors are turning
Hi, this is video is version 2 or V2. Please start with video V1.
Xin hỏi vì sao khi tôi cắm cáp usb kết hợp với nguồn 5v vào arduino nano thì servo hoạt động tốt, nhưng khi rút cáp usb và chỉ cắm nguồn 5v thì servo hoạt động không ổn định
có lẽ bạn đã quên ghim GND để nó nhận xét giữa Arduino và PCA9685. Kiểm tra tất cả các dây.
@@robojax tôi đã cắm GND giống như video của bạn, nhưng cắm nguồn vào chân Vin, theo video của bạn là cắm nguồn bên ngoài vào chân VCC, như vậy có đúng không
For some reason this code makes it so my MG996R servos only rotate approximately 45 degrees- any idea why that is?
you have to watch the V1 of this video to calibrate it to your servo.
@@robojax Great- thank you for quick reply! Really appreciate your videos.
Quick question. I ran I2C addressing.ino and get the address of my PCA9685 is I2C device found at address 0x03. Do I put 0x03 in() ?
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
If the address is needed I should have shown it in the tutorial.
I love your videos!! I was just curious how you would go about installing a push button to go one direction with PCA9685. I tried reversing the angle from 0 to 180 to 180 to 0 but did not work. I'd greatly appreciate your input. Thank you.
I am glad you found them useful. if you wan to learn simple servo , here is the video th-cam.com/video/7woqNH_qby4/w-d-xo.html but in V3 video of this I used single push button th-cam.com/video/6P21wG7N6t4/w-d-xo.html so you can learn from the simple servo and implement it here. Other than it would need separate video to explain.
How to control the speed of the servo motor with PCA9685?
This is Version 2 (V2) of the series. please see V1 to V4. this speed is the maximum, Simply add delay between each step to slow it down. Please subscribe. I appreciate it and helps my channel grow. Thank you
Is there any problem using arduino mega?
C:\Users\Predator\Documents\Arduino\libraries\Adafruit-PWM-Servo-Driver-Library-master/Adafruit_PWMServoDriver.h:26:10: fatal error: Adafruit_I2CDevice.h: No such file or directory
#include
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Arduino Mega or Mega 2560.
When we use I2C it does not matter which arduino you use. See other versions of this from v1 yo v4 to learn from it.
Sorry when you post a file address or a link TH-cam is treating it as spam and I just saw it. Your error is dues lack of library. Install library and the issue is resolved.
What would happen if i don't use This servo driver?
what do you mean by "if you don't use it"? we use it drive multiple servo. Arduino can't do it itself. if you add the current from each servo, the total would be huge and Arduino board can't handle it.
How much power do 16 servos use? :)
What kind of battery are you using btw... Thank you so much for the video!
You are welcome. I did not include the amount of current because each servo will consume current at different rate. the small servos will need 50mA to 150mA and multiply it to 16. I am using a power supply.
@@robojax Thank you so much again :)
Hello friends!! Greetings from Chile, I have 3 PCA 9685,connected,the
first moves servos without problems, but the second and third do not move the servos,
they turn on with their red light , it will be a sketch error, I
want to move 32 servos to different positions, this is the sketch test:
#include
#include
Adafruit_PWMServoDriver servos1 = Adafruit_PWMServoDriver(0x40);
Adafruit_PWMServoDriver servos2 = Adafruit_PWMServoDriver(0x41);
Adafruit_PWMServoDriver servos3 = Adafruit_PWMServoDriver(0x42);
unsigned int pos0=125; // ancho de pulso en cuentas para pocicion 0°
unsigned int pos180=575; // ancho de pulso en cuentas para la pocicion 180°
void setup() {
servos1.begin();
servos2.begin();
servos3.begin();
servos1.setPWMFreq(50);
servos2.setPWMFreq(50);
servos3.setPWMFreq(50);//frecuecia PWM de 50Hz o T=16,66ms
}
void setServo(uint8_t n_servo, int angulo) {
int duty;
duty=map(angulo,0,180,pos0, pos180);
servos1.setPWM(n_servo, 0, duty);
servos2.setPWM(n_servo, 0, duty);
servos3.setPWM(n_servo, 0, duty);
}
void loop() {
setServo(0,0);
setServo(16,0);
setServo(15,0);
delay(2000);
setServo(0,30);
setServo(16,30);
setServo(15,50);
delay(2000);
}
what is the error you are getting? the code has been tested and is provided. just post the error.
@@robojax
Hi, I appreciate your answer. It doesn't make any mistakes, just the first board with x40 direction, move the servo smoothly, the other two with x41 and x42 directions with the welded pins do not move the servos, turn on all 3 with the red light, maybe it's a mistake in my sketch, but you tell me that it's okay, my sketch publishes it in the previous question for you to see. Thanks a lot
what is you name for patreon ?
thanks. I have no Patreon now. there is link to my PayPal donation link if you want to support me. The link is below each video in description.
Can u put this code in the description
I just checked and it is there. Even the link to the V1 is there.
There are like 30 videos on this board from 3 to 4 years ago, none since, because they do not work. I have never in 2 years got one of these boards to do anything.
This Version 2 or V2. May be start with v1 and do NOT skip. I have not said anything extra and if you don’t follow and fully watch, this is what happens . Over 50 thousand people have used this project and code has been download. So please watch one last time but fully without skipping. Good luck
Can you make a video on 16 channel servo control through wifi web server independently esp8266 or esp 32
Hi, I have on my list. Coming soon
Sir can u give me it's circuit diagram
Hello, you can use this free software to draw it fritzing.org/
I can't put it run
where is the problem? if you are getting error on Arduino IDE, post the error . This not enough. the V1 of this video have been viewed over 100,000 times and 1000s of people are have used it . You must be skipping the video. Have patience, watch it fully without skipping as I have not said anything irrelevant in the video.
@@robojax I found the mi mistake, now I have a cuestión, how I control the servo speed? It's my first arduino proyect
you simply add delya to slow it down. Remove delay will speed it up. Now it is at maximum speed.
@@robojax hi! first i'm from México city, i have a question, My project is a robot hand, i use 8 servos, Arduino uno and a pca9685, can i use ay they dame time the Hc-sr04 ti activate My robot hand?
Halo, bagaimana membuat robot seperti ini apakah ada codenya.
th-cam.com/video/acRA8vIaGdY/w-d-xo.html