Offline
Newbie
Karma: 0
Posts: 27
|
 |
« on: December 20, 2012, 09:47:09 pm » |
Hi All, I am brand new to this space, so new in fact that Santa has not given me my new Ardunio yet. At this stage I have only 1 question, but it seems pretty fundamental. There are not many pin outs on the board (14 is it?) - http://www.gammon.com.au/forum/?id=11473How do I go about adding lots of breakout boards or shields, that use up 15 ports? Or, in its most simple example (I assume), how would I add 20 independently controlled LEDs? thanks Greg Edit: Maybe LETs are a bad example ( http://electronics.stackexchange.com/questions/1609/how-many-individual-lights-can-an-arduino-control), but what I am trying to work out is how to add lots and lots of different sensors.
|
|
|
|
« Last Edit: December 20, 2012, 10:00:00 pm by gggggggg »
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Online
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #1 on: December 20, 2012, 10:24:43 pm » |
You can use shift registers (eg 74xx595, 74xx165)to get more digital in and outputs. MUXes (eg 4067, 4051) to get more analog inputs.
______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 27
|
 |
« Reply #2 on: December 29, 2012, 02:21:27 pm » |
Thanks for your help.
By the way, I am also in QLD, where do you get most of your kit from?
thanks
|
|
|
|
|
Logged
|
|
|
|
|
St. Petersburg, FL
Offline
Jr. Member
Karma: 1
Posts: 61
Retired physicist
|
 |
« Reply #3 on: December 29, 2012, 03:02:42 pm » |
A decoder chip will give you more outputs. For example, the 74LS138 will set eight output lines using only three output pins. Conversely, a 74LS148 will watch eight lines and present the results on three input pins.
There are numerous analog and digital chips to expand and compress signal lines.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Online
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #4 on: December 30, 2012, 08:31:24 am » |
I am also in QLD Where? where do you get most of your kit from? I bought a stack of stuff from Jaycar when I got back into electronics about 2-3 years ago, but mostly I buy from Mouser, E14, etc. Not that I buy much as I mostly write code and design things these days rather than actually build anything. I do have a set of boards coming soon though, all the components were bought from Mouser. A decoder chip will give you more outputs. For example, the 74LS138 will set eight output lines using only three output pins. But they can't be latched so normally that's not much use unless you only want a single active output at a time. ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
St. Petersburg, FL
Offline
Jr. Member
Karma: 1
Posts: 61
Retired physicist
|
 |
« Reply #5 on: December 30, 2012, 09:08:34 am » |
But they can't be latched That's true. As long as the address lines driving the chip remain set then that particular output is active. There are latch chips that can be used to hold the desired state. I don't have a chip number in mind but it would be something like the set and clear pins on a JK flip-flop. You could use a 4 - 16 decoder and some JK chips. The lower eight bits( or even bits ) could set a JK and the upper eight( or odd bits ) to clear the same JK. There are probably better choices for chips but this would work.
|
|
|
|
|
Logged
|
|
|
|
|
St. Petersburg, FL
Offline
Jr. Member
Karma: 1
Posts: 61
Retired physicist
|
 |
« Reply #6 on: December 30, 2012, 09:33:45 am » |
The CD4043/44 latch will give you four sections. Two of these chips and a 4-16 decoder will then latch eight outputs and use only four input lines.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Online
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #7 on: December 30, 2012, 09:51:39 am » |
There are latch chips that can be used to hold the desired state. I don't have a chip number in mind I think the 4099 will do the job. It's probably easier (well fewer pins) to use a shift register, but an addressable latch would be faster. ______ Rob
|
|
|
|
« Last Edit: December 30, 2012, 10:32:43 am by Graynomad »
|
Logged
|
|
|
|
|
St. Petersburg, FL
Offline
Jr. Member
Karma: 1
Posts: 61
Retired physicist
|
 |
« Reply #8 on: December 30, 2012, 10:30:30 am » |
I looked at that chip but the part that bothered me is that it uses a master reset for all output bits. Individual bits can be set but not reset.
Another idea would be to use two 4-16 decoders( CD4514 ) and four quad latches. One decoder sets the 16 latched outputs and the other clears the outputs. It would take only six digital outputs to control the 16 latches. Four address lines would be common to both decoders, the fifth line would strobe both chips, and the sixth line would enable one chip to set, or the other through an inverter to clear.
|
|
|
|
|
Logged
|
|
|
|
|
Indiana, US
Offline
Full Member
Karma: 12
Posts: 161
|
 |
« Reply #9 on: December 30, 2012, 10:48:18 am » |
Well... It's December 30th now, so I hope Santa brought you an Arduino instead of a lump of coal! Here are a few thoughts: Keep counting! The 6 analog pins can be used as digital IO also. They are just specialized to provide analog input (they can read voltages between 0 and 5v and return values from 0 and 1023). As you can see from the detailed responses to your simple question, there are a lot of ways to control a multitude of sensors and outputs. For now, ignore all this and start with something more fundamental like controlling one LED, or 20. Adding multiplexing is theoretically simple, but can be difficult for someone just starting out. There are a lot of good resources available on this site, and elsewhere online to get you up to speed quickly. you cant beat the "Arduino Cookbook" [2nd Ed.] for a complete set of sketches, from simple LED control to more complex sketches. Enjoy! Pat.
|
|
|
|
|
Logged
|
There are 10 types of people in the world, those that understand binary, and those that don't.
|
|
|
|
St. Petersburg, FL
Offline
Jr. Member
Karma: 1
Posts: 61
Retired physicist
|
 |
« Reply #10 on: December 30, 2012, 11:35:45 am » |
Keep in mind that the Due has digital pins D2 through D53 and A0 through A11.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 249
Posts: 16568
Available for Design & Build services
|
 |
« Reply #11 on: December 30, 2012, 12:16:12 pm » |
74HC595 is good for shifting in & holding 8 outputs. TPIC6B595 is much better for the same, use pullup resistors to pull output to whatever voltage you need, (9V, 12V), outputs will sink 150mA continuously.
Only need 3 pins to control can daisy chain many for more outputs, or wire clock/data in parallel to all and use seperate latch signal for each.
|
|
|
|
« Last Edit: December 30, 2012, 12:17:46 pm by CrossRoads »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 27
|
 |
« Reply #12 on: January 01, 2013, 10:58:50 pm » |
Thanks all for the detailed response. Santa was nice to me, and I have been learning to use the soldering iron with much success.
Now to try to get everything to work together. The plan is to put it all in a Weather Balloon. Greynomad I am near Gatton, just finished 2 years going around Australia myself (though not sure I could do 12), time to settle down as the kids start school. I will give Mouser a try, thanks.
|
|
|
|
|
Logged
|
|
|
|
|
|