9 Commits
0.90 ... master

Author SHA1 Message Date
  Your Name 1975472390 Moving Repo 4 years ago
  Your Name 6f6da45238 Doc updates. 5 years ago
  Your Name ef38d71022 pics 5 years ago
  Your Name 97a9052a1b OK. 5 years ago
  Your Name 2fd4b6a320 test suite. 5 years ago
  Your Name 4c9b15c29f oof 5 years ago
  Your Name eda09fc119 update. 5 years ago
  Your Name 7278947e13 telnet. 5 years ago
  Your Name 8eddd3f4dc update, shield, pics 900 or so. 5 years ago
30 changed files with 274 additions and 7 deletions
Split View
  1. +14
    -0
      README.md
  2. BIN
      ZMHW_Infrared_Doc.pdf
  3. +7
    -7
      ZMHW_Project_InfraredDiodeSensor.ino
  4. +1
    -0
      docs/.~lock.ZMHW_LaserInfrared_Doc25.odt#
  5. BIN
      docs/ZMHW_LaserInfrared_Doc20.odt
  6. BIN
      docs/ZMHW_LaserInfrared_Doc21.odt
  7. BIN
      docs/ZMHW_LaserInfrared_Doc22.odt
  8. BIN
      docs/ZMHW_LaserInfrared_Doc23.odt
  9. BIN
      docs/ZMHW_LaserInfrared_Doc24.odt
  10. BIN
      docs/ZMHW_LaserInfrared_Doc25.odt
  11. BIN
      pics/DSCN0930.JPG
  12. BIN
      pics/DSCN0931.JPG
  13. BIN
      pics/DSCN0932.JPG
  14. BIN
      pics/DSCN0936.JPG
  15. BIN
      pics/DSCN0937.JPG
  16. BIN
      pics/DSCN0938.JPG
  17. BIN
      pics/DSCN0939.JPG
  18. BIN
      pics/DSCN0982.JPG
  19. BIN
      pics/DSCN1272.JPG
  20. BIN
      pics/DSCN1273.JPG
  21. BIN
      pics/DSCN1274.JPG
  22. BIN
      pics/DSCN1275.JPG
  23. BIN
      pics/DSCN1276.JPG
  24. BIN
      pics/DSCN1277.JPG
  25. BIN
      pics/DSCN1278.JPG
  26. +26
    -0
      resouces/telnet_zmtrigger.sh
  27. +15
    -0
      testsuite/README
  28. +57
    -0
      testsuite/RGBTest/RGBTest.ino
  29. +43
    -0
      testsuite/ReadMotionSensor/ReadMotionSensor.ino
  30. +111
    -0
      testsuite/WebServerTest/WebServerTest.ino

+ 14
- 0
README.md View File

@ -1,3 +1,9 @@
NOTE: Updates for this project have been moved to
https://git.steakelectronics.com/adminguy/Electronics_Projects_2019
The PCB files can also be found there.
# ZMHW_Project_InfraredDiodeSensor
A ZMHW Motion Sensor Project Work Log
@ -5,3 +11,11 @@ A ZMHW Motion Sensor Project Work Log
Using a Sick WS15-D1130 Infrared Diode and receiver to act as a hardware motion detection sensor for Zoneminder.
Then trying a HFS-DC06H Microwave sensor. Both work well.
NOTE: Requires UIPEthernet Library.
In recent Arduino IDE:
Manage Libraries - UIPEthernet

BIN
ZMHW_Infrared_Doc.pdf View File


+ 7
- 7
ZMHW_Project_InfraredDiodeSensor.ino View File

@ -15,8 +15,8 @@
/*
* What it does:
* Works with accompanying shield to act as motion sensor
* for Zoneminder via ZMTrigger. Shield is optional if you
* want to bother with a perf board and components instead.
* for Zoneminder via ZMTrigger. Shield is optional but recommended
* as it's easier to build.
*
* Components:
* ENC28J60
@ -70,17 +70,17 @@
/***************Ethernet ENC28J60***************/
//Mac must be unique for each sensor
byte mac[] = { 0xD3, 0x5D, 0xBE, 0xEF, 0xEE, 0x50 };
byte mac[] = { 0xD3, 0x5D, 0xBE, 0xEF, 0xEE, 0x52 };
//Static IP of Arduino
byte ip[] = { 192, 168, 78, 50 };
byte ip[] = { 192, 168, 78, 52 };
//IP of ZM Server
byte server[] = { 192, 168, 78, 123 };
//ZM server IP to put in requests.
String host="192.168.78.123";
char* monnum = "12"; //monitor number
char* monnum = "14"; //monitor number
char* LOCATIONOFSENSOR = "Bay 4 - Tool Room";
char* LOCATIONOFSENSOR = "Bay 1";
#define ZMTRIGGERPORT 6802
#define LISTENPORT 80 // (port 80 is default for HTTP)
@ -92,7 +92,7 @@ char* LOCATIONOFSENSOR = "Bay 4 - Tool Room";
//Digital
#define MODECTPIN 2
#define MODECTPIN 4
#define SPEAKERPIN 6
#define LEDPIN 9

+ 1
- 0
docs/.~lock.ZMHW_LaserInfrared_Doc25.odt# View File

@ -0,0 +1 @@
,layoutdev,layoutmach,01.05.2019 10:47,file:///home/layoutdev/.config/libreoffice/4;

BIN
docs/ZMHW_LaserInfrared_Doc20.odt View File


BIN
docs/ZMHW_LaserInfrared_Doc21.odt View File


BIN
docs/ZMHW_LaserInfrared_Doc22.odt View File


BIN
docs/ZMHW_LaserInfrared_Doc23.odt View File


