BI and external I/Os

stonewatch

Young grasshopper
Apr 1, 2014
31
8
I am running a BI system , which is trigerred only by external inputs Arduino....very reliable. Some cameras have also inputs for triggering. Has anyone experience with this option how to set it up and how reliable it works with BI ?
 
I am running a BI system , which is trigerred only by external inputs Arduino....very reliable. Some cameras have also inputs for triggering. Has anyone experience with this option how to set it up and how reliable it works with BI ?

Hello, could you share more detail about your Arduino setup for trigering BI ?

Thank you.
 
3 Arduinos: 2 Arduino Ethernet with 2 inputs each as servers and one Arduino with ethernet shield as client connected via USB (com2 in my case) to the BI-PC. This Arduino has one additional input and one output to trigger the backup analog DVR.
 
Here is the client code cut and paste to try

//4 digital signals read from 2 servers
// 151,152 provide 1 2
//In addition 1 input on pin 4 active low
//Pin4 writes serial 1,
//Pin 3 digital output

#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x90, 0xA2, 0xDE, 0x0E, 0xC0, 0x0E };
IPAddress server1(192,168,1,151);
IPAddress server2(192,168,1,152);


IPAddress ip(192,168,1,160);
EthernetClient client;

int Output = 3;
int Input = 4;

void setup() {
pinMode(Output,OUTPUT);
pinMode (Input,INPUT);

Ethernet.begin(mac, ip);
Serial.begin(9600);
Serial.print(0);
}

void loop(){

if(client.connect(server1,8151)){
client.println();
}
delay(100);
if (client.available())
{
char c = client.read();
if(int(c) == 49)
{
digitalWrite (Output, HIGH);
Serial.print(1);
}
char d = client.read();
if(int(d) == 50)
{
digitalWrite (Output, HIGH);
Serial.print(2);
}
delay(100);

digitalWrite (Output, LOW);

Serial.print(0);
}

client.stop();

if(client.connect(server2,8152)){
client.println();
}
delay(100);
if (client.available())
{
char c = client.read();

if(int(c) == 49)
{
digitalWrite (Output, HIGH);
Serial.print(1);
}
char d = client.read();
if(int(d) == 50)
{
digitalWrite (Output, HIGH);
Serial.print(2);
}

delay(100);
digitalWrite (Output, LOW);
Serial.print(0);
}
client.stop();




if (digitalRead(Input) == HIGH){
Serial.print(4);

digitalWrite (Output, HIGH);
delay(100);
}


}
 
  • Like
Reactions: Mike and msantic
and here is one server code

#include <Ethernet.h>
#include <SPI.h>

byte mac [] = {0X90,0xA2,0xDA,0xDE,0xD4,0x7E};
IPAddress ip(192,168,1,151);
EthernetServer server(8151);

void setup()
{
Ethernet.begin(mac,ip);
server.begin();
}
void loop()
{
EthernetClient client = server.available();

{
if(client){
boolean currentLineIsBlank = true;
while (client.connected()){
if(client.available()){
char c = client.read();

if(c == '\n' && currentLineIsBlank) {

if (digitalRead(4) == 0)
{client.print(1);}
else
{client.print(0);}

if (digitalRead(5) == 0)
{client.print(2);}
else
{client.print(0);}


break;
}
if (c == '\n'){
currentLineIsBlank = false;
}
}
}
delay(10);
client.stop();
}
}



}
 
  • Like
Reactions: Mike and msantic
Has anyone replicated my setup at least partially with some success? BTW where are the BI users which trigger it with in camera integrated motion-detection or inputs ?
 
If recording is triggered by the Arduino, does that mean CPU usage dramatically goes down as it doesn't have to analyze frames or does it not make much of a difference?
 
8 cameras running on a I7 4770, Intel 530 180GB SSD for recent events, 1TB HDD for storage. Idle 12...16% with 5 cams triggered simultaneously up to 40% most direct to disc with up to 50 pretrigger frames each...I have never used the video-motion detection function.
 
8 cameras running on a I7 4770, Intel 530 180GB SSD for recent events, 1TB HDD for storage. Idle 12...16% with 5 cams triggered simultaneously up to 40% most direct to disc with up to 50 pretrigger frames each...I have never used the video-motion detection function.


I don't quite understand how you are using the arduinos, are they connected to PIR sensors? Door and window sensors? I am curious about this stuff too, I want to eventually do all of my motion detection with PIR sensors, I don't really care how but since I have a camera coming with some kind of external alarm hookup I am hoping I can just rig a cheap PIR sensor to it.
 
