Firstly, seeing as even some of my geeky mates did not know this, the US has a DEFCON level (defence condition). See wikipedia for more. There are images of DEFCON lights in a variety of films/shows (including War games, and Stargate). DEFCON 1 is most severe.
I saw RS did some rather nice 12V LED indicators, which I was using for a different projects, and realised they would make quite nice DEFCON lights.
So the shopping list:-
- RS 791-8579 White
- RS 791-8573 Red
- RS 791-8589 Yellow
- RS 791-8582 Green
- RS 791-8585 Blue
- RS 877-1836 Sounder
- Amazon relay board
- Amazon box
- Some wire and Wagos, and I have a 12V supply in the house.
The relay board is simple, ESP12-F based (ESP8266), so flashed with Tasmota and configured the relays 1 to 8. Note these are not ideal boards as they have ground plane around the antenna. I may have to make a relay board some time for a different project that needs 9 relays, but this was fine for this fun project.
The LED modules are simple enough to wire up. As is the sounder.
The result all connects to an MQTT server over WiFi. The relays are set up on tasmota, but relay 8 (the sounder) has a pulse time set (1 second) so I can simply turn it on to make a beep. I did consider a flashing strobe light as well, but meh...
The next challenge was to work out how to drive it sensibly. Setting a light was simple, I did a cmnd/DEFCON/Backlog Power0 0;Power3 1;Power8 1 for example. This turns all lights off, turns on light 3, and makes the sounder beep for a second.
I use a FireBrick as the MQTT server, so I created some profiles for DEFCON 1 to 5. Each is testing if DHCP is active for some IPs on the WiFi, and if the higher levels are all off so only one at a time. They then have that backlog command as the "on" MQTT command with retain.
This means that I get a DEFCON depending on who is in the house. DEFCON 1 for presence of the those who shall not be named (anti-vax). Cool or what?
P.S. I am sure Letraset used to be a thing - finding transfer numbers was not easy...