Control 16 Servos Using A PCA9685

  Рет қаралды 71,880

Toms Trains and Things

Toms Trains and Things

Күн бұрын

The pca9685 is capable of operating 16 servos from an Arduino Uno using only 2 wires. I will show you how to figure the range of the servo and the optimal throw for your turnouts through an Arduino sketch.
In this video I'm going to show you how to have Turnout Control With Arduino And Servos Using A PCA9685. I will also cover how to hook up a switch and LED's for your control panel for each turnout you want to operate. This is all possible with the pca9685. Since this device only uses 2 wires for the control of all your servos, you can hook up 5 switch LED combinations on an UNO. With the help of a shift register, you can add more control for your turnouts.
The Arduino Mega has many more input/output pins, you are able to operate many more turnouts without the assistance of an external device.
Since the pca9685 is an I2C device, you can add many more devices to your project all on the same two wires by jumping through to another device.
Inspiration for this video and coding ideas came from;
Brainy-Bits:
/ @brainybitscanada
Robojax:
/ @robojax
CODE IN THIS VIDEO:
tomstrainofthought.com/projects/
www.adafruit.com/product/815
DRIVER LIBRARY:
github.com/adafruit/Adafruit-...
S U P P O R T THIS C H A N N E L
LOCALS: trainofthought.locals.com
Rumble: rumble.com/c/TomKvichak
Amazon Link:www.amazon.com/shop/tomstrain...
PayPal : paypal.me/tomstrainsandthings
Membership:
/ @tomstrainsandthings
Music on all videos from Epidemic Sound. Get One Month Free when you subscribe through this link. Here is a short playlist
share.epidemicsound.com/qj6qa...
CONTACT INFORMATION:
workbenchwednesday@gmail.com
tomstrainsandthings@gmail.com
tomstrainofthought.com/
#tomstrainofthought
#structurekits
#floridatrainshows
Disclaimers: all opinions are my own, sponsors are acknowledge.
Intended for viewers over the age of 14

