Arduino laser security trip wire for my vehicle

Im wanting to build a security system for my jeep. I have a jeep wrangler with a soft top.

If I have my top off, well obviously someone can easily steal out of it. So I want to install lasers in the window area's and door space roll cage so if someone was to reach into my jeep then an alarm would go off.

This would use 15 lasers in series and 15 photocells in series.

I have code written for a project I did a few years ago and I was hoping someone could help me see if it would work. It used literally the same concept. Except in had a shield installed on top of the arduino board. Here is a link NF-Arduino Sensor Shield Kit - PhotoCells | NightFire Electronics LLC
I guess I could just run the photocell on the shield in series but I don't really wanna use a shield.

Just would like to use that relay on its on PCB board to turn on a siren when the laser is broke with 2 LED's indicating armed and not armed.
And maybe somehow incorporate some type of transmitter so I can arm it with a wireless remote.

Here is the code.

/*Program for Photocell/ Relay configuration*/

#define ldrPin A0                 // Pin the light dependent resistor is connected to
#define relayPin 2                // Pin relay is connected to
#define ledPin 13                 // Pin LED is connected to

#define triggerLevel 950          // Levels above this threshold will trigger relay
#define relayDelay 20UL           // Relay delay time in seconds

unsigned long relayOffTime = 0;   // Time to turn off relay

void setup(){
  Serial.begin(9600);
  pinMode(relayPin,OUTPUT);
  digitalWrite(relayPin,LOW);       // Turn relay off
  pinMode(ledPin,OUTPUT);
  digitalWrite(ledPin,LOW);       // Turn LED off
}

