noobie question

Ok I have an idea for a project. It would consist of 5 simple (on/off, forward/reverse only) dc motors, 1 stepper motor, 1 solenoid, 10 to 15 position switches (probably photo sensors) and 5 momentary push buttons.

My question is, how many of the digital I/O pins are required to drive the simple DC motors? How many for the stepper motor?

Thanks,
Steve

If you want the motors to move in both directions, that’s two I/O pins. [10]

Stepper motor, 4 to 6 [16]

10 - 15 switches, if formed as a 3 x 5 matrix: that 8 [24]

So, the Arduino has 19 I/Os…

But you can use a Stepper Motor driver IC, and some other I/O expanding ICs.

Ben aka /me

…So, the Arduino has 19 I/Os…

Actually that is not quite right, although I usually say 19 myself. Being the RX pin is best left for serial communication. (In my opinion.)

Arduino w/ATMega168 has 20 I/O

And one could go for the Arduino Mega which has 54 I/O.

Stepper motor, 4 to 6 [16] … But you can use a Stepper Motor driver IC, and some other I/O expanding ICs.

I propose H bridges and two 595 Shift Registers. Now the total pin usage is [3].

:slight_smile:

Thanks guys,

This is exactly what I was looking for.

What is ment by “3X5 matrix”?

Steve

Thanks for the clarification.

PS. One could say that my new screen name is - loosely- based around the idea of yours, AlphaBeta.

Hope you don’t mind; it’s just more mature :slight_smile:

Ben aka /me

A matrix of switches would look like this formation: http://pinball.flippers.info/lampmatrixdiagram.jpg

So you basically scan across the columns of the matrix and test each switch on the row. It’s for keypads and the such.

For A LOT of switches, you can also interface a PS/2 keyboard.

http://www.google.com/search?q=ps/2+keyboard&domains=www.arduino.cc&sitesearch=www.arduino.cc

Ben aka /me

So what type of additional circuitry would be required to drive the motors (both the simple and the stepper)?

Would that extra circuitry fit on one of the Arduino boards or is that where these “shields” come in?

Speaking of shields…what exactly is a “shield”? Is it essentialy a daughter card to the main controller card?

It’s a similarly shaped board that has all the necessary pins broken out. This allows you to work with expansion ICs or prototyping boards on a similar platform.

Basically, it saves space and time. Also because the Arduino isn’t particularly breadboard friendly!

Ben aka /me

@AlphaBeta, How did you quote portions of previous posts in your post? Most other forums I frequent have a “Quote” button but none to be found here.

How can I quote on this forum?

Oh I forgot one other part of my project. I will also have a 20X2 LCD display. How many pins are required to drive this?

Depending on the setup, you could drive this with as little as lines:

RS, EN, D4, D5, D6, D7

That’s obviously 4-bit mode.

/me

So by my count we are up to 30 pins. So I guess I should go for the Arduino MEGA.

Thanks for your help.

OK then. With that you also get: more PWM outputs, more UARTS, more Analogue In, more Interrupts and more memory.

Woot!

/me