BIN
docs/ZMHW_LaserInfrared_Doc24.odt View File


BIN
docs/ZMHW_LaserInfrared_Doc25.odt View File


BIN
pics/DSCN0930.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 153 KiB

BIN
pics/DSCN0931.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 135 KiB

BIN
pics/DSCN0932.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 146 KiB

BIN
pics/DSCN0936.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 131 KiB

BIN
pics/DSCN0937.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 136 KiB

BIN
pics/DSCN0938.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 148 KiB

BIN
pics/DSCN0939.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 155 KiB

BIN
pics/DSCN0982.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 127 KiB

BIN
pics/DSCN1272.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 145 KiB

BIN
pics/DSCN1273.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 159 KiB

BIN
pics/DSCN1274.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 153 KiB

BIN
pics/DSCN1275.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 135 KiB

BIN
pics/DSCN1276.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 138 KiB

BIN
pics/DSCN1277.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 179 KiB

BIN
pics/DSCN1278.JPG View File

Before After
Width: 800  |  Height: 600  |  Size: 178 KiB

+ 26
- 0
resouces/telnet_zmtrigger.sh View File

@ -0,0 +1,26 @@
#!/bin/bash
IPADDRESS=192.168.78.50
CAMERAMODECTLOC=bay4hfs
TMPFILE=bay4tmp
TELNETSERVER=127.0.0.1
PORT=6802
MONITORNUMBER=12
wget $IPADDRESS -O $CAMERAMODECTLOC && cat $CAMERAMODECTLOC | grep Temp > $TMPFILE
RESULT=$(cat $TMPFILE)
telnet $TELNETSERVER $PORT <<EOF
$MONITORNUMBER|show||||$RESULT
EOF
#successful results will be viewable in INFO level syslogs (devuan):
#Jan 19 04:15:01 server CRON[27503]: (root) CMD (/home/cam/scripts/telnet_bay4.sh)
#Jan 19 04:15:01 server CRON[27504]: (root) CMD (/home/cam/scripts/telnet_dispatch.sh)
#Jan 19 04:15:01 server zmtrigger[15315]: INF [Updated show text to 'Temp:59#015
#Jan 19 04:15:01 server zmtrigger[15315]: INF [Updated show text to 'Temp:75#015

+ 15
- 0
testsuite/README View File

@ -0,0 +1,15 @@
Test Suite.
In this folder, is a few example sketches that can be run to verify
that everything works on your ZMHW motion detector.
There is the following:
Web Server test - To test ENC28J60 connectivity
RGB test - To test the RGB LED
Motion Sensor test - To test the motion sensor is working
TODO: LM35 test

+ 57
- 0
testsuite/RGBTest/RGBTest.ino View File

@ -0,0 +1,57 @@
/*
* ZMHW Changes:
* Use the appropriate pin.
* Make sure to alight all three colours. Bad connections can cause
* some colours to fail, but others will work, so we always want
* to test all three RGB values. Not just one.
*
*/
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN 5
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 1
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 500; // delay for half a second
void setup() {
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code
pixels.begin(); // This initializes the NeoPixel library.
}
void loop() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
for(int i=0;i<NUMPIXELS;i++){
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(50,150,50)); // Moderately bright green color.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
}
}

+ 43
- 0
testsuite/ReadMotionSensor/ReadMotionSensor.ino View File

@ -0,0 +1,43 @@
/*
* NOTE: this test is for HFS-DC06H
*
* ZMHW Changes:
*
* Using pin 4. This might change depending on PCB revision. Double
* check.
*
* If the Digital Hi (reads as 1's in serial) doesn't go away, and you are using USB,
* you might need external power. Some USB is not enough.
* Especially when ethernet is active.
* Ethernet draws power, even if library is not active.
*/
/*
DigitalReadSerial
Reads a digital input on pin 2, prints the result to the serial monitor
This example code is in the public domain.
*/
// digital pin 2 has a pushbutton attached to it. Give it a name:
int MotionSensor = 4;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
// make the pushbutton's pin an input:
pinMode(MotionSensor, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input pin:
int MotionState = digitalRead(MotionSensor);
// print out the state of the button:
Serial.println(MotionState);
delay(100); // delay in between reads for stability
}

+ 111
- 0
testsuite/WebServerTest/WebServerTest.ino View File

@ -0,0 +1,111 @@
/*
Same as default library but uses UIPEthernet. Requires UIPEthernet.
Manage Libraries - Download UIP Ethernet library
*/
/*
Web Server
A simple web server that shows the value of the analog input pins.
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
* Analog inputs attached to pins A0 through A5 (optional)
created 18 Dec 2009
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
modified 02 Sept 2015
by Arturo Guadalupi
*/
#include <SPI.h>
#include <UIPEthernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
}
void loop() {
// listen for incoming clients
EthernetClient client = server.available();
if (client) {
Serial.println("new client");
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.write(c);
// if you've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so you can send a reply
if (c == '\n' && currentLineIsBlank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close"); // the connection will be closed after completion of the response
client.println("Refresh: 5"); // refresh the page automatically every 5 sec
client.println();
client.println("<!DOCTYPE HTML>");
client.println("<html>");
// output the value of each analog input pin
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
int sensorReading = analogRead(analogChannel);
client.print("analog input ");
client.print(analogChannel);
client.print(" is ");
client.print(sensorReading);
client.println("<br />");
}
client.println("</html>");
break;
}
if (c == '\n') {
// you're starting a new line
currentLineIsBlank = true;
} else if (c != '\r') {
// you've gotten a character on the current line
currentLineIsBlank = false;
}
}
}
// give the web browser time to receive the data
delay(1);
// close the connection:
client.stop();
Serial.println("client disconnected");
}
}

Loading…
Cancel
Save