Пікірлер: 182
@joedart1465
@joedart1465 4 жыл бұрын
good job Tom. it's always the little details that make a difference and you delivered them clearly. Thanks.
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Your welcome Joe
@marka87
@marka87 4 жыл бұрын
Great stuff Tom, getting into this Arduino thing and your videos are really helpful. Thanks Mark (UK)
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Glad I could help Mark.
@jimrousey4650
@jimrousey4650 3 жыл бұрын
I have watched this video several times, and I am getting brave enough to try. I am not sure what sketch I should use. I found 2 on your project folder, and neither seems to match with the one on camera. I hope you are still notified when new comments arrive. I have watched dozens of your videos and am subscribed. Thanks Tom.
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
Thank you James. The ones in the project folder is the final sketch
@brucewoods9377
@brucewoods9377 11 ай бұрын
This is a great tutorial Tom. Very easy to follow. I have now made a mimic panel incorporating the Arduino Meg Pro and the PCA 9685 running 15 servos, SPST Switches and 2x2-pin bi-colour LEDS (One for Thrown and the other for Closed) and it works like a charm. Thanks again for the Tutorial, and keep up the great 👍 work
@TomsTrainsandThings
@TomsTrainsandThings 11 ай бұрын
Thank you so much, glad it was helpful in getting you where you needed to build your own.
@johnmarshall2660
@johnmarshall2660 4 жыл бұрын
Really great Tom... I finally got round to trying your sketch and found a bit confusing then realised that Final and Test were in same sketch that I downloaded, but works a treat just need adjust movement angle and the modify for 16 sets of points ... and a Happy New Year 2020...
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Glad you figured it out.
@MMRails
@MMRails 5 жыл бұрын
Ah shoot! I have the PCA9684. I’ll come back later when I upgrade. Well explained Tom.
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
One short this time. Maybe next time. Thanks Mark. Say Hi to Donald for me!
@dalefgrooms1812
@dalefgrooms1812 Жыл бұрын
I know you posted years ago, but i love it! Thank you for your great work.
@TomsTrainsandThings
@TomsTrainsandThings Жыл бұрын
Glad you enjoy it!
@JoeG-firehousewhiskey
@JoeG-firehousewhiskey 5 жыл бұрын
This is awesome, thank you very much for the video!
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Thanks Joe, glad I can help.
@erikpatt7585
@erikpatt7585 3 жыл бұрын
Nice explanation and finally a downloadable code without an error
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
Glad it helped
@bobcampisi1362
@bobcampisi1362 4 жыл бұрын
Great info Tom, I have been looking for months on how to set this up, your video and sketch are the best tried it and it works. Subscription worth every penny. Bob from Lubbock TX
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Glad it helped Bob! Thanks for your support.
@mikeseba7817
@mikeseba7817 Жыл бұрын
👍👍👍 Thank you! Very well explained!
@TomsTrainsandThings
@TomsTrainsandThings Жыл бұрын
Glad it was helpful!
@rva1945
@rva1945 4 жыл бұрын
That is precisely what I've been using in my turnout.
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Works great
@rva1945
@rva1945 4 жыл бұрын
@@TomsTrainsandThings Absolutely. I'm using two Mega one for DCC and another for the servos as I needed many digital pins for reading switches on a switchboard. Now I use a Processing sketch were I have my layout and click on the turnouts.
@masterdplos2689
@masterdplos2689 4 жыл бұрын
Het there! I'm starting with arduino for my new layout and this has been really helpfull!! thanks
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Glad I could help
@masterdplos2689
@masterdplos2689 4 жыл бұрын
@@TomsTrainsandThings actually, I'm doing the translation for Spanish subtitles of one your videos. Meanwhile I'm learning a lot!
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Thank you for doing that!
@guzzialfa
@guzzialfa 5 жыл бұрын
Nicely presented, Tom. Thanks for showing us how to get 16 going. In practice would you have to have 16 toggle switches to throw for turn outs which makes sense but what about crossing gates for roads? Do you have to throw a switch to put them down or will you have a sensor that sees the train coming up and puts the crossing gate down upon approach or will you have to throw a toggle switch to do so?
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Crossing gate video will be out shortly. You just have to add the servo without the pca9685 to a sketch I already did for the crossing gates.
@Bianchi77
@Bianchi77 6 ай бұрын
Nice video, thanks :)
@TomsTrainsandThings
@TomsTrainsandThings 5 ай бұрын
Glad you liked it!
@AkashJadhavIT
@AkashJadhavIT 4 жыл бұрын
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.second, how to mod this same servo for 360-degree rotation so we can control using PCA9685
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Multiple servos running simultaneously are controlled in the code. Check out my other videos. These servos are only for 180 degree rotation. You would have to purchase 360 degree servos.
@AkashJadhavIT
@AkashJadhavIT 4 жыл бұрын
@@TomsTrainsandThingsi will check out the other videos then, thank you for your reply 🙂
@moendrekocsis
@moendrekocsis 4 жыл бұрын
Hi! Very useful video. One question: can you also integrate frog polarity switching? Thank you
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Yes, by adding a relay to each turnout.
@roberthughes1796
@roberthughes1796 5 ай бұрын
Great job Tom as usual. Could you supply a schematic or wire diagram on how to wire the switches and LEDs up to the Arduino and the PWA9685 to use for turnouts. Athe the present time I am using TVD Octo lll's.and a Quad LN. 🙂
@larryo4480
@larryo4480 4 жыл бұрын
Great video Tom. I'm getting started with DCC++ and hope to use servo actuated turnouts. Do you know if the Walters LLC Switch Machines are compatible with the Arduino PCA9685?
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Don't have any, but what I've seen, it has it's own control system with decoder. Short answer would be no. The PCA9685 along with the code in the Arduino takes the place of the components on the Walthers unit.
@larryo4480
@larryo4480 4 жыл бұрын
@@TomsTrainsandThings Thanks for the quick reply. I have one on order to play with, so I'll give it a go when it arrives and report back.
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
@@larryo4480 Thanks
@ModelSceneryTutorials
@ModelSceneryTutorials 5 жыл бұрын
Thank you. Do you have a wiring diagram or something that shows how to add the push button or switch and LEDs to the breadboard and connect them to the arduino?
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
The sketch and Frirzing diagram is on my web page along with all my other Arduino lessons and projects. You can find the link in the description of this video.
@federicosarnico
@federicosarnico 4 жыл бұрын
@@TomsTrainsandThings Hello Tom, almost everything clear, only would like to know the value ( Ohm ) of resistor you used in the circuit
@coreygibson2590
@coreygibson2590 5 жыл бұрын
Hello. Your channel is Very informative and done well. I just got back into the hobby about 6 months ago. I'm at the stage where I'm about to build my layout. My question is,, do you think it's possible to incorporate this exact setup into JMRI? If it is not possible, then your button way will be my approach. Also I cannot find your modified script. I only have the download from Adafruit. Thanks
@coreygibson2590
@coreygibson2590 5 жыл бұрын
I found your scripts on your website. Thanks
@BALD8BIL
@BALD8BIL 5 жыл бұрын
This looks like a lot going on but it looks like you got it down pat thanks for taking the time to share this video I know I'm in the process of deciding which switch motor to go with should it be the tortoise Cobalt or these RC motors it's a hard decision to make the tortoises you need to solder or buy an extra piece so you don't have to solder you want to get one year warranty with it. The kobold you get lifetime warranty with everything no soldering involved then we have the RC motors what's your cheat but all the extra stuff you have to buy make them work does not seem worth it I'm looking at about 36-40 turnouts just on my way out very hard to decide which way I want to go. so again thank you for taking the time to make this video and sharing it with us
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Each pca9685 will operate 16 servo motors and they can be stacked where you can operate over 900 servos. All of them can be operated with one Arduino Uno or Mega which can be purchased for $22 for the original or less than half that for a clone which I use on all my projects. Since the technology is open source, any manufacturer can make the Arduinos. There is also a board for the inputs where you can increase the capacity of the Arduino to handle more inputs such as switches and LEDs. Initial cost for the Arduino method if you purchase all name brand items; Less than $50. Servos can be obtained for under $2 pc. Tortoise switch machines have a 9 year warranty and are located in the US. They rarely fail Cobalt has a lifetime warranty and located in Au & UK See my video comparing the two switch machines: kzbin.info/www/bejne/oF6xgaKfaMx_h9E
@scottmorgan5370
@scottmorgan5370 3 жыл бұрын
Tom, I like this code for the 16 Servo Board, but I'm wondering if there is a way to slow the speed of the servo down, to throw the turnouts a little slower.
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
I haven't found a way yet. I have to keep trying. That's been ask by many.
@jyvben1520
@jyvben1520 2 жыл бұрын
use a smaller angle (full/10), pause, increase the angle (add 1/10), pause, repeat until full angle is reached. time to pause (aka sleep) is decided by you, that should do it ! /10 can be higher if you want it smoother
@OwenKane
@OwenKane 2 жыл бұрын
Interesting Video Tom, I can think of a number of places to use this and not all would be turnouts. Got me thinking would the PCA9685 be capable of activating a Kato turnout.
@TomsTrainsandThings
@TomsTrainsandThings 2 жыл бұрын
Thanks Owen. The PWM signal can control RGB LEDs, Servos, and spped on a DC motor. Anywhere any of these are used is a possibility.
@viktorvarga9566
@viktorvarga9566 5 жыл бұрын
Hi Tom thank you for this video very usefull for me. But tell me please how to I modify the servo speed?
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Thank you. You can find more on this subject in some of my other videos.
@rodnamberkarns3424
@rodnamberkarns3424 4 жыл бұрын
Great video, very informative. My question is, the from the diagram, you can run 16 servos on the PCA9685 but it looks like the UNO board will run out of room for the LED lights before that. Is it possible to run the LED's off another PCA9685? Also, do you prefer the 2 pin bicolor or 3 pin bicolor LEDs? New to this so sorry if questions have been answered before. Thanks
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
There are other shields and boards similar to the pca9685 that can add additional capacity to the Uno that are also I2C devices. I will be doing another video to demonstrate this in the future. I have several of the boards that can accomplish this but not had the time to do it. As far as bicolor LED. I prefer using the 2 pin, but in this application, the 2 pin requires a reversal of polarity which you can not do in this application. Either 2 separate LEDs or the 3 pin need to be used for this.
@rodnamberkarns3424
@rodnamberkarns3424 4 жыл бұрын
@@TomsTrainsandThings what boards do you have or would recommend for the LEDs? I plan on having 10 turnouts run with servos as shown in your video with a Red/Green 3 pin LED at each to indicate direction. Thanks!
@rodnamberkarns3424
@rodnamberkarns3424 4 жыл бұрын
@@TomsTrainsandThings One other question, does the UNO run off the 5V that also powers the servos on the PCA9685 or is another power source needed for the UNO, like USB? Thanks!
@juanmanuelandradescaro978
@juanmanuelandradescaro978 5 жыл бұрын
Hello, is there any function that removes the voltage of one of the outputs of the PCA9685? It's to keep them from vibrating. Thank you.
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
If your servos are vibrating, your driving them past their limit. Reduce the Max & Min figures. I show hoe to do that in another video.
@ChrisPackham1
@ChrisPackham1 4 жыл бұрын
Hi Tom, Good job, I learnt a lot from this. I have a question, how do I get JMRI to talk to the PCA9685 and control turnouts?
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Thanks Chris, glad I could help. JMRI is an entirely different discussion. I may cover it later on in another video.
@funcraft3605
@funcraft3605 4 жыл бұрын
Yea same here. I'd like to use an Arduino Mega to control DCC++ l298p shield with addition to the pca9685 all from JMRI
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
@@funcraft3605 see my comment to you on the other video.
@federicosarnico
@federicosarnico 4 жыл бұрын
@@TomsTrainsandThings which is the video where you speak how to drive PCA9685 from JMRI? you have too many videos .. please help
@jesusandrades2322
@jesusandrades2322 4 жыл бұрын
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
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Your probably over driving the servos past the limit. Even though they state 0 to 180 they may not go that far.
@gabriellangelier5731
@gabriellangelier5731 Жыл бұрын
Thanks
@TomsTrainsandThings
@TomsTrainsandThings Жыл бұрын
Glad to help!
@vincentblake2589
@vincentblake2589 4 жыл бұрын
Hi tom, how would you connect an on/off (SPST) toggle switch? would you keep the same as a push button with a 220ohm resistor (I am connecting 8 switches for 8 servos)?
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Same as you would a push button. I used a PB in this demonstration because I didn't have an SPST sw to fit the breadboard.
@vincentblake2589
@vincentblake2589 4 жыл бұрын
Thank you for your help, great videos.
@manonblake1583
@manonblake1583 2 жыл бұрын
Thanks Tom. I wanted to see if I could use two PCA9685’s. One for the servos and the other for The LED’s?
@TomsTrainsandThings
@TomsTrainsandThings 2 жыл бұрын
Never attempted to run both servos and LED's on the same device, but I see no problem with servos on one and LED's on another.
@noavanderhaeghe6193
@noavanderhaeghe6193 4 жыл бұрын
Hi Tom, how do you control the servo speed with this pca9686? Because I am using this for a school project and the speed has to be lower to be stable. Maybe you could tell me how to find it?
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Try a short delay in the code under the line pwm.set, this may slow down the rotation.
@user-cw3vt8sd9z
@user-cw3vt8sd9z Жыл бұрын
Hi Tom, Interesting video. Do you know of a way to control the individual 16 servos separately with a push-button or switch, and if so, how can we obtain and compile the code? It looks like this video gets to that point, but I don't understand the detail. Thank you.
@TomsTrainsandThings
@TomsTrainsandThings Жыл бұрын
Have you checked my web page that complements this video, this goes a little further with updated code! tomstrainofthought.com/projects/pca9685/
@railbuilderdhd
@railbuilderdhd 3 жыл бұрын
This is great for how to get the arduino on Mrr. How about using digit ax DCC to control the input.
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
I have other videos on that!
@liheliheliheli
@liheliheliheli 6 ай бұрын
hello, dear grandpa Tom, could please tell me how you power pca9685 cause I am new in Electronics and trying to power it using my lipo battery with XT60, it seems like you power it using some converter, but it's unclear, could you please tell me what's your way of powering, thank you, and you did a good job and really appreciate your job
@yrunaked4
@yrunaked4 2 жыл бұрын
I want to have a crap ton of operating wig wags, Griswold signals and semaphores, this is probably the more affordable approach as those switch machines can break the bank
@TomsTrainsandThings
@TomsTrainsandThings 2 жыл бұрын
Servos are the way to go. I used 9 gram servos in this demonstration, but a better fit for wig wag or signals would be 3.7 grams.
@davidkerchner5163
@davidkerchner5163 4 жыл бұрын
Do you have a book? You have the best videos!
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
No book, just videos.
@ac44000cw
@ac44000cw 5 жыл бұрын
Great project great video but please explain where to connect the toggle switches in the arduino or schematic will be helpful I need to install 15 turnouts
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Thank you Luis. Go back and watch the video at 0:27 I tell you where you can find the explanation. The web address is in the Description under Contact Info. I have most of my Arduino projects on the web page.
@ac44000cw
@ac44000cw 5 жыл бұрын
Toms Trains and Things Thanks for the fast response I made 1 servo work without any problems But I’m new to write code sketches and all that so I don’t know how to add 12 more servos to my arduino So I’m lost
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
In the example sketch on my web page I show two servo/switch routines in the if/else statements. Copy and paste the contents of these two statements and change the numbers involved. The first statement uses "0" the next one uses "1" Continue with the same numbering convention until you have the desired button/LED combos that will fit on an Uno. You will also need to declare the Pins for LED's, Buttons & Button State at the beginning as in the example. The Uno is limited by the available pins but more can be used on a Mega. Like I said in the video, I will show how you can increase the number of available pins on the Uno via a shield or module. I just received the module in the mail so I'll be doing a video on that shortly.
@MrKWiley918
@MrKWiley918 4 жыл бұрын
I have Kato turnouts, and I have an ideal about using an arduino, a motor shield AND a multi relay board, with each relay a turnout and the MS will provide the power to operate .
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
You can eliminate the motor shield. It needs external power to operate. The same external power you can hook up to the relay board. The motor shield can only control 1 motor per channel, it's not needed in your situation.
@gjdanco4260
@gjdanco4260 4 жыл бұрын
Hi Tom Enjoyed your tutorial. I have successfully built my own dcc++ using an arduino and a motor shield and can run and program engines on my test track. Now to step 2 I want is use JMRI to switch my servos using an uno and a pca9685. I was looking for the adafruit sketch you mentioned in your tutorial, however could not find it. Would you be able to direct me as where to find it? Thanks Geoff
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
A link to my web page is in the description, it's under /projects
@gjdanco4260
@gjdanco4260 4 жыл бұрын
@@TomsTrainsandThings Thank you Tom...found it...now to get to work
@gjdanco4260
@gjdanco4260 4 жыл бұрын
Tom, would you know of any tutorials that will connect JMRI to an arduino uno and PCA9685? Would prefer to control servos direct from my pc thus eliminating need for a panel, wiring, led lights, and switches.
@brendanpratt7760
@brendanpratt7760 Жыл бұрын
interesting video. How do I add more switches/buttons on a Uno to control separate turnouts, or do I have to go to a Mega to do that ? I'm still learning this. :)
@TomsTrainsandThings
@TomsTrainsandThings Жыл бұрын
DFRobot makes a shield where you can add more I/o to your device. I discuss this in several of my other videos www.dfrobot.com/product-1009.html
@brendanpratt7760
@brendanpratt7760 Жыл бұрын
@@TomsTrainsandThings thanks, I'm trying to find it amongst your dozens of helpful videos. :)
@willannand9988
@willannand9988 3 жыл бұрын
Revisited this video, lots of great information. One problem, I tried to download the code and the page was not available.
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
I'll have to update the web page link on the video. I got rid of the old web site back in December. Working on a new one, have a few of the sketches on the Project page. More to come soon. Tomstrainofthought.com
@arthurhouston3
@arthurhouston3 5 жыл бұрын
Tom Thanks but I got NCE figured out, to old to go make changed.
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Your welcome Arthur.
@ks1ngh27
@ks1ngh27 5 жыл бұрын
With Arduino mega I dont need this extra accessory? Can I control Kato turnouts with this?
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Yes you do. The PCA 9685 can handle the extra amperage needed for additional servos, the Mega can not handle more than 1 servo safely even though it has many more output pins. It's still limited to the available total amperage. If you can use servos with a Kato turnout .
@ModelSceneryTutorials
@ModelSceneryTutorials 3 жыл бұрын
Do you have a sketch to control only 4 videos with leds using only an Uno without having to spend money on the pc9685?
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
Here is a video on controlling a servo with an Uno; kzbin.info/www/bejne/rWSnfWB-Zcuto7s In order to control more than 1, you would need an external power source for the servos to drive them.
@Surajborate1
@Surajborate1 3 жыл бұрын
Thank you , very well explained Not able to open code link given in description .Please help me .
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
Thanks. I have a new web site, still under construction, but putting code in as needed tomstrainofthought.com/pca9685/
@jamesburba1995
@jamesburba1995 2 жыл бұрын
Tom, could you possibly show us how to completely wire, and code the Arduino and the PCA9685 with pushbuttons and LED position indicator lights on a control panel ? I have 29 turnouts, and servos, and would sure like to know how to make it all work. Thanks Tom !
@TomsTrainsandThings
@TomsTrainsandThings 2 жыл бұрын
Have you looked on my web site? That will point you in the right direction. The way you wire your mdel railroad is up to you. Everyone does it differently.
@safatkhan676
@safatkhan676 Жыл бұрын
Thanks for the video. What's the maximum current this thing can handle? My servos need about 1.5 amps each.
@TomsTrainsandThings
@TomsTrainsandThings Жыл бұрын
The power drawn comes from the external powwr you supply to your servos. The PCA9685 only supplies a signal to the servos. To determine the max current for the device, I suggest contacting the manufacturer.
@safatkhan676
@safatkhan676 Жыл бұрын
@@TomsTrainsandThings The PCA9685 is just the controller chip on this board, right?
@TomsTrainsandThings
@TomsTrainsandThings Жыл бұрын
@@safatkhan676 Yes, this is a breakout board for the chip, first offered by Adafruit
@safatkhan676
@safatkhan676 Жыл бұрын
@@TomsTrainsandThings Thanks for the informative video and responses.
@AbdulRahman-jz3px
@AbdulRahman-jz3px 2 жыл бұрын
What if I only need 5 Servo need to use this driver? which is better to use arduino PWM pins or servo driver PWM pins?
@TomsTrainsandThings
@TomsTrainsandThings 2 жыл бұрын
Even with 1 servo on the PCA9685. Using the PWM pins on the Arduino limits you to just 1 maybe 2 at the most. I wouldn't put anything else on that Arduino since you're pushing it;s amperage limit. Try what I have on this video: kzbin.info/www/bejne/roWcaXaZf8mjfqs
@daviddanhauer9301
@daviddanhauer9301 5 ай бұрын
Have you ever attempted an Arduino/JMRI controlled turntable?
@TomsTrainsandThings
@TomsTrainsandThings 5 ай бұрын
No, but there are many others on KZbin that have done the turntable with Arduino. Not so sure about with JMRI
@daviddanhauer9301
@daviddanhauer9301 5 ай бұрын
@@TomsTrainsandThingsThanks!
@federicosarnico
@federicosarnico 4 жыл бұрын
Hello Tom, How many Farad is capacitor on PCA9685
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
470uF
@dixiem2139
@dixiem2139 3 жыл бұрын
Hello sir, What is the safest way in using power supply assuming there's 32 servos running together at the same time,? Thank you.
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
Calculate the total amp draw of all the servos and use a power supply capable of handeling it. Servos drw very little amperage if your using the 9g or smaller.
@dixiem2139
@dixiem2139 3 жыл бұрын
@@TomsTrainsandThings thank you~
@pacificcoastminiatures
@pacificcoastminiatures 10 ай бұрын
So everyone is showing using a PCA9685 to drive up to 16 servos or more if you daisy-chain them. But you're limited to how many buttons you can plug into the Arduino to act as inputs. How do you overcome that limitation?
@TomsTrainsandThings
@TomsTrainsandThings 10 ай бұрын
You can run 16 servos on each pca 9685. You can also use a pce 8555 for pb there are many different devices you can use with I2C to increase inputs & outputs
@maestrojamesw
@maestrojamesw 4 жыл бұрын
Hi - I have an Arduino Mega successfully running DCC++. How do I get it to run the PCA9685 at the same time?
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Your best bet is to go on the Trainboard forum: www.trainboard.com/highball/index.php There are many modelers that do coding 24/7, they may be able to answer your question. Remember, the Arduino micro-controller is designed to perform 1 task at a time. Although you can stack tasks, there will be somewhat of a delay in performance. I use multiple Arduino's throughout my layout.
@maestrojamesw
@maestrojamesw 4 жыл бұрын
@@TomsTrainsandThings Thank you.
@johnmartin1740
@johnmartin1740 5 жыл бұрын
How do I use JMRI with this? Thanks
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Haven't tried this with JMRI. This is a solution without JMRI.
@javilagarde6852
@javilagarde6852 4 жыл бұрын
Hello Tom. Where is the arduino code of this example? It's very good!! If you can put the link here it would be great. Greetings and thank you very much for sharing.
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
All code for my projects are on my web page
@javilagarde6852
@javilagarde6852 4 жыл бұрын
Hello Tom. I was searching your website and I did not find the code for this project. Would you be so kind as to pass me the link or send it to me by email? Thank you very much greetings from Argentina. dj.jav1@hotmail.com
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
tomstrainsandthings.com/projects/
@lokivsfortune
@lokivsfortune 4 жыл бұрын
using ohmeter i rfound that the vcc and GND is connected ,,also the v+ (before i connect to anything) is my driver i sbroken already?
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
Sounds like you have a short.
@lokivsfortune
@lokivsfortune 4 жыл бұрын
@@TomsTrainsandThings thanks..., module is broken for sure.., if this 16ch servo shield can handle just about 5v, how about16ch servo driver shield (that stack in to arduino uno) can handle more than 5v?
@lokivsfortune
@lokivsfortune 4 жыл бұрын
@@TomsTrainsandThingsyes it is short,then i removed the capacitor and the module is not short...,
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
@@lokivsfortune Not sure why you had a capacitor in there. I did not show a capacitor in the diagram or video.
@anatoliidudko7029
@anatoliidudko7029 3 жыл бұрын
Ok. Thank you. But where is the most important part that explains wiring and for control panel? To be honest everything else is pretty easy to find online. I would be appreciated if someone could explain me how to wire control panel with this setup and where to find code for it. Thank you in advance.
@chazco
@chazco 5 жыл бұрын
I need to strengthen my base. Then I can safely build my layout
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
I need to rebuild mine. I'm going to build me a module or two!
@peterwhiting6303
@peterwhiting6303 5 жыл бұрын
How long can you make the servo cable?
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
I haven't tested the cables for the servos but I did a test on a 30+ ft length of Cat 5 cable for Tortoise switch machine and there was no issues.
@peterwhiting6303
@peterwhiting6303 5 жыл бұрын
@@TomsTrainsandThings I have never used a tortoise what is the drive signal?
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Tortoise uses an independent power source or operated through DCC devices not compatible with this subject. The point was the length of the cable tested.
@peterwhiting6303
@peterwhiting6303 5 жыл бұрын
@@TomsTrainsandThings I should have asked if the waveforms used to drive the Tortoise and the servo are similar to each other. This would make your tortoise test result useful. Perhaps I should try some tests. Thanks.
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
The tortoise takes DC, the servos take PWM
@mikepatatas6144
@mikepatatas6144 Жыл бұрын
ok what about the power supply? why do no one says what kind of power supply use for this.
@TomsTrainsandThings
@TomsTrainsandThings Жыл бұрын
5vdc power supply
@amelliamendel2227
@amelliamendel2227 4 жыл бұрын
Where do you get the min/max numbers?
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
The min & max adjusted value have to be calculated. I show how in one of my Arduino Made Easy videos.
@amelliamendel2227
@amelliamendel2227 4 жыл бұрын
@@TomsTrainsandThings calculated how? All I got is the spec sheet that says limit angle 200°+/-1° and centering divisions 1°. I tried random numbers and it just sounded like it was grinding so I stopped messing with it before I broke it. Where are you getting numbers to "calculate"? PLEASE
@TomsTrainsandThings
@TomsTrainsandThings 4 жыл бұрын
@@amelliamendel2227 have you watched my servo video in the series Arduino Made Easy? It explains it there.
@amelliamendel2227
@amelliamendel2227 4 жыл бұрын
@@TomsTrainsandThings I found it thank you for making these videos
@redmeeko
@redmeeko 3 жыл бұрын
I could not open your website. When are you going to share the code?
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
I shut down the web page at the end of December due to issues with the provider. Another one will be up in the near future.
@anatoliidudko7029
@anatoliidudko7029 3 жыл бұрын
@@TomsTrainsandThings Really hope we will get your website soon. I am very new into this hobby but it looks like nobody else explains how to control servos with 9685 + LED's and toggle switches. Everybody else use JMRI directly. So I desperately waiting for your new website to get wiring diagram and other info to build same system. Thank you again for your great youtube channel.
@martinhilvers1213
@martinhilvers1213 3 жыл бұрын
Why do you use #define instead of const?
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
That code is from Adafruit as noted in the header. A lot of her older code uses Define, probably because of "C"
@martinhilvers1213
@martinhilvers1213 3 жыл бұрын
@@TomsTrainsandThings const is preferred www.arduino.cc/reference/en/language/structure/further-syntax/define/
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
The good thing about Arduino is the availability of code especially from other manufacturers, all one has to do is copy & past instead of writing your own code. If it works, don't knock it. I see Define and other terms used all the time in code. It works either way!
@njsurf1973
@njsurf1973 3 жыл бұрын
is your web page coming back?
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
As soon as I get my new house in order and have time to search for a new provider.
@njsurf1973
@njsurf1973 3 жыл бұрын
@@TomsTrainsandThings thanks!
@dzungnguyenviet7368
@dzungnguyenviet7368 Жыл бұрын
Have you got software training..
@TomsTrainsandThings
@TomsTrainsandThings Жыл бұрын
Self tought!
@gamepad3173
@gamepad3173 2 жыл бұрын
oh boy, for the project that I'll be working on yeah this is going to come in handy for building 193 countries (in G scale, O and OO/HO).
@TomsTrainsandThings
@TomsTrainsandThings 2 жыл бұрын
Glad it was helpfull
@Alex-td2bf
@Alex-td2bf 3 жыл бұрын
Has anyone tried adding Bluetooth to this?
@TomsTrainsandThings
@TomsTrainsandThings 3 жыл бұрын
Not that I'm aware of. Wifi, but not bluetooth
@darrenwilliamsrichardsonva394
@darrenwilliamsrichardsonva394 5 жыл бұрын
Tom thank you your videos are a great resource especially for the beginners or the technical and programming challenged like myself. This is a great video I have been searching for this exact solution for my switch control! I am also looking at the 16 Channel Relay Board Module for Arduino as an option for controlling my switches up 32 I think. 00Rail made a video on this option but I am trying to work out how to put it together for more than 1 switch! The link to their video is kzbin.info/www/bejne/Y3K3gH59hbaaoc0. Again thank you for the great resources and keep up the fantastic work mate! Regards Darren from Australia!
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Glad I could help. I"ll check out this video shortly.
@TomsTrainsandThings
@TomsTrainsandThings 5 жыл бұрын
Glad I could help. I"ll check out this video shortly.
Arduino Slow Motion Servo Turnout Control
15:53
Toms Trains and Things
Рет қаралды 8 М.
Using Servo Motors with Arduino
43:06
DroneBot Workshop
Рет қаралды 1,4 МЛН
Just try to use a cool gadget 😍
00:33
123 GO! SHORTS
Рет қаралды 84 МЛН
🌊Насколько Глубокий Океан ? #shorts
00:42
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 19 МЛН
Mastering Servo Control: PCA9685 PWM Driver with Arduino Tutorial and Demo
7:50
Arduino e PCA9685 (16 canali PWM via I2C) - Video 234
8:49
paolo aliverti
Рет қаралды 13 М.
Updated: Using Servo's to control Model Railroad Turnouts
9:03
138 Arduino PCA9685 - no library - PWM and a WHITEBOARD!
25:58
Cheap Controls
Рет қаралды 4,9 М.
How to Control a 12V Motor with Arduino: Easy Wiring & Code Examples
44:13
Arduino Multiplexor - MUX INPUTS & OUTPUTS - ANALOG and PWM
13:21
Electronoobs
Рет қаралды 99 М.
Connect Up To 992 Servos To An Arduino, Using I2C
7:47
Michael Klements
Рет қаралды 63 М.
Berbagi permen ke orang bisu‼️
0:15
Abil Fatan Key
Рет қаралды 3,9 МЛН
Самый ХИТРЫЙ сын!😀
0:57
Petr Savkin
Рет қаралды 2,6 МЛН
small vs big hoop #tiktok
0:12
Анастасия Тарасова
Рет қаралды 11 МЛН
اكلت كل الشوكولا🥹🍫
0:22
Zain -Alaa
Рет қаралды 67 МЛН
Девушке Роналду не нужны его деньги 😎
0:41
КИК Шорт!
Рет қаралды 3,7 МЛН