0

I am a mechanical engineer starting my journey with Arduino, so please excuse me if I put some very generalized message.

  • I need to sequentially operate 20 output relays, and then verify if the correct relay has been triggered. If the correct relay was triggered, the next relay will be triggered after a delay of 1-2 seconds.
  • I plan to do this with an Arduino Uno so that I can generate error messages if any output has not been triggered.

However, the Uno doesn't have sufficient inputs and outputs to do this. So what are my options?

I want to ask you the below:-

  1. If there are I/O expansion boards available for the Uno? If yes, sharing the details will be helpful;
  2. A friend recommended to use a multiplexer. Can I use a multiplexer to convert a 4 pin output from the Arduino to 16 pin output, and probably use the saved pins to monitor the inputs? If yes, how?
  3. Is there something available like a reverse multiplexer wherein the chip can convert the 16 output signals to 4 pin inputs to the Arduino?

Please let me know the best solution wrt the below parameters - reliability of operation, cost, compactness.

Thanks for your time and support.

8
  • 1
    use a multiplexer to convert a 4 pin output from arduino to 16 pin output ... no, use a de-multiplexer for that, but that would energize only one relay at a time
    – jsotola
    Commented Nov 20, 2021 at 4:05
  • please describe in detail how the relays are supposed to behave
    – jsotola
    Commented Nov 20, 2021 at 4:08
  • 1
    your question is not arduino specific ... it is off topic here ... better fit at electronics.stackexchange.com/questions
    – jsotola
    Commented Nov 20, 2021 at 4:08
  • At any moment of time, only 1 relay will be switched on. I plan to use the Normally open connection of relay to switch on a motor. The "normally closed" connection will taken as a input to verify that only one relay has switched on. I hope this is what you meant to ask. The reason why i asked here is to ask if there are any I/O expansion boards for Arduino uno
    – DMP
    Commented Nov 20, 2021 at 4:55
  • Is there something available like a reverse multiplexer ... that is incorrect ... you are describing a multiplexer here ... hackaday.com/wp-content/uploads/2016/08/mux-demux.gif
    – jsotola
    Commented Nov 20, 2021 at 4:58

2 Answers 2

2

Look for port expansion boards for the arduino, there are a lot of them many under a dollar. Typically they are in 8 or 16 channel designs. They probably will have PCF8574 or PCF8575 chips. These are low voltage (typically 5V) for the Arduino. You will have to use an interface if it is connected to another voltage. Each of these modules the channels can be individually programmed as an input or output. You can turn on or any of the outputs in any order and pattern you want. These devices operate with the I2C interface so you need only two lines from the Arduino to drive up to 8 of these modules. The pins should be labeled A4 (SDA), A5 (SCL) depending on the model of Arduino you have. Good luck!

1
1

Instead of using expansion boards, you could use an Arduino Mega or an Arduino Due instead. These have more than enough GPIO pins for 20 inputs and 20 outputs. The price isn't much higher compared to the extra expansion board and the extra wiring required.

1
  • If going this route keep in mind that the Mega is 5V (like the Uno) but the Due runs on 3.3V. You’ll likely want to match to your selected relays and sensors.
    – RowanP
    Commented Nov 21, 2021 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.