Tuesday, January 23, 2024

Fake Security


A little ditty to get me out of the writers slump I am in.  Walking around the past few big cities I noticed there are more and more "crime-cams" in use.  High crime areas of cities are using a camera mounted up out of reach, catching everything. What I think is brilliant though is they are not hidden.  Instead, they are advertised!  They have unmissable bright red and blue or sometimes just blue flashing lights. You really can’t miss them.

Now aside from the obvious Orwellian aspects, I have to respect this idea and realize it is those lights that do more to stop crime than cops or even the cameras themselves.  That got me thinking. 

When I first built the van I had this idea to use cameras a lot. But then I discovered I didn’t have sufficient power reserves to run a computer or camera capturing video.  It takes a surprising amount of electrical energy and I had to prioritize things like lights and heat.  


But then during Covid while everyone was eating chips and bitching about the bars being closed I taught myself microcontroller circuit design.  These microcontrollers use almost no power and LEDs use only a fraction of that.  


While kicking around New Orleans that idea kept going around and around in my head.  It’s the LEDs stopping the crime and they take nothing to run.  I spent a few minutes one night building just such a set of lights. 

As for the cost, I built it just out of parts I had laying around. Starting from scratch you could buy a kit like this from Temu, $13 (https://share.temu.com/lgLdzKvo44A)

Then a Microcontroller from Amazon, $16:  HiLetgo 5pcs Mini ESP8266 ESP-12F Mini NodeMCU Lua 4M Bytes WiFi Module with Pin Headers (https://a.co/d/4yq9rPO)


For a total investment of less than $30 you will be preventing crime plus you would have 828 parts leftover to build other projects with.  

Here is the entirety of the computer code:

void setup() { 
  pinMode(D6, OUTPUT);  //Define two data pins as output
  pinMode(D5, OUTPUT); 
}
void loop() { 
  digitalWrite(D6, HIGH); //turn on the Red LED on pin D6
  delay(1000); //wait for 1000 milliseconds
  digitalWrite(D6, LOW); //turn off the Red LED on pin D6
  digitalWrite(D5, HIGH); //turn on the Blue LED on pin D5
  delay(1000); //wait for 1000 milliseconds
  digitalWrite(D5, LOW); //turn off the Blue LED on pin D5
}

The short explanation is, tell the microcontroller two of its pins will be used for output.  Then alternate sending a small voltage down those pins, turning the attached LEDs on and off with a one second time delay  in between.  


Wiring it up, one side of the LED is attached to the pin, the other side goes to a 100 ohm resistor and from there to ground.  Technically I could have gotten away with using only one resistor since only one LED will be lit at a time. Just as technically I should have used the two different values of resistors because red and blue LEDs draw slightly different amounts of electricity.  To the former, I had 828 parts left over from the last project too, and to the latter, just laziness.  There is a 50/50 chance one of the resistors will burn out faster because of this error.  I don’t care.  If it happens you do, look on the packaging that comes with the parts kit.  It will tell you some numbers about your LEDs.  Google “calculate LED ground resistor value” and you will soon find a web site you can plug those numbers into and it will tell you the exact resistor or combination of resistors you need.  

For the “camera” itself I used a small box covered in black gaffers tape, a little circle I cut out of aluminum tape and some super glue to attach the LEDs in their holes.  After I attached the circle of aluminum tape I pressed into it hard with a pointy knuckle to give the shiny aluminum a little convex shape.   All to look more lens-y. 

Full disclose, this is written about Fake Camera version one.  I am both forgetful and lazy.  A few days after I put it in service I modified it.  Version two added an analog light sensor so when it gets dark the LEDs start flashing.  No more needing to remember to plug it in.  If you want to do the same you need this part from Amazon: DIYables Digital Light Sensor for Arduino, ESP32, ESP8266, Raspberry Pi, 4 Pieces (https://a.co/d/2t8rjeg

Some other things you could do: Wire a second box with two more LEDs but have the single microcontroller control both sets.  Just because I am over the top with building the perfect fake, I would put a random delay in every so often so the pairs of lights will go out of sync.  Realism is everything you know!   Another thing is you could add would be motion sensors.  So the lights don’t flash all the time, only if someone gets close.

I will leave it as an assignment to you, the reader, to figure all that fun out.  

One final thing I haven’t worked out in my head just yet, is this is a really good idea?  Will it scare criminals off like the real thing?  Or, will it make them think it might be worthwhile to run home and grab a ski mask?  I have to consider those questions for a while.



No comments:

Post a Comment