Hackster is hosting Hackster Holidays, Finale: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Tuesday!Stream Hackster Holidays, Finale on Tuesday!
Cezarjar
Published © LGPL

Arduino Project: Burglar Zone Input Tester

Tester may block hardwired sensors of common burglary alarms and access systems so protected zone is open, even if the system's in arm mode.

IntermediateFull instructions provided4,785
Arduino Project: Burglar Zone Input Tester

Things used in this project

Hardware components

SparkFun I2C DAC Breakout - MCP4725
SparkFun I2C DAC Breakout - MCP4725
×1
Adafruit Character LCD Module Display LCM 1602 16x2 HD44780 Controller Blue Blacklight
×1
Arduino UNO
Arduino UNO
×1
Relay Module (Generic)
×2
General Purpose Transistor NPN
General Purpose Transistor NPN
×2
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×3
General Purpose Quad Op-Amp
Texas Instruments General Purpose Quad Op-Amp
×1
Through Hole Resistor, 270 kohm
Through Hole Resistor, 270 kohm
×2
Through Hole Resistor, 91 kohm
Through Hole Resistor, 91 kohm
×1
Resistor 1k ohm
Resistor 1k ohm
×2
Resistor 1M ohm
Resistor 1M ohm
×3
Resistor 330 ohm
Resistor 330 ohm
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Through Hole Resistor, 5 kohm
Through Hole Resistor, 5 kohm
×2
Tactile Switch, Top Actuated
Tactile Switch, Top Actuated
×1
Current Sense Through Hole Resistor, 1 ohm
Current Sense Through Hole Resistor, 1 ohm
×2
Capacitor 100 nF
Capacitor 100 nF
×2
Capacitor 10 µF
Capacitor 10 µF
×1
5 mm LED: Green
5 mm LED: Green
×1
9V battery (generic)
9V battery (generic)
×2
9V Battery Clip
9V Battery Clip
×2
DC Power Connector, Plug
DC Power Connector, Plug
×1
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Terminal Block Interface, Screw Type 8 Position Terminal Block
Terminal Block Interface, Screw Type 8 Position Terminal Block
×2
Enclosure for Arduino Uno
Enclosure for Arduino Uno
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Custom parts and enclosures

Arduino based Tester schematics

Main schematic for building project

Schematics

Arduino based Tester schematics

Tester's schematics

Code

Arduino based Tester code

C/C++
Loaded Libraries:
NewLiquidCrystal
// or LiquidCrystal
Wire


/*
  
  Configuration bytes:
 // 12-bit device values from 0-4095
 // page 18-19 spec sheet
 buffer[0] = 0b01000000; // control byte
 // bits 7-5; 010 write DAC; 011 write DAC and EEPROM
 // bits 4-3 unused

 // bit 0 unused
 
 buffer[1] = 0b00000000; //HIGH data
 // bits 7-0 D11-D4
 
 buffer[2] = 0b00000000; // LOW data
 // bits 7-4 D3-D0
 // bits 3-0 unused
*/

#include <Wire.h> // specify use of Wire.h library
#define MCP4725 0x60 // MCP4725 base address
byte buffer[3];
unsigned int val;
#include <FastIO.h>
#include <I2CIO.h>
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Setup lcd 
  //LiquidCrystal_I2C lcd(0x27,16,2) lcd address may be diferent as to a lcd vendor specyfication

void setup()   {
  pinMode( 4, INPUT); //pin to starts  measurement 
  pinMode(13, OUTPUT); //Relay swith ON to start compromising
  pinMode(A0, INPUT); // pin as Analog IN to measure zone loop voltage
  }  // end setup

void loop() {
  
  int u = 0;
  int val = 0;
  buffer[0] = 0b01000000; // control byte
  delay(200);//Wait
  u = analogRead(0);
  val =  u* 4; // read pot
  buffer[1] = val >> 4; // MSB 11-4 shift right 4 places
  buffer[2] = val << 4; // LSB 3-0 shift left 4 places
  float sensorValue = 0;
  sensorValue = u*(5.0/1023.0)*4;
  Wire.begin(); // begin I2C
  lcd.begin(16,2);
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Measured VoltS =");
  lcd.setCursor(0, 1);
  lcd.print(sensorValue);
  lcd.print("__");
  lcd.print(u);
delay(500);


  while (digitalRead(4) == LOW) { 
  //digitalWrite(2, HIGH); //ready LED ON, option
  
  delay(200);// delay for conats to sabilize
  Wire.beginTransmission(MCP4725); // address device
  Wire.write(buffer[0]);  // pointer
  Wire.write(buffer[1]);  // 8 MSB
  Wire.write(buffer[2]);  // 4 LSB
  Wire.endTransmission(); 
  delay(200);//Wait
  digitalWrite(13, HIGH); //Relay 2 ON to compromise burglary zoneloop
  delay(20000);//Wait
  }

} // end loop

Credits

Cezarjar
0 projects • 1 follower

Comments