hi all,
i'm a beginner with arduino nano, made some little tasks like
switching led, writing to lcd, controling a servo an so far
my world is model railway
for this i want to control as many of controling units (like signals, railroad switches..)
by a list of flags (on,off) as possible with One Arduino (Nano), but the number of pins
for output available is limited..
I considered about using more than one Nano additionally coupling them
in a certain way.
I considered about multiplexing, but didnt understand
what i found in this forum..seems is possible with arduino ..
please tell me the simplest way to realize such a project :
I dont need programming advices as have some experience with c and java
want to find documentation to understand principles
look for infos (links) about additional components if needed
Using an I2C I/O expander can significantly increase the amount of pins available.
EDIT - Another option if you already have the parts and don't want to spend money is to use another Arduino as an I/O expander using Serial. This is an idea I had a while back but haven't tested, and it may work. You will have to program two boards though.
There may be other, applicable, devices depending on what you want to drive. Like high current shift registers or specialized LED drivers. We can make recommendations for appropriate devices based on individual needs.
thanks all for advices..at now i simply guess SDL and SDA connect to Arduino (like
my lcd-modul) and GP-PINS connect to my railway parts like motor-bridge, signals,
switches..ok ?
SDL + SDA could be multiple connected by more than one expander, i.e ,
A0-A7 are 8 pinss = 4 expanders at 1 Arduino = 4 * 10 = 40 output-pins, ok ?
Whow !
that fits for my actual railroad..some pins are used otherwise i.e. for my lcd-device..
I am not sure that you understand the I2C bus. Many devices connect to those same 2 pins (SDA, SCL). Each device is identified by its unique address. There are 8 addresses available for each I2C expander chip. So you could have 8 MCP23017 chips connected to the I2C bus. That would give you 128 GPIO pins (16 GPIO x 8 addresses) by using 2 Arduino pins.
The Serial or SPI takes 3 Arduino pins - you can put several chips in a row and the 1 st chip will pass data to the 2nd chip and the 2nd chip to the 3rd chip etc so you can control many chips in a row with the three pins. The chips don't have individual addresses - you send a stream of 8 bit words for the 74HCT595 chip - then enough words have been sent you tell the chips to update their state. My last application I had 4 chips (4 x 8 = 32 outputs) on the three outputs of the Arduino.
Note on the 74HCT595 chip - you can't turn on all the outputs at 20ma at once as you will overload the chip. When I have wanted more outputs on at the same time I have used the TPIC6B595 - programs the same but sinks instead of sourcing like the 74HCT595