Go Down

Topic: [HELP] Controlling more analog/digital pins. (Read 1 time) previous topic - next topic


May 10, 2013, 12:03 am Last Edit: May 10, 2013, 01:00 am by syst3mboot Reason: 1
So Im working on a project that will have a lot of sensors (more than the number of pins available on the arduino uno).
I will need about 20 Analog In pins and about the same for 15 Digital In/Out and 15 Analog Out.

I looked up some tutorials and found out that this can be done using shift registers but my question is which shift register would i need for Analog IN, for Analog OUT, and for Digital IN/OUT. Also if you have a tutorial that explains how to use them (with code examples) for newbies i would appreciate it.



Digital shift-in : 74HC165
This tutorial uses the CD4021 : http://arduino.cc/en/Tutorial/ShiftIn
Digital shift-out : 74HC595

This is a step-by-step tutorial for shifting out digital pins, http://learn.adafruit.com/adafruit-arduino-lesson-4-eight-leds/overview

Digital shift-in and shift-out registers can be cascaded. You can get many digital inputs and outputs that way.
With 2 shift-in and 2 shift-out ic's you have 16 inputs and 16 outputs.

For analog inputs, you need either a mux or ADC chips.
A mux (multiplexer) is like a switch that selects one of the analog signals.
Nick Gammon wrote a page about the mux : http://www.gammon.com.au/forum/?id=11976

The Arduino Mega 2560 has 16 analog inputs.
But if you use 3 mux ic's with 3 analog inputs, you can select 24 analog signals.

If you need high accuracy, you should use an external ADC chip.

What do you mean with analog out ?


May 10, 2013, 04:40 am Last Edit: May 10, 2013, 10:06 am by syst3mboot Reason: 1
Thank you very much, explained everything :)

EDIT: And by Analog Out I meant PWM Pins (it was my mistake).


You can't easily get extra PWM outputs. You have to use something like a TLC5940 ad that takes a bit of driving. Fortunately there is a library for that.

Go Up