Pages: [1]   Go Down
Author Topic: Not enough I/O pins  (Read 1616 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey all,

I recently decided to take my first dive into the arduino pool and have come up with what I thought was a fairly simple project.  However, after pondering on the details for a short time I realized I might have more work ahead of me than I thought.  The problem is that I need to be able to read analog input from 10 different photocells and use that information to control the output of 10 corresponding digital I/O pins. This is a problem since the arduino only has 6 analog input pins.  I thought for a bit that I could multiplex the inputs using a 3/8 multiplexer, but that would require the use of 3 digital I/O pins, thereby leaving me at least 1 short in that department since there are only 12 available to begin with.

I guess my question is, short of getting another board is there any way to have read so many inputs and still have control over so many outputs individually?

EDIT: I should also mention that the digital I/O pins are to be driving individual transistors which are in turn driving 6 LED's each.
« Last Edit: June 21, 2010, 01:13:56 am by specialedster » Logged

Somewhere in Arizona
Offline Offline
God Member
*****
Karma: 0
Posts: 725
Arduino must be a drug, because I'm addicted!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

google: "analog to digital converter"
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 5
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Use a cd4051 analog mux to get 8 more analog ins (at the cos of one aanalog and 3 digital pins).

If you still need more digital outs use 74hc595 shiftregisters to add more.
Logged

Sussex UK / CT USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1028
Forums forever
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A RBBB Arduino clone (http://www.moderndevice.com/) kit costs $12.50 + very reasonable p&p. Easy to assemble, and if you don't want to assemble, assembled units are also available.

Could your project be done simply by using two Arduinos?
Logged

Cape Town, South Africa
Offline Offline
Full Member
***
Karma: 0
Posts: 177
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

MCP23xxx series  8/16 port(pin really) I/O expanders. I2C or SPI.
« Last Edit: June 21, 2010, 03:35:30 am by leppie » Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 514
Posts: 31548
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For analogue multiplexing see this project:-
http://www.thebox.myzen.co.uk/Hardware/MIDI_Footsteps.html

For extra I/O with fast access use the MCP23S17 - 16 extra I/O and you can use up to 8 of them directly giving up to 128 digital I/O.
Logged

Cape Town, South Africa
Offline Offline
Full Member
***
Karma: 0
Posts: 177
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
For extra I/O with fast access use the MCP23S17

I'm so badly trying to get hold of them, but RS has no stock currently...  smiley-sad
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 514
Posts: 31548
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Farnell have 457 in stock:-
http://uk.farnell.com/microchip/mcp23s17-e-sp/16bit-i-o-expander-spi-23s17/dp/1292238
Logged

Cape Town, South Africa
Offline Offline
Full Member
***
Karma: 0
Posts: 177
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Farnell have 457 in stock:-

Pity that I am in South Africa.  Should have asked the English football team to bring me some   :smiley
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 514
Posts: 31548
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The do South Africa as well:-
http://export.farnell.com/jsp/home/homepage.jsp?_DARGS=/jsp/home/exportHome.jsp_A&_DAV=en_EX_DIRECTEXP

or choose S.A. from:-

http://farnell.com/
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 112
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why not use 2 or more Arduinos to do this?
« Last Edit: June 21, 2010, 09:07:23 am by bastukee » Logged

No trees were harmed by the transmission of this message. However a few million electrons were temporarily inconvenienced.

Louisville, KY
Offline Offline
Full Member
***
Karma: 0
Posts: 101
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not sure how quick shipping would be to you from Taiwan (it took about 10 days to Kentucky in the US),
but Futurlec has the MCP23S17 for $1.35 US.  

http://www.futurlec.com/cgi-bin/search/qty_price.cgi?part_no=MCP23S17
Logged

SF Bay Area
Offline Offline
Edison Member
*
Karma: 10
Posts: 1235
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got the I2C version of that chip already built up into a shield: Centipede Shield

Though the default Arduino I2C speed is 100KHz, it's still pretty fast. We've had no problems detecting lots of simultaneous button presses just by polling, not even bothering with the interrupt and latch feature. The MCP23017 can support up to 1.7MHz I2C so there is room to tweak the Arduino I2C implementation if more speed is really needed.
Logged

Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store

Cape Town, South Africa
Offline Offline
Full Member
***
Karma: 0
Posts: 177
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Though the default Arduino I2C speed is 100KHz, it's still pretty fast.

I got a couple of MCP23016's.

Mine runs pretty good at 400khz, after I tweaked the Wire libs.

With a few other I2C devices, I had to drop it to 300khz though.
Logged

Cape Town, South Africa
Offline Offline
Full Member
***
Karma: 0
Posts: 177
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Finally found the local distributors for Farnell. Pretty close to me in fact.

Thanks Grumpy_Mike  smiley
Logged

Pages: [1]   Go Up
Jump to: