Help with Arduino controlled "car alarm"

Hey guys, I would like to use an Arduino Uno Rev3 board to control the siren from a previous alarm system in my Jeep. I know it's possible, but I'm just getting started with Arduino, so I need some guidance.

Wondering what kind of sensor to use to set the siren off, and how to arm/disarm it.

Any and all help would be appreciated. Thanks in advance!

Two questions to help us help you.

What do you want to trigger the alarm (when someone opens the door, when they sit in the driver seat etc..)

Also do you have a datasheet or specs for the siren?

Unfortunately, no, I do not have a data sheet for it. I can look for specs on the siren itself.

I was also hoping I could get helping figuring out what trigger to use. If possible I'd like it to go off from someone opening or closing the door. So, like connecting to the dome lights and/or a vibration sensor.

Well, one idea is to use a Force Sensitive Resistor and put it in the seat. If someone sits down it is triggered. http://www.adafruit.com/products/1075

The other idea is to use a hall effect sensor and a magnet. Put the magnet in the door frame and the sensor in the door. When it does not detect the magnet, the door has been opened. http://www.adafruit.com/products/158

If possible I'd like it to go off from someone opening or closing the door. So, like connecting to the dome lights and/or a vibration sensor.

This can be done with a simple button and relay. However you may need other hardware to remotely trigger the alarm if you don't already have one (I cant imagine why you wouldn't have one)

This is a wireless relay module that you can use. http://www.ebay.com/itm/DC-12V-one-channel-Wireless-Remote-Control-Relay-Module-315MHZ-for-Arduino-/221523858770?pt=LH_DefaultDomain_0&hash=item3393d9d552

Would the wireless relay module be for arming and disarming?

And couldn't I just tap into the dome light switch and it acts like a "button?"

Like when the Arduino board receives voltage from the switch it is "HIGH" and in turn sets off the siren?

Would the wireless relay module be for arming and disarming?

Yes

And couldn’t I just tap into the dome light switch and it acts like a “button?”

I guess you could be how would you get to the wires then identify them ?

Like when the Arduino board receives voltage from the switch it is “HIGH” and in turn sets off the siren?

Not a direct signal, otherwise you will roast your arduino, however you could if you use an optocoupler or resistors + a transistor.

Can’t the Arduino board handle up to 12 volts?

I know my stuff when it comes to cars. I would just use a wiring diagram and the physical wires to know which wire to splice into.

Can't the Arduino board handle up to 12 volts?

Powering the arduino, yes. To be used as a digital signal, no. The digital and analog pins can only handle voltage ranges from 0 to 5v. Any more than 5v will be very harmful to the arduino and very likely, fry it.

Ok, couldn't I just use a big resistor to bring the voltage down?

The automotive electrical environment is very harsh. You can get surprisingly high voltage spikes due to a lot of different sources. Without some serious thought on protecting your Arduino's inputs, you will kill it the next time you do a jump start or maybe just when changing the car battery.

Start with a voltage divider. Use two resistors to bring the 13.8v down to 5v.

Then add a current limiting resistor so that extreme voltage spikes don't put a lot of current into your circuit. This is actually a small device, not a big resistor.

Then add a zener diode to limit any voltage spikes to 5.0v.

You may also add shottky diode to limit any negative voltage spikes to -0.2v, although the zener will usually provide enough protection at the -0.7v level.

Also be careful with the output wires to the siren. Mistakes or normal maintenance might put a voltage spike onto those wires too.

With 2 resistors, yes.

In fact, using common resistor values, you have 637 possible resistor choices (not using the same resistors) and 806 (with using the same resistors).

Car voltage = 12v (clean source)
Arduino safe voltage 4v- 5v (I chose 4v- 5v, because 1v - 5v would result in 3324 possible combinations not using the same resistors, and 3493 with using the same resistors.

Resistor chart: http://ecee.colorado.edu/~mcclurel/resistorsandcaps.pdf

/*

Vsource
 |
 |
[R1]
 |
 x-----------Vout
 |
[R2]
 |
 |
GND

*/


float CommonRes[24] = {
  1.0, 1.1, 1.2, 1.3, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.7,
  3.0, 3.3, 3.6, 3.9, 4.3, 4.7, 5.1, 5.6, 6.2, 6.8, 7.5,
  8.2, 9.1
};

void setup() 
{
  Serial.begin(115200);
  ResistorCalc(12, 4, 5, false);
  
  //FindR1(3357.14, 12, 5);
  //FindR2(4700, 12, 5);
}

void loop(){ }

void ResistorCalc(float Vs, float Vo1, float Vo2, bool show)
{
  float R1, R2, possibleVoltage;
  unsigned long count = 0, With_Duplicates = 0;
  
  for (byte i = 0; i < (24 * 7); i++)
  {
    R2 = (CommonRes[i % 24] * pow(10, (i / 24)) );
    for (byte j = 0; j < (24 * 7); j++)
    {
      R1 = (CommonRes[j % 24] * pow(10, (j / 24)) );
      possibleVoltage = (Vs * R2) / (R1 + R2);
      if (R1 != R2)
      {
        if ((possibleVoltage >= Vo1) && (possibleVoltage <= Vo2))
        {
          count++;
          if (show)
          {
            Serial.print(count);
            Serial.print(" ");
            Serial.print(R1);
            Serial.print(" ");
            Serial.print(R2);
            Serial.print(" ");
            Serial.println(possibleVoltage);
          }
        }
      }
      else With_Duplicates++;
    }
  }
  Serial.print("No Dups: ");
  Serial.println(count);
  
  Serial.print("With Dups: ");
  Serial.println((count + With_Duplicates));
}

void FindR1(long R2, float Vs, float Vo)
{
  Serial.println( ((Vs * R2) - (Vo * R2)) / Vo);
}

void FindR2(long R1, float Vs, float Vo)
{
  Serial.println( (Vo * R1) / (Vs - Vo));
}

I read somewhere that I could use a car phone charger to lower and regulate the voltage. Is this true?

Yea, just as long as the output voltage is not greater than 5v.

Ok, so now that I know how to power and regulate the voltage from one of the triggers, I just need help learning how to code it.

But the thing is, this is not really something you would need an arduino for. All you would need is that wireless relay module to arm and disarm the car alarm.

Do you know what still has power when the car is off?

I'm not using Arduino to control the brain of the alarm system. The Arduino is the brain. I don't have an alarm system control box, I just have the old siren from it. So, I need something to control the siren. Hence Arduino.

See the image attached. My appologies for it being so big. Hopefully you can read it.

I don’t know what siren you have but if you get something that can output a tone then you might be able to do so with an arduino. Keep in mind that this may require extra hardware.

So your picture shows using the dome light switch to turn on a relay that activates an alarm?

No there are a total of 2 relays. One is the wireless relay and the other is a 5v relay that is getting its power from whatever turns on, when a door is open.