i want to make a piano playing robot

hello guys and thank you taking a moment to read this post, i have an idea for a piano playing robot, it will require 20 servo motors, and 2 motors either side to move the hands up and down each side of the piano, I already have a good idea on how the mechanisms will work, what im really asking you guys is, how can i control 20 servo motors with 1 arduino board? which arduino board would be best and easiest to do this, and if anybody can provide link to how i could do this i would apprechiate it, also what kind of motor controller board will i need to use with the arduino and the 20 servo motors? i got some inspiration from this video controlling 20 servo motors Arduino UNO controlling 20 Servos with 15 bit precision and low jitter - YouTube

next i would like to ask some advice on the best way to start learning to program something like this, like how to program the servo motors and time them perfectly to play songs, i understand it wont be easy but just some advice on how to start would be greatly apprechiated :slight_smile: id like to add im new to arduino programming and i know this isnt going to be easy and is gonna take a long time and some serious commitment but im prepared to do it ive been thinking about this for a while, i already have a roboclaw motor driver and two 12volt dc motors which i have hooked up to an arduino from a seperate project, i thought maybe to move the hand i could hook one motor up to each hand, having it travel over a pulley chain from one side to the other with a limit switch the change the direction of each motor if possible, i own a 3D printer so all these parts and mechanisms can be made, id like to know what you guys think of this idea, if you think it is feasable, and the best way to go about learning what i need to know to do it.

in summery the main thing id like to know is, the best way to control 20 servo motors from one arduino board ( the two 12 volt dc motors can control the hands sliding up and down the keyboard from a separate arduino board)
and the best way to learn to program all of those servos and also the two DC motors to work accurately and effectively to play a song accurately

i would like the finished product to work like the one in this video

i feel like this could be a great learning experience for me, if i can pull this off with the help of you guys

thank you so much for reading this :slight_smile: and please keep in mind that i am a beginner thank you :slight_smile:

i would like to build a piano playing robot, i need to be able to control 20 SG90 9G analog servo motors from one arduino board, i was wondering if somebody could tell me the best arduino board to achieve this, and also maybe point me in the right direction of how to program all of them so that the timing is good enough to play songs and if i need any arduino expansions or a real time clock, or anything else that is required, if more info is required please let me know and i will provide more, please keep in mind that i am a beginner to arduino and C++ programming

thank you very much for your time its greatly apprechiated :slight_smile:

An ambitious project :slight_smile:

I'd start with the mechanical part. Also look for Servo Controllers that can address many servos. Perhaps two controllers are required, each for one hand - see later.

Big project, a main concern might be that a typical servo usually does not move fast enough to play a mechanical piano (maybe an electronic keyboard). Servos do not need drivers, they just need a good power supply. To control a lot of servos the simplest thing might be to get a couple slave uno/megas to control the individual servos and a master uno/mega to command the slaves.

[u]Solenoids[/u] are probably better for striking the keys. The software is easier (as easy as blinking an LED) but you need a driver circuit.

You may need stepper motors or something like that to position the solenoids.

zoomkat:
Big project, a main concern might be that a typical servo usually does not move fast enough to play a mechanical piano (maybe an electronic keyboard). Servos do not need drivers, they just need a good power supply. To control a lot of servos the simplest thing might be to get a couple slave uno/megas to control the individual servos and a master uno/mega to command the slaves.

a big thank to both of you for replying, and well, it will actually be playing an electronic keyboard, i just typed piano because its quicker, i have read about a servo driver called the PCA9685 have you heard of this? it can control up to 16 servos but you can have another stacked on top of it to control 32 servos from 1 arduino board i believe of which i will only use 20, but one question when you say 2 slaves unos and 1 master uno, you do mean that all 3 are the same type of arduino board right? just that one controls the other 2 boards? and how many servos can 2 arduino boards control? because to do this i would need both to control 10 servos each, are you sure i could do this with no drivers?

Using the Servo library and an Arduino Mega you can control up to 48 servos.

You will need a pretty beefy external power supply for the servos. Each servo will need at least about 1 Amp.

If servos aren't fast enough, solenoids may be required.

groundFungus:
Using the Servo library and an Arduino Mega you can control up to 48 servos.

You will need a pretty beefy external power supply for the servos. Each servo will need at least about 1 Amp.

If servos aren't fast enough, solenoids may be required.

thank you so much! how much power can the arduino mega take maximum? with the arduino uno its only 5 volts so i wouldnt have imagined it would be much more than that? but maybe im wrong

A PCA9685 breakout board (Adafruit/ebay) could be easier.
You can plug 16 servo connectors onto the pinstrips of the board, and the board has a servo power connector.
Several of these boards can be daisy-chained, and connected to any Arduino (Uno, Nano, etc.).
Leo..

@DVDdoug
Plaing the piano calls for hitting the keys being sencitive with quite some variation, not hammering the keys down.
Maybe use an electronical keybord hocking up to the connectors of the keys would be an alternative. The noice from all the servos and stuff might be disturbing.

thank you very much and can i connect to of the to just one arduino uno? :slight_smile:

"but one question when you say 2 slaves unos and 1 master uno, you do mean that all 3 are the same type of arduino board right? just that one controls the other 2 boards? and how many servos can 2 arduino boards control? because to do this i would need both to control 10 servos each, are you sure i could do this with no drivers?"

That would be a good homework assignment for you to get up to speed with the components you are working with.

The PCA9685 is an I2C bus device that would take only 2 pins and would work with an Uno.

The Arduino only supplies control signals to the servos. The power for the servos* must come from an external power supply.

  • Or any other device that needs more current than a few 10’s of mA.

@Ngrace94

TOPIC MERGED.

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum.
Continued cross posting could earn you a timeout from the forum.

Bob.

I'll add my vote for a solenoid style mechanism being more likely to work - some experimentation is definitely required here.

Remember to teach your robot boogie-woogie though :slight_smile: