My question is of course, does this circuit make sense? My high school electronics class was a quarter century ago
(Lighting System wall switch excerpt.png)
I plan on replacing my X10 lighting control system in my house, the place is way overdue for rewiring anyway.
The idea is to replace the backlit wall switch in the bathroom (or wherever). While I’m at it, slap an “on” indicator in it (so I know if I have a blown bulb, or controller problem if it doesn’t register the button press and switch the relay on).
What I was trying to accomplish with this circuit is:
Backlight LED(s) is illuminated when (RJ45 Pin 4 in the schematic) is high (+5v), while the “On” LED is not illuminated.
Backlight LED(s) is not illuminated when (RJ45 Pin 4 in the schematic) is low (0v), while the “On” LED is illuminated.
Essentially, this could be replaced by an 7404 if it had higher current capacity. The backlight LED will probably be replaced by multiple bright led’s (and it’s current limiting resister value changed of course) which would exceed the output of an 7404.
The transistors listed are what I have on hand, nothing special.
Of note: the optoisolator is active during the “On” state. Which, to my knowledge would allow current to flow from the base of the PNP transistor, through the optoisolator to ground, this illuminating the LED on it’s collector.
The reverse occouring with the NPN, when it’s base has no current flowing into it, no curent flows from it’s collector to its emitter.
I’ll attach the whole schematic for those who are curious, or maybe want a laugh. It’s pretty ambitious for my first arduino project, and drawn up in paintbrush. I’ve tested the code for the CD4021 button reading, debouncing, and 74HC575 outputs via breadboard. Optoisolation and beyond are just theoretical at this point, I need more breadboard!
This is a 24 channel system (24 buttons, 24 outputs), and uses no shift libraries.
Yes, 3 CD4021’s in series, and they work stably!
Some would wonder why I chose the CD4021, I have them lying around in abundance. My dad bought 50 of them back when I was in diapers. They have the old old OLD "F"airchild semiconductor logo on them! :o Talk about “new old stock”, they’re probably as old as Ridley Scotts “Alien”. They’re actually label’d “34021PC”, and yes, they were acting weird until I put the decoupling caps on each one, possibly excessive caps. Feel free to have a look and critique, or even try it out.
InputSR_Debounce_OutputSR_and_DHT.ino (8.82 KB)