Answer the question
In order to leave comments, you need to log in
One microcontroller + many devices
Hello everyone, the question is this, let's say a standard AVR ATmega 32A has 22 ports, my task is to connect about 150 relays + about 50 sensors to one microcontroller. How is this done, by some kind of cunning manipulation, or are there other chips? Does anyone have experience connecting a large number to the Arduino?
PS I'm sorry, first I accidentally posted in the posts ...
Answer the question
In order to leave comments, you need to log in
There is such a thing "IO Expander". Connects to MK, for example, via I2C. Works like a regular I/O port, only external. You can build a big garland.
The older STM32 has more than 150 ports, but it’s worth making a more distributed system for your task. 150 relays still can't be put side by side.
You can use a shift register such as 74HC595.
Multiply outputs with 74HC595 shift register
Connect a bunch of devices to Arduino with 5 wires
RS485 protocol, if the relays and sensors are equipped with an appropriate control harness.
If the incoming and outgoing signals require only logic levels, you can build a multiplexer / demultiplexer circuit (encoder / decoder) (binary-to-decimal converter (and vice versa)). They are simply cascaded, 3 ports can address 255 inputs and 255 outputs, 4 - independently read / write. But a very cumbersome circuit will come out. (They are usually 16 inputs / outputs)
You can reduce the number of busy legs using counters or shift registers, to form an address / receive / set data, you can fit into 1 port, but this is an endless count, cycles, brrrr .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question