void loop(){
  if (analogRead(ldrPin) > triggerLevel){
    if (relayOffTime == 0) {      // Relay off time zero so relay is off and we need to turn it on
      digitalWrite(relayPin,HIGH);  // Turn relay on
      digitalWrite(ledPin,HIGH);  // Turn LED on
      relayOffTime = (relayDelay * 1000UL) + millis();  // Set off time
      Serial.println("Relay On");
    }
  }

What does 15 laser in series mean?

I think you would be better off with just 1 PIR sensor that gives you volume coverage detection rather than a thin line of light which will be highly sensitive to current lighting conditions unless you have really really strong lasers which then is possibly a legal issue depending where you live.

J-M-L:
What does 15 laser in series mean?

I think you would be better off with just 1 PIR sensor that gives you volume coverage detection rather than a thin line of light which will be highly sensitive to current lighting conditions unless you have really really strong lasers which then is possibly a legal issue depending where you live.

Im not really even sure what a PIR sensor really is....Just did a quick google search. Something about detecting heat or something? Which that would be nifty to use. But still would need 1 for eash side window area, 1 for the rear window area, and 1 for each door(2 door) So 5 total.

As far as lasers, im not sure what ones im going to use yet. I mean I do have some very powerful handheld lasers. Can be seen for a few miles very clearly and burn things easily. No legal issue with them where I live. As long as you dont use them illegally.

the PIR sensor is what you use in automated lights at entrance of garage for example. Nowadays you can buy such lighting with the sensor embedded in the design of the lighting fixture like this image

the sensor could detects any presence/movement in the full volume of your car in one go if you position it "well" and will require less drain on your car battery than 15 laser that you need to maintain fully powered.

May be you can read this howtomechatronics.com article (where the image above comes from)

(also your laser would have to be very well attached to not move by 1mm which could happen when you drive your Jeep on bumpy road. any misalignment with the sensor on the other side would lead to triggering the alarm immediately when you turn it on... seems high maintenance to me.)

interesting.....

So it basically only works with heated objects though? like if a stick was to fall off a tree and fall into my jeep, the sensor wouldn't trip?

AS far as the maintenance thing, whatever I use would just set in my roll bar on my jeep. It would be hard fixed so moving wouldn't be an option. Id make sure it wouldnt ha

But I am more leaning towards this PIR sensor now.....

What PIR doesn't do is wind you up in jail for blinding someone.

"Lasers in the windows" is movie-stupid. It looks cool so it must be!

PIR is Passive IR. You can also do active IR.

A lock box to keep your valuables in would probably be a real neat accessory.

Indeed a PIR is for detecting motion from pets/humanoids (anything that emits enough infra red through heat). The P stands (kind of) for "Passive" meanings it does not emit IR but just sense if something is creating a difference in IR radiations received by 2 sensors embedded in one component. (I'm oversimplifying a bit - actually the P stands for Pyroelectric Infrared Sensor but it's an easy way to remember what they do)

if you want to detect non "human" intrusion, you would need to find a RIR (reflective infrared) sensor which does emit IR and measure what's coming back - so can detect stationary and moving objects. in arduino space most are sold as line detectors, you don't want that because they sense only a short 1.5 cm away. You need something stronger. Note that because they emit IR lights, the "lens" needs to be clean. if your car gets dirty, that might affect the performance.

you could try to play around with this extra-long-range SHARP distance sensor and measure on the Analog out any significant change happening. (because it will return the distance of the seats or whatever is in the car - but that signal should stay stable as long as nothing comes changing the configuration of the car once it's activated).

I would also recommend in using a simple PIR sensor, but don't place it at a bad position because then, people just walking around the car could trigger the alert & you would get many many false alerts.

But are u not thinking about a real protection, like parking the car in a garage? If someone trys to steal something & the alarm triggers, he could easily just run away with the stolen stuff.

Well I would more need it for people, so the PIR sounds like something I can use. A lock box isnt going to do much in my jeep. There is no space for it anywhere either. I would rather do this PIR thing so It can atleast wake me up in the middle of the night and I can just pull out the 45 to take care of the rest lol And its a cool project! Im bored and wanna build something haha.

Id also like to put a little sub in my jeep so anything that can help keep someone from stealing it while the top is off would be great! (Even though the box would be bolted down.)

I have like 6 arduino boards just sitting around and I wanna use them, so I think the PIR sensor would work great! Does the PIR sensor form like an "invisible" line? or what? Like If I was able to see the infrared light that it emits, what would it look like?

I guess the next thing would be to order some of these and start building it!

J-M-L: That site link you gave me is almost the exact code I could use with this as well! Just would have to change out that lamp in the schematic they provide to a siren!

I have like 6 arduino boards just sitting around and I wanna use them, so I think the PIR sensor would work great! Does the PIR sensor form like an "invisible" line? or what? Like If I was able to see the infrared light that it emits, what would it look like?

As mentioned, it does not emit anything, it's Passive. The plastic cover (The multi faceted fresnel lens) is the most common method of focusing the emmited infrared body heat radiation onto the pyrolectric sensors

Here is a good explanation if you want to understand what the sensors "sees"

I think I got it. It senses IR changes in its path.
I just did a search as far as how far it can detect. Read somewhere that it can sense up to 10m?
Does that sound correct?

irishluck:
I think I got it. It senses IR changes in its path.
I just did a search as far as how far it can detect. Read somewhere that it can sense up to 10m?
Does that sound correct?

Yes, most sensors have a detection-range of 5-10 metres, thats the reason why i said that you should not place it at a bad position, because then it could detect people just walking around the car & falsely triggering the alert everytime.

Also you could think about setting up a key-switch for disabling the siren after an alert, otherwise you would have to press the reset button on the arduino everytime (which could be difficult if you place the arduino in some type of box).

irishluck:
I think I got it. It senses IR changes in its path.
I just did a search as far as how far it can detect. Read somewhere that it can sense up to 10m?
Does that sound correct?

Yes, but if you tilt the sensor to face the inside of the car then you can limit undesired triggering. The lens is often fixed to a certain sweep and distance and you can usually set the sensitivity through a potentiometer on the board. you can hack the fresnel lens as well by putting some electric masking tapes to avoid "shooting too large" and only bring in radiation that are happening in a limited range.

--> Experimentation is key!

PIRs are easy to wire and easy to incorporate into a sketch. I use these mini PIRs throughout my house. I get a range of about 10'. - Scotty

J-M-L:
Yes, but if you tilt the sensor to face the inside of the car then you can limit undesired triggering. The lens is often fixed to a certain sweep and distance and you can usually set the sensitivity through a potentiometer on the board. you can hack the fresnel lens as well by putting some electric masking tapes to avoid "shooting too large" and only bring in radiation that are happening in a limited range.

--> Experimentation is key!

Well I would only have the sensors armed when I'm not in the vehicle or anything. I want it to activate if someone reaches into my jeep when I have the top and doors off. Id find the best spot to cover the area in the jeep. Id like to maybe use 2 or 3 sensors. Can these be run in series or do they all need to be hooked up to the arduino board separately

I do see what you mean though with the masking tape, being if it can reach 10 meters, I dont want it shooting to far.

Is it possible to wire in a remote to the arduino board to arm and disarm it like you would a regular car alarm?

So im not sure why but this code isn't working with mysetup.

I have the signal pin from the PIR sensor conneted to pin8 and the relay signal wire connected to pin7.
The relay and PIR sensor are wired to 5v and Gnd.

/*     Arduini PIR Motion Sensor Tutorial
 *      
 *  by Dejan Nedelkovski, www.HowToMechatronics.com
 *  
 */
int pirSensor = 8;
int relayInput = 7;
void setup() {
  pinMode(pirSensor, INPUT);
  pinMode(relayInput, OUTPUT);  
}
void loop() {
  int sensorValue = digitalRead(pirSensor);
  if (sensorValue == 1) {
    digitalWrite(relayInput, LOW); // The Relay Input works Inversly
  }
}

Try it with this mod, the LED should light when the sensor trips:

/*     Arduini PIR Motion Sensor Tutorial
 *     
 *  by Dejan Nedelkovski, www.HowToMechatronics.com
 * 
 */
int pirSensor = 8;
int relayInput = 7;
int LED = 13;
void setup() {
  pinMode(pirSensor, INPUT);
  pinMode(relayInput, OUTPUT);
  pinMode(LED,OUTPUT);
}
void loop() {
  int sensorValue = digitalRead(pirSensor);
  if (sensorValue == 1) {
    digitalWrite(relayInput, LOW); // The Relay Input works Inversly
  }
 digitalWrite(LED,sensorValue);
}

You ever hear of a magneto alarm system? 50,000 volts flowing through the body is a hell of a theft deterrent.

Zzztt zzztt lol!