The motion sensors I use are Crow SRX1000/2000/3000. Right now three sensors are "wired or" conventionally connected to one input of the local Arduino which is usb-cennected to the BI-PC. Two more sensors are connected to Adruinoethernets and the state of which is periodically ( as seen in the posted code) checked by the local Arduino (with ehterrnet shield).
There are problems when an Arduino is used in this way: it is not easy to screw the board down without the danger of creating a short circuit with the screw-heads as the components are very close to the screw holes. Input overvoltage protection is also essential. Finding a proper case is also not so easy. Both mechanical and soldering skills and tools are of the essence.
 
The motion sensors I use are Crow SRX1000/2000/3000. Right now three sensors are "wired or" conventionally connected to one input of the local Arduino which is usb-cennected to the BI-PC. Two more sensors are connected to Adruinoethernets and the state of which is periodically ( as seen in the posted code) checked by the local Arduino (with ehterrnet shield).
There are problems when an Arduino is used in this way: it is not easy to screw the board down without the danger of creating a short circuit with the screw-heads as the components are very close to the screw holes. Input overvoltage protection is also essential. Finding a proper case is also not so easy. Both mechanical and soldering skills and tools are of the essence.

I bow to you, that is pretty awesome, you should totally have a website/youtube channel where you show some of this stuff off and how you do it. Do you happen to have any resources for how to connect motion/microwave sensors into things? I think I probably have a pretty decent grasp of IP cameras, and a very good grasp of computers/networking but my grasp of electronics and programming is pretty crappy. :)
 
Nice system indeed,
i want to put a arduino card in my system as well.
Only not planning to use the ethernet shield actually and not yet fully understanding how the arduino has to be programmed.
 
Get the Arduino YUN, that has many features not found in other Arduino's including built-in Ethernet, WiFi and has a Linux co-processor. For example, I put a temp sensor on a YUN, wrote C code to grab the temperature, then pass that to a Linux shell script running on the co-processor that sends a command to the camera to update the OSD with the temperature. Radio Shack sells Arduino's in their stores, that's where I got mine.
 
I am doing something like this with my HomeAutomation buildout, but with BeagleBone Black's for the Network Sensors and SSH KeyLogins to communicate between the devices securely..

reasons for BBB include: Full Linux OS and Packages (Debian), Hardware Watchdog, Built in Storage (dont need to buy an additional uSD), much more cpu/ram, and I can in code languages of my choice like C, Python, Bash.. they all have been rock solid stable
 
Last edited by a moderator:
There's lots of choices beside Arduino and Beagle boards,. Intel has their Galileo & Edison that are Arduino compatible and the Raspberry Pi are good alternatives. It takes a while to figure them out but I'm sure there's forums for each brand. The Edison is cool because of it's small size. Maybe even fit inside a camera.

intel-edison.jpg
 
IMHO BeagleBB is much better than the RPI; except if you are using the video output to power a display... then its video decoders take the cake.. The BBB is actually cheaper than the RPI once you account for the cost of a 32gb uSD card you'd have to put in the PI for same storage.

Galileo and Edison boards are wonderful devices, but IMHO overkill and overpriced for being a simple sensor to network interface.. not to mention you need a breakout board thats much larger to get to the network and any of the IO's you'd want; unless you can roll out your own board and put it together, thankfully there is oshpark to save the day.

Ive got a ton of lil embedded computers laying about my house; and a childhood buddy down the street is responsible for the arch linux arm port.. you should see his collection of build/test boxes, he has everything and then some... every time I go over he's got a stack of new hardware sent to him free that is awaiting to be plugged into the lab...

Arduino is about the best place for a newbie to start; there is no linux to learn.. the code is simple and there are a million lines of sample code out there to help you along... once you start hitting the limits of Arduino hardware you should be savvy enough to jump into some of the others where you wont find as much specific help.
 
The reason I got the Arduino YUN is that it runs Linux and has WiFi, the Raspberry PI, the Beaglebone Black, the Intel don't have WiFi built in. Sure, you can add it, but that increases the size, costs and complexity of the project.

beaglebone_photo_2_(5).jpg
 
ah yes, that is a great choice for wifi boards..

that photo is a lil unfair, that has to be the biggest usb wifi Ive seen used.
you can get usb wifi adapters that look like this too:
bblk-kit3-beaglebone-black-kit_pic4.jpg


but you know how I roll, wired all the way.