custom alarm systems at home

ericgibbs

Joined Jan 29, 2010
21,480
hi,
OPA's operational amps/comparators etc

Look at this rough draft option using the Arduino ADC to sense the 3 voltage levels.
Needs some minor suppression and filtering caps.

If it looks interesting, we could work on the Arduino Sketch.
E

BTW: Assumed a 1k for EOL for testing only


EG 973.png
 

ericgibbs

Joined Jan 29, 2010
21,480
hi bend,
This is a simple demo Sketch.
I used a 10k trim pot for the ADC input, for testing.

Looks OK.
E
C-like:
// Alarm bend94- A  30/10/21EG

int AlarmPin = A0;    // select the input pin for the potentiometer
float AlarmValue = 0;
float Vadc =0;

void setup() {
   Serial.begin(9600);
   Serial.println("Ready");
}

void loop() {
  // read the value from the sensor:
  AlarmValue = analogRead(AlarmPin);
  Vadc= 5 * (AlarmValue/1024);
  Serial.print(Vadc);
  Serial.print(" ");
  Serial.print(AlarmValue);
  Serial.print(" ");
  if (Vadc >= 4){
    Serial.println ("Shunted");
  }
  if (Vadc <= 2){
    Serial.println ("Window");
  }
  if (Vadc >= 2 && Vadc <= 4){
    Serial.println ("Normal");
  }
  delay(2000);
}
 

Attachments

Thread Starter

bend94

Joined Feb 15, 2016
46
hi thank you for your code.
i will study that
My project will be designed like this :
Arduino Uno connected to a raspberry pi through usb.
Arduino sketch will loop on reading the analog inputs and sending the result on the USB port

Raspberry will be installed with freepbx to be able to manage a 4GDevice key (to send sms)
Raspberry will also run a python code in background , reading USB from uno, manage alarm on/off and sms if needed.

Last , i have to design a UPS like with a battery to be able to go on if power failure.
If you have an idea for this ups , let me know
i posted another subject on this on the forum
best regards
 

rpiloverbd

Joined Dec 21, 2021
27
You can either use a voltage divider circuit or buck converter or step down transformer to step down the voltage from 12V to 5V. Then you have to do the necessary calculation to get the original voltage reading inside your program.
 

Ya’akov

Joined Jan 27, 2019
10,262
hi thank you for your code.
i will study that
My project will be designed like this :
Arduino Uno connected to a raspberry pi through usb.
Arduino sketch will loop on reading the analog inputs and sending the result on the USB port

Raspberry will be installed with freepbx to be able to manage a 4GDevice key (to send sms)
Raspberry will also run a python code in background , reading USB from uno, manage alarm on/off and sms if needed.

Last , i have to design a UPS like with a battery to be able to go on if power failure.
If you have an idea for this ups , let me know
i posted another subject on this on the forum
best regards
RPi + FreePBX seems to be like using a cannon to swat a fly if that’s all it is going to do. There is no problem having an Arduino compatible board do all of the functions you’ve mentioned. Or, you could get a board that uses MircoPython if you want to program in Python and still do it all with the MCU and a GSM module which will be able to send SMS using simple serial commands.
 
Top