Heheh. I love the sound of clicking relays.
Was goofing around one day several months ago, using an Arduino microcontroller to activate some small 12v relays via an optocoupler. The circuitry on the breadboard is a mix of 5v and 12v with the “dividing line” being the optocouplers.
I was working on a semi-related project a few days ago with some Teensy microcontrollers that will be communicating with each other over a CAN-bus network (using my simulated CAN-bus environment in my office/lab). The μC’s will be driving some relays in the rear of the car via a similar setup (μC/optocoupler/relays) as well as some MOSFET’s. I unearthed this setup when I was doing my “reset” cleanup of my work areas. The original setup was a bit too fast, so I hooked up the Arduino to my computer and modified the original sketch to put a 500 ms (1/2 second) delay on each relay activation.
int rel1 = 2;
int rel2 = 10;
void setup() {
pinMode(rel1, OUTPUT);
pinMode(rel2, OUTPUT);
}
void loop() {
digitalWrite(rel2, LOW);
// delay(20);
digitalWrite(rel1, HIGH);
delay(500);
digitalWrite(rel1, LOW);
// delay(20);
digitalWrite(rel2, HIGH);
delay(500);
}
Some very simple Arduino code for the tick-tocker!
Being a railway signalling buff, I find the sound and “talk” of clicking relays oddly reassuring. I always used to marvel at how my signal maintainer friend Bob Minter (worked for the Soo Line) could tell me what was being lined up as we both stood in the large signal bungalow at Central Ave in Minneapolis and listened to the old coded relays click and clack out a cacophony of sound. And then there is this……..the tick-tock of alternating relays as heard in pre-solid state road crossing installations….tick-tock-tick-tock…..
Sigh…..the pleasures of being a geek….. 😀