Go Down

Topic: New to Arduino (Read 2228 times) previous topic - next topic

gggggggg

Dec 21, 2012, 03:47 am Last Edit: Dec 21, 2012, 04:00 am by gggggggg Reason: 1
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=11473

How 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.

Graynomad

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
Rob Gray aka the GRAYnomad www.robgray.com

gggggggg

Thanks for your help.

By the way, I am also in QLD, where do you get most of your kit from?

thanks

Arctic_Eddie

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.

Graynomad

Quote
I am also in QLD

Where?

Quote
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.

Quote
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
Rob Gray aka the GRAYnomad www.robgray.com

Arctic_Eddie

Quote
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.

Arctic_Eddie

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.

Graynomad

#7
Dec 30, 2012, 03:51 pm Last Edit: Dec 30, 2012, 04:32 pm by Graynomad Reason: 1
Quote
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
Rob Gray aka the GRAYnomad www.robgray.com

Arctic_Eddie

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.

patduino

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:


There are not many pin outs on the board (14 is it?) - http://www.gammon.com.au/forum/?id=11473


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.
There are 10 types of people in the world, those that understand binary, and those that don't.

Arctic_Eddie

Keep in mind that the Due has digital pins D2 through D53 and A0 through A11.


CrossRoads

#11
Dec 30, 2012, 06:16 pm Last Edit: Dec 30, 2012, 06:17 pm by CrossRoads Reason: 1
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

gggggggg

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.

Go Up