This is the best video on this subject.. everybody else just uses the example and does not explain how to break it down and use it for your own project… subbed and like your teaching method
I see that you made this a while ago but I want you to know it's still of great value. I love being able to follow your coding and by producing the same results I'm finally figuring out how to best use the PCA9685 for my robot project.
I hope it is useful to you. this video is Version 1 (V1) but this series goes up to V5 and in each I have shown different tips, codes and tricks that might be useful to you. The inks to those videos should be in the description. good luck.
Thank You for the great tutorial. I just subscribed to your YT channel, I will be watching every one of your tutorials.. Please, keep feeding us your knowledge and expertise
Aloha RJ, I know this is video is awhile back and just watched it today 2024 and I have learned a lot! Thank you so much for sharing your video. I have donated to support you.
Many thanks dude! I was going to become desperate :D I wanted to build servo controled points for my model railroad and every tutorial I found was way to complex. Your explanation was easy and the bare minimum to understand the shit :D Again many many thanks. You saved my night sleep ;)
this the most detailed PCA9685 video out there, which also explains what each pin to beginners like me. thank you so much. 1. would it possible for you to make a video of how to control multiple servos at once rather than running one at a time using PCA9685? 2. how to mod this same servo for 360-degree rotation so we can control using PCA9685
You are welcome. I am glad you found it useful. 1-I have the request from so many people. I will make it when time permits 2-the 360 servo is totally different kind of servo. This module can't be used for that purpose. You may watch my videos on 360 servos here ruclips.net/user/robojaxTVsearch?query=360
Wow thank you so such for this video, I am new to the world of the Ardrunio and I am trying to build automatic blast gate control system for my wood shop. This video has helped me with the servo shield.
you are welcome. Few weeks back I published my Arduino course worth $200 on Udemy. Arduino Step by Step Course (over 100 lectures) Starts here robojax.com/L/?id=338
Thanks for the video. How do you turn more than 1 servo at the same time? Edit: Oops didn't see the video where you controlled more than 1 servo at the same time. Thanks, keep it up.
Thank you so much for this amazing video. What would you recommend one do if he wanted to connect 18 servos. Is there anyway to connect two of these boards together for the extra channels?
Thanks. you have question or needed custom code, this is Version 1 or V1, there are 4 more versions of this module. link is below this video or just search my channel . Cheers. and yes, your subscription is great help. Thanks
@@robojax I am having issues with the Hiletgo PCA9685 servo controller. I have checked everything with the multimeter, have the proper external power, checked the wiring, and checked each servo, so I believe the issues to be related to software. I have used both the HCPCA9685, PCA9685, and the Adafruit version, but neither seem to be working. Is there any that you suggest for this brand?
Thank you it was very useful! I still can't figure out how to reduce the speed of the rotation because the delay() function is not effecting it.. Can you help me out? Thank you very much!
Great video! A lot of details and well explained! So i will need 2 batteries in order for this to work, one for the UNO and one for the PCA9685 right? Both 5V. Thanks!
@@robojax So I need just 1 5V battery and then i connect the battery to which one of the boards? I think i misunderstood... Thanks for the asnwer and for the help! :)
@@robojax I watched it twice man, it's not you it's me :) i get confused when you talk about 2 batteries for 2 boards. Being a beginner in hardware AND english, this is not easy for me. Hope i will find an answer! Thanks for all the learning material! :)
Papa Robojax, you can add the _adafruit pwn servo driver lib_ through the *Arduino IDE.* Within Arduino IDE add .zip libraries to your included libraries by going to the menu bar: _Sketch/Include Library/Add .ZIP Library..._ and then navigating to the folder you have the _.zip driver lib._ Makes things a bit easier, when you just drop the .zip file on the desktop, and add it thru the IDE, instead of digging through the IDE folders manually.
thank you mama 1085243, I prefer putting it manually becuase it would be in the same folder as the "arduino" and in the future you can copy all together. but if you use the menu, it will go under the "my document" which I don't prefer. I have mentioned that from time to included it using the menu like this video ruclips.net/video/7RQ8QoJWhpY/видео.html or this ruclips.net/video/L6ekl2ABcuY/видео.html
This is a great tutorial! Thank you for being so thorough! Can you do a video tutorial on powering multiple pwm boards with one power source? Using your 4 board example, how to power 64 servos, 4 pwm boards with one power source.
Sir, I have watched this video several times now and it really helps. I'm using a nano connected to the pca9685, is there any way of smoothing out the movement of the servo arm? Thank you.
Hi, I have watched the other servo videos. Nothing shows how to control the pca board with a voice module. I thought If I removed the code for the push button switch (v3 video) I could code it using the OE Pin. Or am I looking at the problem all wrong. Confused myself.
Hi, of course I don't have any video related to voice control. But I have shown how to control with a signal or push button. just use the method and use the singal from voice module.
it depends on the type of servo motor and how many you use. measure the current of one servo motor when load is connected to servo motor for example you measured the current to be 0.5A and you wan to use 10 servo then 0.5x10=5A to be save get a power supply with at least 6A or 7A.
Hi, Thanks for your great video . Im just wondering whats the maximum number of servos can you control using multiple of this board (PCA9685)? for example can I control 600 servos? Thanks.
Hey very good video, but I have a question. Do you know why the board has a capacitor? Or could you explain for which situation I would need one? My board came without one.
when servos STARTs and stop this sudden start causes the power supply voltage to drop a little and if you have capacitor connected to the power supply which is already charged, it resists the voltage drop by supplying power to the board. .
I was wondering... do you need to use any other component to protect the arduino from the "blowback" voltage of the servos? Is this driver already protecting the arduino? Thanks
Thank you for your explanation. I am curious as to why you used "delay" instead of "millis" as this only allows one servo sequentially. Is the power enough for multiple servo operations??
millis is number of milliseconds since the program started. I just needed the program to give certain time delay to show movement and then start another one. The servos I used were without load and it was enough. But if you make all servos do something, then the load will increase.
Having a peculiar problem with my recently bought PCA9685 (same as the one you demo with low power mosfet). WITHOUT connecting to any external controller yet, i plug ext power 4.8V (from fully charged 4 NiMH AAA batteries holder) to the green block. No servo connected yet. Tested with multimeter ON ALL the V+ ... only getting 1.7V and not 5V. Then using multitester.. tested on the MOSFET and capacitor, but got about 5V. Any reason why?
Hello, thanks for your help ! I just have one question: How could I combine the Arduino librairy of the PCA 9685 and the librairy StandardFirmata since my code is written in Python ?
Very interesting video, Robojax. I have an application with servos driving delicate mechanisms. After a shutdown, my servos (all of them as a matter of fact) jerk briefly when resuming power. The movement is brief, but its amplitude is enough to damage my system. Is there a way to overcome the phenomenon by tweaking your program ?
Thank you Marcel. Very interesting issue. Does this happen when powering up or does this happen also when you press the reset button Arduino? If you don't see the issue when you press reset, then add 2 second delay in the setup() just after setup so the motors don't get any power. let me know.
amazing video....very well explained !!I'll be chaining 20ish of these guys together.... however (correct me if i'm wrong ) i've heard you can't run Led's and servos at the same time on this board ( one or the other) ... as all channels share a common frequency...
this is Version 1 and I have 4 more videos on this. But to control servo I have tones of videos. Learn from those and implement it here. learn how to Search for a Particular video in a channel here ruclips.net/video/OhkUceBWcHs/видео.html
Hi, in this video, there is not network control involved. if you want o control more ways, please see V2, V3 and V4 of this module ruclips.net/user/robojaxTVsearch?query=pca9685
Do you have any idea on how could i supply the 5V to the PCA9685 board considering the fact that i need it to put it in a portable 3d printed robotic hand....? I hope you cand help me with this. Great video !
Hello (first hello or hi), measure the current for one servo while the servo is motor working and moving the load (under the load). then multiply the amount by the number of servo motors. Then get 5V power module.
I have two batteries each one is 7.4 V, should I connect one of them to the arduino and the other to the PCA? Also is using 3.7 V battery for PCA to control 12 motors enough or not?
For arduino the dc adapter input can accept up to 12V. For the PCA connect power exactly the same as your servo motors voltage. If servo is 9V then connect 9V for example.
Thank you for your videos! It's clear and useful! Good work! I'm working on a project with 27 servo, all works! I would like to run all the servo at the same time but with different speed and degrees (random sweep)... I've no solution for the moment with the Loop fonction "for"... Any ideas?
@@robojax Thanks for your reply! I saw all the videos, but I don't find easy solution for running all motors in random programmation (degrees and speed)...
Hi, thanks for the video. I need to know if there is any way to disable the current on a servo with this librar y after it makes a move. I am using 15 servos and they make a lot of noise and vibrate. I think this would be a way to eliminate it. Thank you
Hi, servos are independent. They just get PWM signal and other than that you can't have any other control. you can have delay between the pulse you send if you add it in the loop. other than that you can't do within Arduino. There should special servos where you could read the current and set the limit. But these servos are very simple.
@@robojax Thanks for your answer. My idea is to do something similar to the dettach function in the servo.h library and stop the servo from receiving voltage.
Im curious, how do you code it to where you can toggle the servo actions on and off? Like I have it running continuously but I don’t know how to make it start and stop when I want it to.
I have put it on the title. I use Microcontroller called Arduino. If you don't know Arduino, here is 2 minuets video from my Step By Step Arduino course ruclips.net/video/-6qSrDUA5a8/видео.html
Very nice! Now it’s clear to me how SERVOMIN/SERVOMAX works! Thanks a lot! One question; I am trying to control 9-10 servo’s individually through a 3x4 matrix numeric keypad. Will there be a way to [toggle] control of a servo state, e.g. press ‘1’ to get the servo to s designated angle then press ‘1’ again to get the servo back to angle zero? You advice would be much appreciated! In Arduino only situation, I could use the sketch to achieve his, e.g. case PRESSED: if key==‘1’ { digitalWrite (ledPin, !digitalRead (ledPin)); - - - I am looking for an equivalent code...
Robojax Thanks for your kind reply. I think, however, I already watched your video you recommended. In that video, you demonstrated two-button control of a servo with an Arduino board. But I need to control 8-9 servo’s so it would exceed Arduino’s PWM capacity. That’s why I am planning to use 16-ch PCA9685 based shield.
Amazing video, however my servo motors are not rotating. I'm using an arduino mega 2560 and the code uploads but nothing happens after. I have ordered an arduino uno in hopes it will work. I'm not sure why my mega 2560 isn't able to control it?
@@robojax Thank you for responding. I followed all the steps you took. The only difference is i'm using a mega 2560 and the adafruit library I downloaded is on 1.8.13 instead of yours which is on 1.8.0. For example you only have 2 #defines in your code but the one i downloaded has 5 #defines. Under #define SERVOMAX 600 it says #define USMIN 600
@@robojax I used robojax code and it still did not work, I also tried retyping it which didn't do anything. I also tried a different set of code but nothing happened. Im starting to think there is something wrong with my pca9685, I guess ill keep trying different things. Thanks again for your help!
HI. I would like to use servo motors on my model railway for points and level crossing gates, uncoupler Etc. but can you initiate each servo individually by a switch. So it would go in one direction by switch and stay there until I press the switch to return rather than by a timer. I was thinking of using on-off-on switches. also do you need to keep them plugged into the computer after the positions are set. If possible to do this could you tell me how to do it. I am not knowledgeable in electronics so it would have to be explained simply. Thanks
Hi, this video is version 1 there are 4 more videos and I have used many ways to control the servos. Please check them. Yes you can control with switches.
I got one of these devices today, I wired it all up but for some reason it burned up my servo, I tried 2 more but each one got damaged. I'm not risking another, any idea how this could have happened? I connected the data lines correctly and used an external power source of 5v so nothing was out of the ordinary. Any suggestions.
You might have connected the Positive and negative terminals in revers. Other than very rare but possible that servos are rated for less than 5V may be 3.3V.
you are welcome. This video is Version 1. I've got V2 with different code demonstration, V3 with 32 servo and V4 to control them over WiFi the link is under the description of the video.
@@robojax amazing I'm subscribing :D 1. can I use a raspberry pi to send signals instead? 2. Is there something that goes up down instead of rotating like those servo?
PCA9685 has registers that can communicate using I2C protocol. 1-you have to look at datasheet to know how to read and write using raspberry pi. 2-I am not sure if I understood it correctly, but if you want up and down, isn't that you just rotate to the left or right and it will go up and down? thank you for subscribing.
Hello, 1-measure the total current for your servos and connected a power supply accordingly. this I have connected a 5V power supply that could up to 60A but you don't need that. you need whatever you measure when the servos are running under the load. 2-You are watching Version 1 (V1), I have 3 more versions of videos of this module link is in description. Always check description I have it it for ESP32. Or search my channel for more cool projects. Here is how to find Specific RUclips Video in a channel bit.ly/findRUclipsVideo
@@robojax Thank you! For powering a couple of servos (not too much load), can I used like 4 C batteries, at least to start with? Maybe use something like a buck converter to increase current, if needed?
I have wired my arduino Uno R3 the same as you to the PCA9685. I get no power to the either boards but when I put power to the arduino both boards light up. I have also hooked my arduino Mega in the same way and the same happens.
Hi, perhaps you are connecting it incorrectly. Please watch it again or what other version of this module ruclips.net/channel/UCkcBSig_Iu4ZnAIeCeG1TVgsearch?query=pca9685
I’m working with an Arduino Uno R4 WiFi and a PCA9685 PWM driver module to control a servo motor. Although the Arduino IDE indicates that the code is running correctly and attempts to move the servo, the servo motor itself does not respond or move. This issue persists even though the code is properly uploaded and the Serial Monitor shows that the IDE is executing the code. Here’s what I’ve checked: I2C Connections: I have connected SDA and SCL from the PCA9685 to the corresponding SDA and SCL pins on the Arduino Uno R4 WiFi. I’m unsure if SDA and SCL should be connected to pins A4 and A5, respectively, but I’m using the dedicated SDA and SCL pins on the Uno R4 WiFi. I2C Device Detection: I used an I2C scanner code to detect devices on the bus, but nothing appears in the Serial Monitor. This suggests that the PCA9685 may not be detected on the I2C bus. Power Supply: I’m concerned about whether the PCA9685 and the servo motor are receiving sufficient power. Code Functionality: The code is designed to control the servo motor via the PCA9685 module. The code seems to be working as expected when run manually, but the servo motor does not move.
I'm following this, using a bench PSU to power via the central power inputs, but even just raising the PSU to 2 volts starts to feed 250mA current, if i head toward 5V the PSU maxes out at 2 amps. What could be wrong, i've triple-checked wiring etc ?
the amount of current depends on number of servo motors and types. some servo motors need more and some less. measure current of ONE servo motor while running and connected to the load or word it does. then multiply it to the number of servo motors. if you still get higher current, then either one or more servo motor is damaged or the servo motor has lower rated voltage.
@@robojax You too sir, i don't know how it is in Canada, but the live data from the UK is in complete disagreement with government policy, which has now killed over 40K old age pensioners in care homes. I am on the war path.
The minimum and maximum I found on my servos causes the rotation to be slightly more than 180 degrees, like around 195. Can I adjust the minimum or maximum so the rotation can be closer to 180? Will it matter that I'm not using absolute minimum or maximum?
Enjoyed your tutorial! Do you happen to have Arduino sample code, to use potentiometers, to control the servo's, that you can share? Using the same I2C setup, that is in the tutorial above?
Use a control variable to do that. You could use something like this: boolean running = false; // this is the control variable if(button == LOW){ // this is the way to start the loop with the click of the button if(running == false){ running = true; } } delay(200); while(running == true){ // this only triggers once you've pressed the button, because once you've done it, the running variable is going to be set as true. if(button == LOW){ running = false; // this is the way to stop the loop with the same button once it has started } put the loop here } what happens here is: the first time you click the button the loop will start and it will run continuously until you press the button again. Notice: this method does not stop the for() loop itself, it just keeps it from repeating. Ex: You press the button, the for loop starts to run, and if you press the button again, while the for() loop is running, the program will wait until the for() loop ends, and then, it is not going to repeat the for() loop again until you press the button again. If you just press the button once, the for() loop will just repeat itself forever(or at least until you press the button again); Idk if my explanation was very clear, in case it wasn't, just reply to this comment with your question and you'll try to help you. Obs: Once you've learned how the code above works, you can use the main idea of it to control any and how many loops you want. At least, that's the way I do it. It might not be the best way to do it, but for me, it is the most simple one.
Hello, if you paid attention to the video, it should be no problem. just power the board with 5V and power up your servo with the 7.4 or any other different power.
This video has 4 versions and this only version 1. I have clearly shown it and explained it . No wiring diagram. If you need it for projects, use fritzing a free software.
Hi, I had to watch the video making sure I have explained it. yes I have explained it. Watch it again and do not escape. If you want read, then line 171 to 175 in this library github.com/adafruit/Adafruit-PWM-Servo-Driver-Library/blob/master/Adafruit_PWMServoDriver.cpp
I have a hexapod with Tiva C-TM4C123GH6PM controller. It has 18 servos so I will connect 2 PCA9685 with 18 servos and the controller, the controller will send a {[6];[3]} matrix of "pulselen" to PCA through I2C connection and PCA will convert each element to separate PWM signals right? Is it the right way?
This is the best video on this subject.. everybody else just uses the example and does not explain how to break it down and use it for your own project… subbed and like your teaching method
Glad it was helpful! Thanks.
Thank you so much! This is one of the most well made tutorials I've seen for Arduino guides.
You are very welcome. I am glad you found it useful.
Good info. Lots of detail. You provided a foundation for anyone to start operating servos successfully from day one.
Thank you.....
You are very welcome.
I see that you made this a while ago but I want you to know it's still of great value. I love being able to follow your coding and by producing the same results I'm finally figuring out how to best use the PCA9685 for my robot project.
I hope it is useful to you. this video is Version 1 (V1) but this series goes up to V5 and in each I have shown different tips, codes and tricks that might be useful to you. The inks to those videos should be in the description. good luck.
Thank You for the great tutorial. I just subscribed to your YT channel, I will be watching every one of your tutorials.. Please, keep feeding us your knowledge and expertise
Thanks for subbing!
@@robojax The code doesn't work in PlatformIO, but I'll adjust it to work,
Has to do with: for( int angle =0; angle
Never head of PlatformIO
Aloha RJ, I know this is video is awhile back and just watched it today 2024 and I have learned a lot! Thank you so much for sharing your video. I have donated to support you.
You are so welcome! Thanks for your donation. I appreciate it.❤️
Nice work Ahmad. The tuning of the servoswas well explained.
Many thanks dude! I was going to become desperate :D I wanted to build servo controled points for my model railroad and every tutorial I found was way to complex. Your explanation was easy and the bare minimum to understand the shit :D Again many many thanks. You saved my night sleep ;)
This was an excellent video, exactly what i needed!! Thank you!
You are welcome. I am glad you found it useful.
Excellent tutorial - very well prepared and presented. Thank you for making and sharing this video and your code.
You are welcome. I am pleased you found it useful.
Merci. Très apprecié. From Québec, Canada
By the way I am a big fan of your channel.
Thank you very much for being my fan.
Excellent video! Thank you so much for sharing this!
Glad it was helpful!
this the most detailed PCA9685 video out there, which also explains what each pin to beginners like me. thank you so much.
1. would it possible for you to make a video of how to control multiple servos at once rather than running one at a time using PCA9685?
2. how to mod this same servo for 360-degree rotation so we can control using PCA9685
You are welcome. I am glad you found it useful.
1-I have the request from so many people. I will make it when time permits
2-the 360 servo is totally different kind of servo. This module can't be used for that purpose. You may watch my videos on 360 servos here ruclips.net/user/robojaxTVsearch?query=360
This is a gem, keep up the good work sir.
Thanks. I will. Make sure to watch v5 which all wireless
thank you, the experiment in the video teach me slowly and easy to understand.
You are welcome!
Wow finally and automated one that you don't have to use a controller to make it move
Superb explanation in very details. Thank you so much.Excellent job.
You are welcome.
Thanks man! you made a lot of things clear!
Awesome video, building up from the foundations.
Appreciate it!
Sir thanks I rechecked the program and saw all 4 video of your I have sucussfully progranmed my bipend robot thanks for the help
All the best
Tq sir
you are welcome.
Thanks very much for that. I was about to give up on the adafruit library, now it makes sense
Glad I could help! This is Version 1. there are V2, V3 and V4. The links are in description.
Wow thank you so such for this video, I am new to the world of the Ardrunio and I am trying to build automatic blast gate control system for my wood shop. This video has helped me with the servo shield.
You are welcome. Good to hear that. Please share.
Is it possible to use a smartphone to wirelesly control (With Bluetooth and Wi-Fi ) 16 servos with this board?
Yes. possible. I am working on it, subscribe so you get notification once video is upload.
It was worth every minute now I can built my robot
Good luck
Very good instruction. Thanks
you are welcome. Few weeks back I published my Arduino course worth $200 on Udemy. Arduino Step by Step Course (over 100 lectures) Starts here robojax.com/L/?id=338
Very informative, thank you!
You are welcome.
سلام
ممنون اقای مشیری بابت ویدئو تون
من دنبال کنندتونم
وعلیکم السلام. تشکر از اینکه از مشترکین مجرایم (کانالم) هستید. خوشحالم که ویدیو را مفید یافتید.
سلام علیکم. مجرا (کانال) فارسی علم و فن را راه اندازی کردم: لطفا به دوستان تان خبردهید و حمایتم کنید.
www.youtube.com/@ilmofan
Thanks for the video. How do you turn more than 1 servo at the same time?
Edit: Oops didn't see the video where you controlled more than 1 servo at the same time. Thanks, keep it up.
Thank you so much for this amazing video. What would you recommend one do if he wanted to connect 18 servos. Is there anyway to connect two of these boards together for the extra channels?
you are welcome. this is just version 1 V!, I 've V2, V3 and V4 of this up showing you everything you many options. check the link in the description
fantastic video, Super Helpful!
Thank you.
I'm thinking I want to build a servo madness bot. Good video
lovely organized, cheers!
Thanks. you have question or needed custom code, this is Version 1 or V1, there are 4 more versions of this module. link is below this video or just search my channel . Cheers. and yes, your subscription is great help. Thanks
@@robojax I am having issues with the Hiletgo PCA9685 servo controller. I have checked everything with the multimeter, have the proper external power, checked the wiring, and checked each servo, so I believe the issues to be related to software. I have used both the HCPCA9685, PCA9685, and the Adafruit version, but neither seem to be working. Is there any that you suggest for this brand?
i see servos move individualy each time. But can be moved all of them at the same time?
I have created V2 of this video where you can control all other once. The link is in the description. I have made V3 with 32 servos.
Thank you it was very useful! I still can't figure out how to reduce the speed of the rotation because the delay() function is not effecting it.. Can you help me out? Thank you very much!
Well done! Thanks!
Is it possible to only connect the pwm signal wire and power the motor with seperate higher current power source (for larger motors)?
Yes you can.
Robojax awesome. Thanks for the reply.
Great video! A lot of details and well explained!
So i will need 2 batteries in order for this to work, one for the UNO and one for the PCA9685 right? Both 5V.
Thanks!
NO. if you use battery then ONE 5V for both. I mentioned separate 5V because people connect the 5V from Arduino to this.
@@robojax So I need just 1 5V battery and then i connect the battery to which one of the boards? I think i misunderstood... Thanks for the asnwer and for the help! :)
You are welcome. If say anything else, it means I would have to type whatever I said in the video. Please watch it without skipping.
@@robojax I watched it twice man, it's not you it's me :) i get confused when you talk about 2 batteries for 2 boards. Being a beginner in hardware AND english, this is not easy for me. Hope i will find an answer! Thanks for all the learning material! :)
Papa Robojax, you can add the _adafruit pwn servo driver lib_ through the *Arduino IDE.*
Within Arduino IDE add .zip libraries to your included libraries by going to the menu bar: _Sketch/Include Library/Add .ZIP Library..._ and then navigating to the folder you have the _.zip driver lib._ Makes things a bit easier, when you just drop the .zip file on the desktop, and add it thru the IDE, instead of digging through the IDE folders manually.
thank you mama 1085243, I prefer putting it manually becuase it would be in the same folder as the "arduino" and in the future you can copy all together. but if you use the menu, it will go under the "my document" which I don't prefer. I have mentioned that from time to included it using the menu like this video ruclips.net/video/7RQ8QoJWhpY/видео.html or this ruclips.net/video/L6ekl2ABcuY/видео.html
This is a great tutorial! Thank you for being so thorough!
Can you do a video tutorial on powering multiple pwm boards with one power source? Using your 4 board example, how to power 64 servos, 4 pwm boards with one power source.
You are welcome. I have in my "to do list" to make video with 32 servo which viewer learn to add more. I am not sure when.
Robojax looking forward to it.
@@robojax do it please I love your build 😘 YOU ARE AMAZING MAN
Sir, I have watched this video several times now and it really helps. I'm using a nano connected to the pca9685, is there any way of smoothing out the movement of the servo arm? Thank you.
Can you guve an example of an adequate power source for the module?
thx very much, helpfull in year 2020 too.
you are welcome.
Do you have to solder the pins onto the 16 channel board?
there is no soldering in this project. do exactly as I have shown. Unless your project is somewhere which is shaken a lot to solder it.
Thanks for the great video! Will the same make and model servos have the same settings?
You are welcome. Yes. they do.
Hi, I have watched the other servo videos. Nothing shows how to control the pca board with a voice module. I thought If I removed the code for the push button switch (v3 video) I could code it using the OE Pin. Or am I looking at the problem all wrong. Confused myself.
Hi, of course I don't have any video related to voice control. But I have shown how to control with a signal or push button. just use the method and use the singal from voice module.
Like they say - excellent, thanks
You are welcome.
Thank you for a great video! What is the best power source to get 5v?
it depends on the type of servo motor and how many you use. measure the current of one servo motor when load is connected to servo motor for example you measured the current to be 0.5A and you wan to use 10 servo then 0.5x10=5A to be save get a power supply with at least 6A or 7A.
Very interesting. Now I beginning to like building one robot.
Happy robot building.
Hi, Thanks for your great video . Im just wondering whats the maximum number of servos can you control using multiple of this board (PCA9685)? for example can I control 600 servos? Thanks.
You are welcome. You can connect 4 boards 4x16= 64 servo I have explained it at 4:42
Hey very good video, but I have a question. Do you know why the board has a capacitor? Or could you explain for which situation I would need one? My board came without one.
when servos STARTs and stop this sudden start causes the power supply voltage to drop a little and if you have capacitor connected to the power supply which is already charged, it resists the voltage drop by supplying power to the board. .
Great video. Thank you!
You are welcome.
I was wondering... do you need to use any other component to protect the arduino from the "blowback" voltage of the servos? Is this driver already protecting the arduino? Thanks
No you don't need it. There is already components inside the servo.
Okey, thank you! And great tutorial
Very good... Impressed... Good job... If i want add same 9g servo 4 pc for my rc plane how much current i have to supply to the board?
Thank you. For each servo the idle current at 5V is 100mA and 500mA in stall mode. Read more here: www.addicore.com/FS90R-Servo-p/ad314.htm
those servos are absolutly awful, don't buy them
Thank you for your explanation. I am curious as to why you used "delay" instead of "millis" as this only allows one servo sequentially. Is the power enough for multiple servo operations??
millis is number of milliseconds since the program started. I just needed the program to give certain time delay to show movement and then start another one.
The servos I used were without load and it was enough. But if you make all servos do something, then the load will increase.
thank you so much this video helps alot
You are welcome Fadi. Ahmad from Canada.
Having a peculiar problem with my recently bought PCA9685 (same as the one you demo with low power mosfet). WITHOUT connecting to any external controller yet, i plug ext power 4.8V (from fully charged 4 NiMH AAA batteries holder) to the green block. No servo connected yet. Tested with multimeter ON ALL the V+ ... only getting 1.7V and not 5V. Then using multitester.. tested on the MOSFET and capacitor, but got about 5V.
Any reason why?
Hello, thanks for your help !
I just have one question: How could I combine the Arduino librairy of the PCA 9685 and the librairy StandardFirmata since my code is written in Python ?
Very interesting video, Robojax.
I have an application with servos driving delicate mechanisms. After a shutdown, my servos (all of them as a matter of fact) jerk briefly when resuming power. The movement is brief, but its amplitude is enough to damage my system. Is there a way to overcome the phenomenon by tweaking your program ?
Thank you Marcel. Very interesting issue. Does this happen when powering up or does this happen also when you press the reset button Arduino?
If you don't see the issue when you press reset, then add 2 second delay in the setup() just after setup so the motors don't get any power.
let me know.
thank you so much!
only one question - question about speed control is still relevant - how to do it?
You are welcome. Each servo has pre-determined speed (quality and price) and can't be set.
@@robojax yes, I know.
i mean may be that library (or may be you can advice another) have methods for solving that typical issue
@@robojax hey :)
if I can use loop for pulse increasing? for ex:
pwm.setPWM(0, 0, cnt++);
... or that kind of trick will bring delays?
amazing video....very well explained !!I'll be chaining 20ish of these guys together.... however (correct me if i'm wrong ) i've heard you can't run Led's and servos at the same time on this board ( one or the other) ... as all channels share a common frequency...
I am glad you found it useful. Thank you
Can you control the servo connected to the board with a potentiometer? Is there a tutorial?
this is Version 1 and I have 4 more videos on this. But to control servo I have tones of videos. Learn from those and implement it here. learn how to Search for a Particular video in a channel here ruclips.net/video/OhkUceBWcHs/видео.html
Thank you so much sir.
You are very welcome. Please subscribe. It is appreciated.
Hi. Where are you based ? Could this be done for a whole network?
Hi, in this video, there is not network control involved. if you want o control more ways, please see V2, V3 and V4 of this module ruclips.net/user/robojaxTVsearch?query=pca9685
Do you have any idea on how could i supply the 5V to the PCA9685 board considering the fact that i need it to put it in a portable 3d printed robotic hand....? I hope you cand help me with this. Great video !
Hello (first hello or hi), measure the current for one servo while the servo is motor working and moving the load (under the load). then multiply the amount by the number of servo motors. Then get 5V power module.
I have two batteries each one is 7.4 V, should I connect one of them to the arduino and the other to the PCA?
Also is using 3.7 V battery for PCA to control 12 motors enough or not?
For arduino the dc adapter input can accept up to 12V. For the PCA connect power exactly the same as your servo motors voltage. If servo is 9V then connect 9V for example.
Thank you for your videos! It's clear and useful! Good work! I'm working on a project with 27 servo, all works! I would like to run all the servo at the same time but with different speed and degrees (random sweep)... I've no solution for the moment with the Loop fonction "for"... Any ideas?
you are welcome. This is Version 1 (V1) and there are V2, V3 and V4 with different examples. Please watch those.
@@robojax Thanks for your reply! I saw all the videos, but I don't find easy solution for running all motors in random programmation (degrees and speed)...
Can you tell me when the video about it will come out? I am hoping that you release the video before February 22.
which video? This video is Version V1. I have released V2 and V3.
Can you move multiple servos with this extension board at the same time?
Yes. I have explained that in the video. Please watch it again.
Can you stil use the original PWM ports on the arduino, next to the 16 pwm's on the servo controller?
of course. you can. that is the beauty of this module.
@@robojax Thanks, couldn't figure it out right away, but you're right! :)
Can we use it as Genral input output
if you know that the output is PWM signal, then yes. But if you just need extra 16 ports, then use MCP23017 and I will make video, God willing.
Hi, thanks for the video. I need to know if there is any way to disable the current on a servo with this librar y after it makes a move. I am using 15 servos and they make a lot of noise and vibrate. I think this would be a way to eliminate it. Thank you
Hi, servos are independent. They just get PWM signal and other than that you can't have any other control. you can have delay between the pulse you send if you add it in the loop. other than that you can't do within Arduino. There should special servos where you could read the current and set the limit. But these servos are very simple.
@@robojax Thanks for your answer. My idea is to do something similar to the dettach function in the servo.h library and stop the servo from receiving voltage.
when sign is turn OFF, the current should be zero. Attached /detach only assigns pin and does not send any signal to servo.
Im curious, how do you code it to where you can toggle the servo actions on and off? Like I have it running continuously but I don’t know how to make it start and stop when I want it to.
Hi, watch my video on how to control servo with push button. ruclips.net/video/7woqNH_qby4/видео.html
How does this work? Do you have a Controller or something?
I have put it on the title. I use Microcontroller called Arduino. If you don't know Arduino, here is 2 minuets video from my Step By Step Arduino course ruclips.net/video/-6qSrDUA5a8/видео.html
@@robojax ok but did you controlled with the codes?
Wow, you have not watched the video and posted comment. I can’t believe this
helpful, thanks
you are welcome. Salam
Can we control 2 or more servo at a time plz answer my question it will be very helpful to me
Hello, yes we can. please see the link in the description to V2, V3 and V4 of this video. I have tones of examples.
Ok sir thank you very much for your response sir
Very nice! Now it’s clear to me how SERVOMIN/SERVOMAX works! Thanks a lot!
One question; I am trying to control 9-10 servo’s individually through a 3x4 matrix numeric keypad. Will there be a way to [toggle] control of a servo state, e.g. press ‘1’ to get the servo to s designated angle then press ‘1’ again to get the servo back to angle zero? You advice would be much appreciated!
In Arduino only situation, I could use the sketch to achieve his,
e.g. case PRESSED:
if key==‘1’ {
digitalWrite (ledPin, !digitalRead (ledPin));
- - -
I am looking for an equivalent code...
You are welcome. Here is my video on how to control servo with push button ruclips.net/video/7woqNH_qby4/видео.html
Robojax Thanks for your kind reply. I think, however, I already watched your video you recommended. In that video, you demonstrated two-button control of a servo with an Arduino board. But I need to control 8-9 servo’s so it would exceed Arduino’s PWM capacity. That’s why I am planning to use 16-ch PCA9685 based shield.
Amazing video, however my servo motors are not rotating. I'm using an arduino mega 2560 and the code uploads but nothing happens after. I have ordered an arduino uno in hopes it will work. I'm not sure why my mega 2560 isn't able to control it?
It should work with mega. You have be doing something wrong. I am not sure .
@@robojax Thank you for responding. I followed all the steps you took. The only difference is i'm using a mega 2560 and the adafruit library I downloaded is on 1.8.13 instead of yours which is on 1.8.0. For example you only have 2 #defines in your code but the one i downloaded has 5 #defines. Under #define SERVOMAX 600 it says #define USMIN 600
Please download the library from robojax.com as the library might have been changed.
@@robojax I used robojax code and it still did not work, I also tried retyping it which didn't do anything. I also tried a different set of code but nothing happened. Im starting to think there is something wrong with my pca9685, I guess ill keep trying different things. Thanks again for your help!
One more help please tell me can i provide power through battery in servo motor controller if we used then please tell which type of battery i used
Please watch V2 and V3 of this video. I have mentioned extra details there and the amount of current for my servos.
Can you run DC motors and servos together on a single PC9685 ?
No you can't run it with this library. You would have to modify it to get result.
HI. I would like to use servo motors on my model railway for points and level crossing gates, uncoupler Etc. but can you initiate each servo individually by a switch. So it would go in one direction by switch and stay there until I press the switch to return rather than by a timer. I was thinking of using on-off-on switches. also do you need to keep them plugged into the computer after the positions are set. If possible to do this could you tell me how to do it. I am not knowledgeable in electronics so it would have to be explained simply. Thanks
Hi, this video is version 1 there are 4 more videos and I have used many ways to control the servos. Please check them. Yes you can control with switches.
@@robojax Thank you
I got one of these devices today, I wired it all up but for some reason it burned up my servo, I tried 2 more but each one got damaged. I'm not risking another, any idea how this could have happened? I connected the data lines correctly and used an external power source of 5v so nothing was out of the ordinary. Any suggestions.
You might have connected the Positive and negative terminals in revers. Other than very rare but possible that servos are rated for less than 5V may be 3.3V.
Great work thank you so much! I have a project that needs 100 servo and need to somehow chain these
you are welcome. This video is Version 1. I've got V2 with different code demonstration, V3 with 32 servo and V4 to control them over WiFi the link is under the description of the video.
@@robojax amazing I'm subscribing :D 1. can I use a raspberry pi to send signals instead? 2. Is there something that goes up down instead of rotating like those servo?
PCA9685 has registers that can communicate using I2C protocol. 1-you have to look at datasheet to know how to read and write using raspberry pi. 2-I am not sure if I understood it correctly, but if you want up and down, isn't that you just rotate to the left or right and it will go up and down? thank you for subscribing.
@@robojax oh hey thank you very much for the reply. I'll look into that. What I needed was an actuator. I am learning from scratch. :)
Is it possible to use low voltage super mini servos with this board?
The size does. It matter. Just check the voltage of the servo. It should work if it is the same voltage.
@@robojax These are the specifications
1.7g Low Voltage Micro Digital Servo
Weight: 1.7g
Connector: mini JST 1.25mm
Voltage: 3.7V
Torque: 0.065±0.01Kg.cm @ 3.7V, 0.075±0.01Kg.cm @ 4.2V
Speed: 0.07±0.01S/60° @ 3.7V, 0.05±0.01S/60° @ 4.2V
Great video! Thank you.
Questions:
1. What do you use to supply power to the servos (current)?
2. Can I use the same code on ESP32?
Cheers!
Hello,
1-measure the total current for your servos and connected a power supply accordingly. this I have connected a 5V power supply that could up to 60A but you don't need that. you need whatever you measure when the servos are running under the load.
2-You are watching Version 1 (V1), I have 3 more versions of videos of this module link is in description. Always check description I have it it for ESP32. Or search my channel for more cool projects. Here is how to find Specific RUclips Video in a channel bit.ly/findRUclipsVideo
@@robojax Thank you!
For powering a couple of servos (not too much load), can I used like 4 C batteries, at least to start with?
Maybe use something like a buck converter to increase current, if needed?
Thank you very much!
You are welcome.
I have wired my arduino Uno R3 the same as you to the PCA9685. I get no power to the either boards but when I put power to the arduino both boards light up. I have also hooked my arduino Mega in the same way and the same happens.
Hi, perhaps you are connecting it incorrectly. Please watch it again or what other version of this module ruclips.net/channel/UCkcBSig_Iu4ZnAIeCeG1TVgsearch?query=pca9685
I’m working with an Arduino Uno R4 WiFi and a PCA9685 PWM driver module to control a servo motor. Although the Arduino IDE indicates that the code is running correctly and attempts to move the servo, the servo motor itself does not respond or move. This issue persists even though the code is properly uploaded and the Serial Monitor shows that the IDE is executing the code.
Here’s what I’ve checked:
I2C Connections:
I have connected SDA and SCL from the PCA9685 to the corresponding SDA and SCL pins on the Arduino Uno R4 WiFi.
I’m unsure if SDA and SCL should be connected to pins A4 and A5, respectively, but I’m using the dedicated SDA and SCL pins on the Uno R4 WiFi.
I2C Device Detection:
I used an I2C scanner code to detect devices on the bus, but nothing appears in the Serial Monitor. This suggests that the PCA9685 may not be detected on the I2C bus.
Power Supply:
I’m concerned about whether the PCA9685 and the servo motor are receiving sufficient power.
Code Functionality:
The code is designed to control the servo motor via the PCA9685 module. The code seems to be working as expected when run manually, but the servo motor does not move.
I'm following this, using a bench PSU to power via the central power inputs, but even just raising the PSU to 2 volts starts to feed 250mA current, if i head toward 5V the PSU maxes out at 2 amps. What could be wrong, i've triple-checked wiring etc ?
My PCA9685 is dead, problem solved!
the amount of current depends on number of servo motors and types. some servo motors need more and some less. measure current of ONE servo motor while running and connected to the load or word it does. then multiply it to the number of servo motors. if you still get higher current, then either one or more servo motor is damaged or the servo motor has lower rated voltage.
@@robojax Thanks for taking the time to respond Ahmad, have a good weekend :)
you are welcome. Stay safe.
@@robojax You too sir, i don't know how it is in Canada, but the live data from the UK is in complete disagreement with government policy, which has now killed over 40K old age pensioners in care homes. I am on the war path.
The minimum and maximum I found on my servos causes the rotation to be slightly more than 180 degrees, like around 195. Can I adjust the minimum or maximum so the rotation can be closer to 180? Will it matter that I'm not using absolute minimum or maximum?
Of course you can adjust it. This video is version 2 , you may watch V1 videos o see how I have done it.
Enjoyed your tutorial! Do you happen to have Arduino sample code, to use potentiometers, to control the servo's, that you can share? Using the same I2C setup, that is in the tutorial above?
Thank you very much. I will try to make a video and post the code. I have to test it and make sure it works before posting it.
What is the minimum possible angle of movement?
I dont know . i have doubt? did you got what they did on this video? please reply.
Because i did'nt came yet.
it is usually to 180. But you can find special servos that can go beyond
Can this be used to control motors too?
No. The servo goes from 0 to 180° only
@@robojax I mean the board not the code
I meant the board. So NO. This board can't control DC motor. Only Servo Motors.
@@robojax ok thanks
You are welcome.
Perfect and thank you
You are welcome.
Hello! Thank you for the video. If I use 12 servos simultaneously, how should be the supply charge of amperes?
You are welcome. If you wanted the amount of current, first measure the current using Ampermeter for one servo and multiply it by 12.
This tutorial was AMAZING!! Do you know how to trigger the loop with a button press? I can't figure it out!
Thank you. I would have to make tutorial video on that.
Use a control variable to do that.
You could use something like this:
boolean running = false; // this is the control variable
if(button == LOW){ // this is the way to start the loop with the click of the button
if(running == false){
running = true;
}
}
delay(200);
while(running == true){ // this only triggers once you've pressed the button, because once you've done it, the running variable is going to be set as true.
if(button == LOW){
running = false; // this is the way to stop the loop with the same button once it has started
}
put the loop here
}
what happens here is:
the first time you click the button the loop will start and it will run continuously until you press the button again. Notice: this method does not stop the for() loop itself, it just keeps it from repeating. Ex: You press the button, the for loop starts to run, and if you press the button again, while the for() loop is running, the program will wait until the for() loop ends, and then, it is not going to repeat the for() loop again until you press the button again. If you just press the button once, the for() loop will just repeat itself forever(or at least until you press the button again);
Idk if my explanation was very clear, in case it wasn't, just reply to this comment with your question and you'll try to help you. Obs: Once you've learned how the code above works, you can use the main idea of it to control any and how many loops you want. At least, that's the way I do it. It might not be the best way to do it, but for me, it is the most simple one.
Hello ! Really nice tutorial ! I was thinking, can I use this driver to drive multiple high torque servos, which usually operate at 7.4V ?
Hello, if you paid attention to the video, it should be no problem. just power the board with 5V and power up your servo with the 7.4 or any other different power.
Thanks for the helpful video! Can you provide a link to those wires that you used when connecting the PCA9685 to your Arduino?
This video has 4 versions and this only version 1. I have clearly shown it and explained it . No wiring diagram. If you need it for projects, use fritzing a free software.
For what is the 0 in the middle of the pwm.set?
Hi, I had to watch the video making sure I have explained it. yes I have explained it. Watch it again and do not escape. If you want read, then line 171 to 175 in this library github.com/adafruit/Adafruit-PWM-Servo-Driver-Library/blob/master/Adafruit_PWMServoDriver.cpp
I have a hexapod with Tiva C-TM4C123GH6PM controller. It has 18 servos so I will connect 2 PCA9685 with 18 servos and the controller, the controller will send a {[6];[3]} matrix of "pulselen" to PCA through I2C connection and PCA will convert each element to separate PWM signals right? Is it the right way?