An Electronic Geek’s ‘TikTok’

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.

My breadboard with a couple relays, a handful of discretes and jumper wires, and the optocoupler in the middle of it all…

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.

My “fakeDuino” board running the sketch that makes my relays go tick-tock….
The resistors are current-limiting resistors and the ports are set up to sink the current of the optocoupler LED’s to ground.
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…..

My test setup with the reassuring “tick-tock-tick-tock”. If you can hear the music in the background, it’s “L.A. Underground” by Lee Ritenour and Larry Carlton (feat. Harvey Mason) (smooth jazz)
The prototype opto-relay board for the rear controller that is part of my CAN-bus project for my 63 Falcon (there is a forthcoming blog about that CAN-bus project that I’m working on…..)

Sigh…..the pleasures of being a geek….. 😀