At 7:45PM on sunday evening, less than 24hours of operation later, two policemen (nice guys actually) knocked on my door while I was watching Scrubs. Someone had reportedly seen the light and was concerned enough to call the cops. I told them that everything was ok and they left without searching my apt for the kidnapped woman I keep ducktaped next to the wall socket. Gotta teach her a lesson, she's been trying to escape.
In all seriousness, I find it heartwarming to know that someone out there was concerned enough to report it and that the cops where actually willing enough to investigate a flashing light.
Now I just need to set up some sillouetted stabbing scenes... that'll really freak that pervert vouyer out.
By the way, the message was "if you can read this, email me at email@example.com" (it was my real email address but I'm not going to put that here)
Ok, so even though I've got way too much freelance work on my plate at the moment, when the idea for this struck, it distracted me to the point of one late night quick coding session. The code took about 30 minutes to put together. The PIC was programmed and the whole thing put together in about 3 hours.
Right off the bat I need to say that without the help of dutchie (my buddie in tech) I wouldn't have known how to transform my blinking lights in Virtual Breadboard into a real life blinking light that's visible over a kilometer away. I'm thinking friggen laserbeams next!
For reference, the Wikipedia entry on Morse Code is a good place to start. (All hail Wikipedia!)
If you're into code, you can download the full source code here. (It's the full Microchip MPLab folder with compiled .hex file for anyone who just wants to recreate this for themselves without modifying the code)
Probably the most challenging thing about Morse Code (and it really isn't that challenging) is the timing. I eventually decided on using a standard "dit delay" function that is really just a delay for n miliseconds... Once you've got that you just call it as many times as it's needed. For example, a dah (or dash) is 3 dits long with a 3 dit gap in between etc. The wiki entry has more on timings.
- 1 x Microchip PIC16F84A (pdf)
- 1x 5v Power supply (Cell phone/Palm pilot chargers ahoy)
- 2x LEDs (different colors)
- 2x Resistors. (1k Ohm for the memclr pin and 330 ohm LED to ground)
- 4MHz Crystal
If you want to make it switch a 220v lamp (or 110v if you're living in one of "those" countries):
- 1x Mosfet (BUZ901D) (This switches the solid state relay since the PIC couldn't handle the load)
- 1x Solid State Relay (pdf) (Lets just say we were lucky to have one of these lying around)
It should be pretty obvious how to build this circuit, but essentially set up your PIC and connect the two LEDs to PortA0 and PortA1. If all is well then when you power it up you should see PortA1 blink twice and then see something that resembles morse code blinking out on PortA0.
Once you've got that working you can either just leave it like that and astound your friends with your brilliant electronic genius or you could confound the entire friggen neighbourhood. I'm lucky enough to live in Cape Town, arguably one of the world's most beautiful cities in the world and I live in an apartment that is visible by probably a few thousand people.