Hi, I'd like to send a binary code to 8 relays (I need 128 steps). What would be the best way to turn these relays on by sending a binary string to the arduino?
merlin2049er:
Hi, I'd like to send a binary code to 8 relays (I need 128 steps). What would be the best way to turn these relays on by sending a binary string to the arduino?
Do you mean like sending a string such as "01101110" through the Serial connection and turning on the eight relays based on the individual characters?
Assuming these are DC controlled relays, If you are trying to turn on 8 different relays at roughly the same time, I would look into a shift register. You can then have the shift register drive a transistor to turn the relays on or off. Or the Arduino could control all 8 directly using a transistors as well, but that uses up 8 pins and therefore limits your other options, but I would not connect them directly to the Arduino.
If you are trying to do Serial communication, this is a poor choice.
Ok, I've got a relay board already. I guess I can use the arduino to directly turn on the various relays need for the output.