- Products
- >
- Locks & Actuator Props
- >
- The Human Chain Tutorial Page
USE THE BELOW ARDUINO CODE AND TUTORIAL VIDEO TO BUILD YOU OWN HUMAN CHAIN CIRCUIT!
COPY AND PASTE THE BELOW CODE INTO YOUR ARDUINO UI:
// The human connection program - escaperoomelectronics.com
#define relay 12 // Relay control pin is pin#12
int adc = 0; // This pin will be sampled to see if the connection has been made
void setup() {
pinMode(relay,OUTPUT);
digitalWrite(relay,HIGH); // Turn active low relay off. If you're using an active high relay, change this to LOW
//Serial.begin(9600); // Comment this code back in if you're interested in seeing the analog value on your serial monitor
}
void loop() {
adc = analogRead(0);
//Serial.println(adc); // Comment this code back in if you're interested in seeing the analog value on your serial monitor
delay(100); // Wait 100ms (Optional)
if(adc > 200) // By default, the value should be 0. When both probes are connected through a human chain, you'll see anywhere from 300 to 1000
{
digitalWrite(relay,LOW); // Turn relay on if the connection is made. I'm using an active low relay board
delay(100); // Having a delay here is optional, but I like having it. You can change it if you'd like.
//Serial.println("on"); // Comment this code back in if you're interested in seeing the analog value on your serial monitor
}
else
{
digitalWrite(relay,HIGH); // Turn relay off if the human connection isn't made.
delay(100); // Wait 100ms. This is optional. You can remove this, if you'd like
//Serial.println("off"); // Comment this code back in if you're interested in seeing the analog value on your serial monitor
}
}
// End of program. Check out my website www.escaperoomelectronics.com
// The human connection program - escaperoomelectronics.com
#define relay 12 // Relay control pin is pin#12
int adc = 0; // This pin will be sampled to see if the connection has been made
void setup() {
pinMode(relay,OUTPUT);
digitalWrite(relay,HIGH); // Turn active low relay off. If you're using an active high relay, change this to LOW
//Serial.begin(9600); // Comment this code back in if you're interested in seeing the analog value on your serial monitor
}
void loop() {
adc = analogRead(0);
//Serial.println(adc); // Comment this code back in if you're interested in seeing the analog value on your serial monitor
delay(100); // Wait 100ms (Optional)
if(adc > 200) // By default, the value should be 0. When both probes are connected through a human chain, you'll see anywhere from 300 to 1000
{
digitalWrite(relay,LOW); // Turn relay on if the connection is made. I'm using an active low relay board
delay(100); // Having a delay here is optional, but I like having it. You can change it if you'd like.
//Serial.println("on"); // Comment this code back in if you're interested in seeing the analog value on your serial monitor
}
else
{
digitalWrite(relay,HIGH); // Turn relay off if the human connection isn't made.
delay(100); // Wait 100ms. This is optional. You can remove this, if you'd like
//Serial.println("off"); // Comment this code back in if you're interested in seeing the analog value on your serial monitor
}
}
// End of program. Check out my website www.escaperoomelectronics.com