2 Electromotors circuit

hello,
I am absoloute dummy in electrical circuits, so please can you help me with my project?

My idea is circuit with two electromotors and button.

After 1st button press I need:
Motor 1 spins into certain position
After that motor 2 spins into certain position
After that motor 1 spin back to start position
Done

After 2nd button press I need:

Motor 1 spins Into certain position
After that motor 2 spin back into start position After that motor 1 spin back to start position
Done

Afrer this another button press acts like 1st and another 2nd again, again... Any idea?

How to make this idea real ? I 'd use some gearbox but it is not possible for this project

More info:
I have little doors (plastic cover) that I want to connect to motor no.1 and little screen to pop up thats connected to motor n.2

So I want to push button
door opens
screen slides out
door closes

and another button press
door opens
screen slides back
door closes

I thought to use arduino micro(I need as small as possible) and some cheap rc servo

Is my idea realizable ?

Thank you :slight_smile:

cross95:
Motor 1 spins into certain position
After that motor 2 spins into certain position

cross95:
I thought to use arduino micro(I need as small as possible) and some cheap rc servo

Are these "motors" and your "servos" the same things?

If this is the case, it makes your project pretty easy.

cross95:
Is my idea realizable ?

Using push buttons to control servos? Absolutely.

Start by learning to control servos and to read button presses.

When you get stuck post your code (the right way) and we'll be glad to help.

Thank you sir :slight_smile:

Well, last few days I was watching youtube tutorials and reading tons of texts :smiley:

I think I know how to connect servos, how to set positions on them etc. I think I know how to connect servos to arduino and code it.

The only thing I don´t know is how to do button press changes.

I´ve found only button hold changes... basically

I have two pieces of code and want to start after button press not hold.

1st button press first piece of code.
2nd button press second piece of code.
3rd button press first piece of code again. . . .

thats the only thing I don´t know yet :smiley: maybe some boolean variable and if question :slight_smile:

Don't have arduino here yet:(, I've oreded it last week so I don't have code to show :slight_smile:

cross95:
Don't have arduino here yet:(, I've oreded it last week so I don't have code to show :slight_smile:

The Arduino IDE includes a lot of examples. Make sure you work through the examples about using buttons. These should help.

You'll want to use a variable to keep track of button presses.

You'll find people more willing to help if you've tried to write the code yourself first. As Delta_G and I mentioned earlier, if you get stuck and need help, post your code and there will be plenty of people willing to help.

Have a look at the way the code is organized in Planning and Implementing a Program.

In effect, you have two processes. One reads the buttons and stores a value representing which button was pressed. The other process moves the servos according to the saved value. It may also reset the value when it is finished. The saved value is the only point of communication between the two processes.

...R

Hello,

Well I think I have sorted my code, may I ask question about power supply ? :slight_smile:

I have arduino nano and want to power it by USB in my car (12V?) I have USB adapter like this

http://m.belkin.com/us/p/P-F8J071/

So here comes my question I need use one port to charge my phone (xperia Z1) and second to arduino(with 2 connected servos)

So is it 100% safe? Is my power supply enough?

Thank you

Referring to Reply #6 ...

That power supply should be fine. However you should not power the servos through the Arduino - they should be powered directly from the power unit. That means getting a cable to split one of the outputs in two so you have one output for the phone, one for the Arduino and one for the servos.

...R