Professional Documents
Culture Documents
current_site=arduino&setup=true&redirect_to=%2Fprojecthub%2Fchuygen%2F256-relays-
3f277d)
IO Expander
(/projecthub/products/buy/
× 1
70388?
( (/proj (/projecthub/products/b
s=BAhJIhMzMjYwNzQsUHJva
/ ecthu uy/70388?
mVjdAY6BkVG%0A)
p b/pro s=BAhJIhMzMjYwNzQsU
r ducts HJvamVjdAY6BkVG%0A)
o /buy/
j 7038
e 8?
c s=BA
t hJIhM
h zMjY
u wNzQ
b sUHJv
/ amVjd
p AY6B
r kVG%
o 0A)
d
u
c
t
s
/
b
u
u
y
/
7
0
3
8
8
?
s
=
B
A
h
JI
h
M
z
M
j
Y
w
N
z
Q
s
U
H
J
v
a
m
V
j
d
A
Y
6
B
k
k
V
G
%
0
A
)
Relay Expander
(/projecthub/products/buy/
× 16
70389?
( (/proj (/projecthub/products/b
s=BAhJIhMzMjYwNzQsUHJva
/ ecthu uy/70389?
mVjdAY6BkVG%0A)
p b/pro s=BAhJIhMzMjYwNzQsU
r ducts HJvamVjdAY6BkVG%0A)
o /buy/
j 7038
e 9?
c s=BA
t hJIhM
h zMjY
u wNzQ
b sUHJv
/ amVjd
p AY6B
r kVG%
o 0A)
d
u
c
t
s
/
b
u
y
/
7
0
3
8
8
9
?
s
=
B
A
h
JI
h
M
z
M
j
Y
w
N
z
Q
s
U
H
J
v
a
m
V
j
d
A
Y
6
B
k
V
G
%
0
A
)
)
Arduino Nano R3
(/projecthub/products/buy/
× 1
19172?
( (/proj (/projecthub/products/b
s=BAhJIhMzMjYwNzQsUHJva
/ ecthu uy/19172?
mVjdAY6BkVG%0A)
p b/pro s=BAhJIhMzMjYwNzQsU
(/projecthub/pro
ducts/buy/19172? r ducts HJvamVjdAY6BkVG%0A)
s=BAhJIhMzMjYw o /buy/
j 19172
NzQsUHJvamVjd
e ?
AY6BkVG%0A)
c s=BA
t hJIhM
h zMjY
u wNzQ
b sUHJv
/ amVjd
p AY6B
r kVG%
o 0A)
d
u
c
t
s
/
b
u
y
/
1
9
1
7
2
?
s
=
B
A
A
h
JI
h
M
z
M
j
Y
w
N
z
Q
s
U
H
J
v
a
m
V
j
d
A
Y
6
B
k
V
G
%
0
A
)
×
(
/
p
p
12V x16 Relays r
(/projecthub/products/buy/ o
j 16
70390?
e (/proj (/projecthub/products/b
s=BAhJIhMzMjYwNzQsUHJva
c ecthu uy/70390?
mVjdAY6BkVG%0A)
t b/pro s=BAhJIhMzMjYwNzQsU
h ducts HJvamVjdAY6BkVG%0A)
u /buy/
b 7039
/ 0?
p s=BA
r hJIhM
o zMjY
d wNzQ
u sUHJv
c amVjd
t AY6B
s kVG%
/ 0A)
b
u
y
/
7
0
3
9
0
?
s
=
B
A
h
JI
h
M
z
M
M
j
Y
w
N
z
Q
s
U
H
J
v
a
m
V
j
d
A
Y
6
B
k
V
G
%
0
A
)
256 Relays!
The IO Expander (http://www.zevendevelopment.com/ioexpander.html)now supports
256 relays per board. Due to cable lengths and capacitance issues the clock and data
lines need to be separated to two separate lines each with 8 relay boards. The first 8
relay boards are with R1 and R2 and the next 8 relay boards are with ECHO and TRIG. The
clock rate for each line is 68KHz and since it is a dual clock interface you get a combined
136KHz effective data output. Oh did we mention that it is also latched so all 256 relays
get activated at exactly the same time!
256 Relays Diagram
Note: R3 and R4 gets connected to the second lines as shown by the green wires on the
far right hand side.
Warning: Do NOT connect the grounds between the lines thus creating a ground loop!
But you don't have to stop at 256 relays. You can link multiple IO Expander
(http://www.zevendevelopment.com/ioexpander.html) together and control up to
65,280 relays!
See our Control Up to 65,280 Relays with Your Arduino
(https://www.hackster.io/chuygen/control-up-to-65-280-relays-with-your-arduino-
6a6256)project!
The IO Expander is more than just a relay controller. You can use it to also interface to
the following sensors with no drivers required!
Sensors Supported
Maxim 1-Wire® DS18B20, DS18S20,DS1822 Temperature.
(http://www.zevendevelopment.com/ioexpander.html#ds18b20)
Maxim 1-Wire® Control.
(http://www.zevendevelopment.com/ioexpander.html#onewire)
Maxim 1-Wire® DS28E17 to I2C.
(http://www.zevendevelopment.com/onewiretoi2c.html)
OneWire AM2302, DHT11, DHT22 Temperature/Humidity.
(http://www.zevendevelopment.com/ioexpander.html#dht22)
Sensirion SHT1x Temperature/Humidity.
(http://www.zevendevelopment.com/ioexpander.html#sht1x)
4 Relays or Relay Expander for 256 Relays.
(http://www.zevendevelopment.com/ioexpander.html#relays)
Flow (Hall Effect). (http://www.zevendevelopment.com/ioexpander.html#hall)
GPIO Control. (http://www.zevendevelopment.com/ioexpander.html#gpio)
Float Switch (Magnetic and Optical).
(http://www.zevendevelopment.com/ioexpander.html#float)
Button Input. (http://www.zevendevelopment.com/ioexpander.html#button)
Proximity Sensor. (http://www.zevendevelopment.com/ioexpander.html#proximity)
(New v1.14) (http://www.zevendevelopment.com/ioexpander.html#proximity)
Ultrasonic HCSR04. (http://www.zevendevelopment.com/ioexpander.html#hcsr04)
ADC TEMT6000 Light.
(http://www.zevendevelopment.com/ioexpander.html#temt6000)
Sensirion I2C HTU2x, SHT2x, SHT3x Temperature/Humidity.
(http://www.zevendevelopment.com/ioexpander.html#sht2x)
I2C Control. (http://www.zevendevelopment.com/ioexpander.html#i2c)
Silicon Labs I2C Si7021 Temperature/Humidity.
(http://www.zevendevelopment.com/ioexpander.html#si7021)
Bosch I2C BMP180 Temperature/Pressure.
(http://www.zevendevelopment.com/ioexpander.html#bmp180)
TAOS I2C TSL2561 Light. (http://www.zevendevelopment.com/ioexpander.html#tsl2561)
Ti I2C LM75 Temperature. (http://www.zevendevelopment.com/ioexpander.html#lm75)
Maxim I2C DS3231 RTC/Temperature.
(http://www.zevendevelopment.com/ioexpander.html#ds3231)
Atmel I2C AT24C32 32Kbps Serial EEPROM.
(http://www.zevendevelopment.com/ioexpander.html#at24c32)
SSD1306 0.96", SSD1309 2.42"
(http://www.zevendevelopment.com/ioexpander.html#ssd1306)(New v1.14)
(http://www.zevendevelopment.com/ioexpander.html#ssd1306) I2C 128x64 Dot
Matrix OLED/PLED Display.
(http://www.zevendevelopment.com/ioexpander.html#ssd1306)
Microchip I2C MCP9600 Thermocouple Temperature.
(http://www.zevendevelopment.com/ioexpander.html#mcp9600)
HX711 Load Cell Weight Sensor.
(http://www.zevendevelopment.com/ioexpander.html#hx711)(New v1.13)
(http://www.zevendevelopment.com/ioexpander.html#hx711)
SH1106 1.3" I2C 128x64 Dot Matrix OLED/PLED Display.
(http://www.zevendevelopment.com/ioexpander.html#sh1106)(New v1.13)
(http://www.zevendevelopment.com/ioexpander.html#sh1106)
TAOS I2C TSL2591 Light. (http://www.zevendevelopment.com/ioexpander.html#tsl2591)
(New v1.14) (http://www.zevendevelopment.com/ioexpander.html#tsl2591)
TAOS I2C TCS34725 RGB Light.
(http://www.zevendevelopment.com/ioexpander.html#tcs34725)(New v1.14)
(http://www.zevendevelopment.com/ioexpander.html#tcs34725)
Sensirion I2C SCD30 CO2 Temperature/Humidity.
(http://www.zevendevelopment.com/ioexpander.html#scd30)(New v1.14)
(http://www.zevendevelopment.com/ioexpander.html#scd30)
System Commands.
(http://www.zevendevelopment.com/ioexpander.html#systemcommands)
New sensors added with firmware updates.
(http://www.zevendevelopment.com/ioexpander.html#firmware)
Here's the 256 relays in action! Seeing is believing!
0:00 / 0:31
/* IO Expander
*
* 256 Relays
*
*/
#include <SoftwareSerial.h>
#include "IOExpander.h"
#include <avr/wdt.h>
//#define SERIAL_DEBUG
#define MAX_RELAYS 256
#ifdef SERIAL_DEBUG
SoftwareSerial swSerial(8,7);
#endif
char cmd[10];
void setup()
So get your IO Expander today and build your system!
CODE
SCHEMATICS
2 DOWNLOAD (HTTPS://HACKSTERIO.S3.AMAZONAWS.COM/UPLOADS/ATTACHMENTS/1087989/RELAYEXPANDER2
5
6
R
e
l
a
y
s
D
i
a
g
r
a
m
COMMENTS
OldNikoBold (/projecthub/OldNikoBold)
7 hours ago
(/pr
Spectacular,
oject but all that clicking would drive the dolphins in my aquarium quite mad.
hub/
Old
Niko
Bold Gustavo Gonnet (/projecthub/gusgonnet)
) 3 hours ago
(/pr
AMAZING!
oject
Ihub/
came here for the clicks and the video gave 31 wonderful seconds.
Incredible
gusg project.
onne
1 thank
t)
AUTHOR
(/projecthub/chuygen)
Christian (/projecthub/chuygen)
6 PROJECTS 59 FOLLOWERS
FOLLOW (/PROJECTHUB/USERS/SIGN_UP?ID=932833&M=USER&REASON=FOLLOW&REDIRECT
PUBLISHED ON
WRITE A COMMENT
Share
(/projecthub/alexii) (/projecthub/Natas)
and 17 others
SEE SIMILAR PROJECTS
YOU MIGHT LIKE
(/projecthub/chuygen/control-synchronize-hundreds-of-relays-at-the-same-time-
a14b91?ref=similar&ref_id=326074&offset=0)
(/projecthub/chuygen/control-up-to-65-280-relays-with-your-arduino-6a6256?
ref=similar&ref_id=326074&offset=1)
(/projecthub/dragos-iosub/arduino-ccs811-co2-tvoc-air-quality-monitor-570af1?
ref=similar&ref_id=326074&offset=2)
Arduino CCS811 - CO2 & tVOC - Air Quality Monitor
(/projecthub/dragos-iosub/arduino-ccs811-co2-tvoc-air-quality-
monitor-570af1?ref=similar&ref_id=326074&offset=2)
by Dragos Iosub (/projecthub/dragos-iosub)
7,133 VIEWS 0 COMMENTS 12 RESPECTS
(/projecthub/Arduino_Genuino/control-two-relays-over-the-internet-751138?
ref=similar&ref_id=326074&offset=3)
Control Two Relays Over the Internet
(/projecthub/Arduino_Genuino/control-two-relays-over-the-
internet-751138?ref=similar&ref_id=326074&offset=3)
Project tutorial by Arduino_Genuino (/projecthub/Arduino_Genuino)
2,529 VIEWS 0 COMMENTS 0 RESPECTS
(/projecthub/dragos-iosub/arduino-bme280-sensor-how-to-115560?
ref=similar&ref_id=326074&offset=4)
(/projecthub/jaume_miralles/publish-your-arduino-data-to-the-cloud-9dfaa2?
ref=similar&ref_id=326074&offset=5)
Publish Your Arduino Data to the Cloud
(/projecthub/jaume_miralles/publish-your-arduino-data-to-the-
cloud-9dfaa2?ref=similar&ref_id=326074&offset=5)
by Jaume Miralles (/projecthub/jaume_miralles)
10,104 VIEWS 14 COMMENTS 53 RESPECTS
(https://www.arduino.cc)
Powered by
(https://www.hackster.io)