@ -1 +0,0 @@ | |||||
,layoutdev,layoutmach,10.11.2019 23:13,file:///home/layoutdev/.config/libreoffice/4; |
@ -0,0 +1,20 @@ | |||||
\relax | |||||
\@writefile{toc}{\contentsline {section}{\numberline {1}Overview}{1}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {2}Parts List}{2}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Other Sensors}{2}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {3}Work Log}{3}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{3}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Testing the Sick IR Diode Tripwire \relax }}{3}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{4}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.\relax }}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Arduino and Part 2 of sensor. Lined up with the other part.\relax }}{6}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.\relax }}{7}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces IR in action. (without a reflective sticker, it doesn't go very far!)\relax }}{8}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {5}Using the HFS-DC06H Microwave Sensor}{8}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Uno Memory Limitations}{8}} |
@ -0,0 +1,347 @@ | |||||
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex 2019.8.17) 11 NOV 2019 01:10 | |||||
entering extended mode | |||||
restricted \write18 enabled. | |||||
%&-line parsing enabled. | |||||
**/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/ | |||||
ZMHW_Modector/docs/10.tex | |||||
(/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/Z | |||||
MHW_Modector/docs/10.tex | |||||
LaTeX2e <2017/01/01> patch level 3 | |||||
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls | |||||
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo | |||||
File: size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option) | |||||
) | |||||
\c@part=\count79 | |||||
\c@section=\count80 | |||||
\c@subsection=\count81 | |||||
\c@subsubsection=\count82 | |||||
\c@paragraph=\count83 | |||||
\c@subparagraph=\count84 | |||||
\c@figure=\count85 | |||||
\c@table=\count86 | |||||
\abovecaptionskip=\skip41 | |||||
\belowcaptionskip=\skip42 | |||||
\bibindent=\dimen102 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty | |||||
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty | |||||
Package: keyval 2014/10/28 v1.15 key=value parser (DPC) | |||||
\KV@toks@=\toks14 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty | |||||
Package: graphics 2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty | |||||
Package: trig 2016/01/03 v1.10 sin cos tan (DPC) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg | |||||
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration | |||||
) | |||||
Package graphics Info: Driver file: pdftex.def on input line 99. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def | |||||
File: pdftex.def 2017/01/12 v0.06k Graphics/color for pdfTeX | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty | |||||
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty | |||||
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO) | |||||
) | |||||
\Gread@gobject=\count87 | |||||
)) | |||||
\Gin@req@height=\dimen103 | |||||
\Gin@req@width=\dimen104 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty | |||||
Package: caption 2016/02/21 v3.3-144 Customizing captions (AR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty | |||||
Package: caption3 2016/05/22 v1.7-166 caption3 kernel (AR) | |||||
Package caption3 Info: TeX engine: e-TeX on input line 67. | |||||
\captionmargin=\dimen105 | |||||
\captionmargin@=\dimen106 | |||||
\captionwidth=\dimen107 | |||||
\caption@tempdima=\dimen108 | |||||
\caption@indent=\dimen109 | |||||
\caption@parindent=\dimen110 | |||||
\caption@hangindent=\dimen111 | |||||
) | |||||
\c@ContinuedFloat=\count88 | |||||
) (./10.aux) | |||||
\openout1 = `10.aux'. | |||||
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii | |||||
[Loading MPS to PDF converter (version 2006.09.02).] | |||||
\scratchcounter=\count89 | |||||
\scratchdimen=\dimen112 | |||||
\scratchbox=\box26 | |||||
\nofMPsegments=\count90 | |||||
\nofMParguments=\count91 | |||||
\everyMPshowfont=\toks15 | |||||
\MPscratchCnt=\count92 | |||||
\MPscratchDim=\dimen113 | |||||
\MPnumerator=\count93 | |||||
\makeMPintoPDFobject=\count94 | |||||
\everyMPtoPDFconversion=\toks16 | |||||
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty | |||||
Package: pdftexcmds 2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty | |||||
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO) | |||||
Package ifluatex Info: LuaTeX not detected. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty | |||||
Package: ifpdf 2016/05/14 v3.1 Provides the ifpdf switch | |||||
) | |||||
Package pdftexcmds Info: LuaTeX not detected. | |||||
Package pdftexcmds Info: \pdf@primitive is available. | |||||
Package pdftexcmds Info: \pdf@ifprimitive is available. | |||||
Package pdftexcmds Info: \pdfdraftmode found. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty | |||||
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty | |||||
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty | |||||
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO) | |||||
)) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty | |||||
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty | |||||
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty | |||||
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO) | |||||
Package etexcmds Info: Could not find \expanded. | |||||
(etexcmds) That can mean that you are not using pdfTeX 1.50 or | |||||
(etexcmds) that some package has redefined \expanded. | |||||
(etexcmds) In the latter case, load this package earlier. | |||||
))) | |||||
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4 | |||||
38. | |||||
Package grfext Info: Graphics extension search list: | |||||
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE | |||||
G,.JBIG2,.JB2,.eps] | |||||
(grfext) \AppendGraphicsExtensions on input line 456. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg | |||||
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv | |||||
e | |||||
)) | |||||
Package caption Info: Begin \AtBeginDocument code. | |||||
Package caption Info: End \AtBeginDocument code. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <12> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <8> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <6> on input line 11. | |||||
(./10.toc | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <10.95> on input line 3. | |||||
) | |||||
\tf@toc=\write3 | |||||
\openout3 = `10.toc'. | |||||
Overfull \hbox (11.59073pt too wide) in paragraph at lines 16--17 | |||||
\OT1/cmr/m/n/10.95 stal-la-tions. These sen-sors use ZMTrig-ger.pl (wiki.zonemi | |||||
nder.com/ZMTrigger) | |||||
[] | |||||
LaTeX Font Info: Try loading font information for OMS+cmr on input line 21. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd | |||||
File: omscmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions | |||||
) | |||||
LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10.95> not available | |||||
(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 21. | |||||
[1 | |||||
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] | |||||
<../pics/DSCN0207.JPG, id=14, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0207.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0207.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0207.JPG used on input line 53. | |||||
(pdftex.def) Requested size: 321.1943pt x 240.89572pt. | |||||
Package caption Warning: \captionsetup{type*=...} or \captionof | |||||
(caption) outside box or environment on input line 54. | |||||
See the caption package documentation for explanation. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <9> on input line 56. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <5> on input line 56. | |||||
[3 <../pics/DSCN0207.JPG>] <../pics/DSCN0217.JPG, id=18, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0217.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0217.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0217.JPG used on input line 73. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[4] | |||||
<../pics/DSCN0220.JPG, id=25, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0220.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0220.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0220.JPG used on input line 76. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0225.JPG, id=26, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0225.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0225.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0225.JPG used on input line 79. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0227.JPG, id=27, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0227.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0227.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0227.JPG used on input line 82. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[5 <../pics/DSCN0217.JPG> <../pics/DSCN0220.JPG> <../pics/DSCN0225.JPG>] | |||||
<../pics/walloutlet2.jpg, id=31, 481.8pt x 642.4pt> | |||||
File: ../pics/walloutlet2.jpg Graphic file (type jpg) | |||||
<use ../pics/walloutlet2.jpg> | |||||
Package pdftex.def Info: ../pics/walloutlet2.jpg used on input line 85. | |||||
(pdftex.def) Requested size: 120.44969pt x 160.59961pt. | |||||
[6 <../pics/DSCN0227.JPG> <../pics/walloutlet2.jpg>] <../pics/DSCN0265.JPG, id | |||||
=35, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0265.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0265.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0265.JPG used on input line 94. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
Overfull \hbox (7.91602pt too wide) in paragraph at lines 112--112 | |||||
[] \OT1/cmtt/m/n/10.95 is. To use with 5v ttl (using a second 5v source) wire a | |||||
s such:[] | |||||
[] | |||||
<../pics/DSCN0273.JPG, id=36, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0273.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0273.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0273.JPG used on input line 115. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[7 <../pics/DSCN0265.JPG>] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no œ in font cmtt10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no ™ in font cmtt10! | |||||
Missing character: There is no  in font cmtt10! | |||||
Missing character: There is no in font cmtt10! | |||||
Missing character: There is no  in font cmtt10! | |||||
Missing character: There is no in font cmtt10! | |||||
Overfull \hbox (94.14633pt too wide) in paragraph at lines 146--146 | |||||
[]\OT1/cmtt/m/n/10.95 Heres a small utility function which determines how much | |||||
RAM iscurrentlyunused:[] | |||||
[] | |||||
Overfull \hbox (71.15158pt too wide) in paragraph at lines 146--146 | |||||
[] \OT1/cmtt/m/n/10.95 return (int) &v - (__brkval == 0 ? (int) &__heap_start | |||||
: (int) __brkval);[] | |||||
[] | |||||
[8 <../pics/DSCN0273.JPG>] | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no ™ in font cmtt10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no œ in font cmtt10! | |||||
Underfull \hbox (badness 4391) in paragraph at lines 149--153 | |||||
[]\OT1/cmr/m/n/10.95 An easy res-o-lu-tion for this is to put all se-rial.print | |||||
lines into | |||||
[] | |||||
Underfull \hbox (badness 1158) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 flash mem-ory. You can ver-ify this helps, by tak-ing a se-r | |||||
ial.print, | |||||
[] | |||||
Underfull \hbox (badness 2426) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 and com-ment-ing it out, and com-par-ing the be-fore and af- | |||||
ter dy- | |||||
[] | |||||
Underfull \hbox (badness 1546) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 namic mem-ory used in ver-ify. To put se-rial print lines in | |||||
flash: | |||||
[] | |||||
Overfull \hbox (67.99345pt too wide) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 (https://www.arduino.cc/reference/en/language/functions/comm | |||||
unication/serial/write/) | |||||
[] | |||||
Overfull \hbox (67.08095pt too wide) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 (https://www.arduino.cc/reference/en/language/functions/comm | |||||
unication/serial/print/) | |||||
[] | |||||
[9] (./10.aux) ) | |||||
Here is how much of TeX's memory you used: | |||||
2640 strings out of 494945 | |||||
42332 string characters out of 6181032 | |||||
96817 words of memory out of 5000000 | |||||
5917 multiletter control sequences out of 15000+600000 | |||||
10198 words of font info for 36 fonts, out of 8000000 for 9000 | |||||
14 hyphenation exceptions out of 8191 | |||||
39i,8n,39p,658b,227s stack positions out of 5000i,500n,10000p,200000b,80000s | |||||
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/c | |||||
mbx10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12. | |||||
pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></u | |||||
sr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/shar | |||||
e/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr6.pfb></usr/share/texliv | |||||
e/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb></usr/share/texlive/texmf- | |||||
dist/fonts/type1/public/amsfonts/cm/cmr9.pfb></usr/share/texlive/texmf-dist/fon | |||||
ts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fonts/typ | |||||
e1/public/amsfonts/cm/cmtt10.pfb> | |||||
Output written on 10.pdf (9 pages, 1127550 bytes). | |||||
PDF statistics: | |||||
78 PDF objects out of 1000 (max. 8388607) | |||||
49 compressed objects within 1 object stream | |||||
0 named destinations out of 1000 (max. 500000) | |||||
41 words of extra memory for PDF output out of 10000 (max. 10000000) | |||||
@ -0,0 +1,160 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\section{Omrom Photoelectric IR Emitter/Receiver} | |||||
All electronics is currently selling used Omrom photoelectric sensors, they are model: e3f2-r2c4. These types of photoelectric sensors are from a large catalog of different types. Some AC some DC powered. Different max distance, etc... See resources in this git repository for some PDFs. | |||||
I tested one without knowing how to use them, but had poor results. I was only able to get the light to flash when I dismantled the device, and put my hand very close to the IR. Teardown pictures are in the photos folder. The devices were not easy to dismantle, and can't really be put back together as they were originally. However, they did seem otherwise well made. \footnote{Repairs may be difficult.} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0265.JPG} | |||||
\captionof{figure}{Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.} | |||||
After finding some documentation on these in the reviews, I found out that the IR emitters require a reflective sticker in order to 'see' their IR beam reflect back. Not just a white surface, but the type of reflector you might see on a construction or night worker orange vest. | |||||
Hookup Instructions from All Electronics Comments: | |||||
\begin{verbatim} | |||||
is. To use with 5v ttl (using a second 5v source) wire as such: | |||||
Brown to +12V; Blue to ground; Pink to either +12 or ground | |||||
depending whether you want Light-ON or Dark-ON mode; | |||||
Black to a 4.7K resistor with the other side of the resistor | |||||
connected to a separate +5V source (the arduino). The 5v ttl | |||||
signal is at the point where the black wire connects to the | |||||
resistor. | |||||
\end{verbatim} | |||||
One thing I also noticed, was that used photo electric sensors from brand names can be obtained for discounts on the auction sites, to see if a good deal can be had. When buying them new, they can be relatively expensive for a hobbyist working out of his/her garage. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0273.JPG} | |||||
\captionof{figure}{IR in action. (without a reflective sticker, it doesn't go very far!)} | |||||
\section{Using the HFS-DC06H Microwave Sensor} | |||||
As I've tried with the HB100 (just the RF part of this HFS-DC06H), without success, I've moved to the HFS-DC06H microwave sensor which includes the Op Amp and accompanying circuitry (it simply outputs a digital high or low). | |||||
During testing, I found that the HFS sensor would not work correctly with my laptops usb 2.0 power supply. I thought it might be RF interferance from the metallic perf board – something I've seen before with an FM bug radio – but it was not. The HFS and the ENC require external power that is greater than my laptop can output. | |||||
\subsection{Uno Memory Limitations} | |||||
Using ethernet with the Uno is always touchy. Version control is important, to have a functional version to work off of. | |||||
When writing my code, I found errors creep in due to using too much of what the Arduino IDE calls dynamic memory. You can see how much dynamic memory is used in Arduino by hitting verify (not upload but verify)and reading the output from the toolchain. You can also use a tool to see how much SRAM is used (code is online:https://jeelabs.org/2011/05/22/atmega-memory-use/) the following function: | |||||
\begin{verbatim} | |||||
“Here’s a small utility function which determines how much RAM is currently unused: | |||||
int freeRam () { | |||||
extern int __heap_start, *__brkval; | |||||
int v; | |||||
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); | |||||
} | |||||
And here’s a sketch using that code: | |||||
void setup () { | |||||
Serial.begin(57600); | |||||
Serial.println("\n[memCheck]"); | |||||
Serial.println(freeRam()); | |||||
} | |||||
void loop () {} | |||||
The result will be: | |||||
[memCheck] | |||||
1846 | |||||
“ | |||||
\end{verbatim} | |||||
The UIPEthernet code requires significant RAM for the Uno. This is not a new problem for me, but it rears its ugly head again. However, this is a good thing. Limits are good. | |||||
An easy resolution for this is to put all serial.print lines into flash memory. You can verify this helps, by taking a serial.print, and commenting it out, and comparing the before and after dynamic memory used in verify. To put serial print lines in flash: | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/write/) | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/print/) | |||||
As I recall, there may be limitations to what you can do with Serial.print(F()), fotr example, converting variables into it will likely not work without further finesse. | |||||
Low RAM errors can creep into strange places. For example, see these two wiresharks, where my code was running, equally as well, but the new code revision simply didn't work: | |||||
\end{document} | |||||
@ -0,0 +1,118 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\section{Omrom Photoelectric IR Emitter/Receiver} | |||||
All electronics is currently selling used Omrom photoelectric sensors, they are model: e3f2-r2c4. These types of photoelectric sensors are from a large catalog of different types. Some AC some DC powered. Different max distance, etc... See resources in this git repository for some PDFs. | |||||
I tested one without knowing how to use them, but had poor results. I was only able to get the light to flash when I dismantled the device, and put my hand very close to the IR. Teardown pictures are in the photos folder. The devices were not easy to dismantle, and can't really be put back together as they were originally. However, they did seem otherwise well made. \footnote{Repairs may be difficult.} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0265.JPG} | |||||
\captionof{figure}{Omrom 'Photoelectric' IR Emitter and Receiver Pair} | |||||
After finding some documentation on these in the reviews, I found out that the IR emitters require a reflective sticker in order to 'see' their IR beam reflect back. Not just a white surface, but the type of reflector you might see on a construction or night worker orange vest. | |||||
Hookup Instructions from All Electronics Comments: | |||||
\begin{verbatim} | |||||
is. To use with 5v ttl (using a second 5v source) wire as such: | |||||
Brown to +12V; Blue to ground; Pink to either +12 or ground | |||||
depending whether you want Light-ON or Dark-ON mode; | |||||
Black to a 4.7K resistor with the other side of the resistor | |||||
connected to a separate +5V source (the arduino). The 5v ttl | |||||
signal is at the point where the black wire connects to the | |||||
resistor. | |||||
\end{verbatim} | |||||
One thing I also noticed, was that used photo electric sensors from brand names can be obtained for discounts on the auction sites, to see if a good deal can be had. When buying them new, they can be relatively expensive for a hobbyist working out of his/her garage. | |||||
\end{document} | |||||
@ -0,0 +1,11 @@ | |||||
\contentsline {section}{\numberline {1}Overview}{1} | |||||
\contentsline {section}{\numberline {2}Parts List}{2} | |||||
\contentsline {subsection}{\numberline {2.1}Other Sensors}{2} | |||||
\contentsline {section}{\numberline {3}Work Log}{3} | |||||
\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{3} | |||||
\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{4} | |||||
\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{4} | |||||
\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{4} | |||||
\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{6} | |||||
\contentsline {section}{\numberline {5}Using the HFS-DC06H Microwave Sensor}{8} | |||||
\contentsline {subsection}{\numberline {5.1}Uno Memory Limitations}{8} |
@ -0,0 +1,21 @@ | |||||
\relax | |||||
\@writefile{toc}{\contentsline {section}{\numberline {1}Overview}{1}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {2}Parts List}{2}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Other Sensors}{2}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {3}Work Log}{3}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{3}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Testing the Sick IR Diode Tripwire \relax }}{3}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{4}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.\relax }}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Arduino and Part 2 of sensor. Lined up with the other part.\relax }}{6}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.\relax }}{7}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces IR in action. (without a reflective sticker, it doesn't go very far!)\relax }}{8}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {5}Using the HFS-DC06H Microwave Sensor}{8}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Uno Memory Limitations}{8}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces First capture is correct. Second one, the lack of RAM causes the ENC to fail to send data to ZMTrigger.\relax }}{10}} |
@ -0,0 +1,364 @@ | |||||
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex 2019.8.17) 11 NOV 2019 01:18 | |||||
entering extended mode | |||||
restricted \write18 enabled. | |||||
%&-line parsing enabled. | |||||
**/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/ | |||||
ZMHW_Modector/docs/11.tex | |||||
(/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/Z | |||||
MHW_Modector/docs/11.tex | |||||
LaTeX2e <2017/01/01> patch level 3 | |||||
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls | |||||
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo | |||||
File: size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option) | |||||
) | |||||
\c@part=\count79 | |||||
\c@section=\count80 | |||||
\c@subsection=\count81 | |||||
\c@subsubsection=\count82 | |||||
\c@paragraph=\count83 | |||||
\c@subparagraph=\count84 | |||||
\c@figure=\count85 | |||||
\c@table=\count86 | |||||
\abovecaptionskip=\skip41 | |||||
\belowcaptionskip=\skip42 | |||||
\bibindent=\dimen102 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty | |||||
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty | |||||
Package: keyval 2014/10/28 v1.15 key=value parser (DPC) | |||||
\KV@toks@=\toks14 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty | |||||
Package: graphics 2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty | |||||
Package: trig 2016/01/03 v1.10 sin cos tan (DPC) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg | |||||
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration | |||||
) | |||||
Package graphics Info: Driver file: pdftex.def on input line 99. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def | |||||
File: pdftex.def 2017/01/12 v0.06k Graphics/color for pdfTeX | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty | |||||
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty | |||||
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO) | |||||
) | |||||
\Gread@gobject=\count87 | |||||
)) | |||||
\Gin@req@height=\dimen103 | |||||
\Gin@req@width=\dimen104 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty | |||||
Package: caption 2016/02/21 v3.3-144 Customizing captions (AR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty | |||||
Package: caption3 2016/05/22 v1.7-166 caption3 kernel (AR) | |||||
Package caption3 Info: TeX engine: e-TeX on input line 67. | |||||
\captionmargin=\dimen105 | |||||
\captionmargin@=\dimen106 | |||||
\captionwidth=\dimen107 | |||||
\caption@tempdima=\dimen108 | |||||
\caption@indent=\dimen109 | |||||
\caption@parindent=\dimen110 | |||||
\caption@hangindent=\dimen111 | |||||
) | |||||
\c@ContinuedFloat=\count88 | |||||
) (./11.aux) | |||||
\openout1 = `11.aux'. | |||||
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii | |||||
[Loading MPS to PDF converter (version 2006.09.02).] | |||||
\scratchcounter=\count89 | |||||
\scratchdimen=\dimen112 | |||||
\scratchbox=\box26 | |||||
\nofMPsegments=\count90 | |||||
\nofMParguments=\count91 | |||||
\everyMPshowfont=\toks15 | |||||
\MPscratchCnt=\count92 | |||||
\MPscratchDim=\dimen113 | |||||
\MPnumerator=\count93 | |||||
\makeMPintoPDFobject=\count94 | |||||
\everyMPtoPDFconversion=\toks16 | |||||
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty | |||||
Package: pdftexcmds 2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty | |||||
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO) | |||||
Package ifluatex Info: LuaTeX not detected. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty | |||||
Package: ifpdf 2016/05/14 v3.1 Provides the ifpdf switch | |||||
) | |||||
Package pdftexcmds Info: LuaTeX not detected. | |||||
Package pdftexcmds Info: \pdf@primitive is available. | |||||
Package pdftexcmds Info: \pdf@ifprimitive is available. | |||||
Package pdftexcmds Info: \pdfdraftmode found. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty | |||||
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty | |||||
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty | |||||
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO) | |||||
)) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty | |||||
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty | |||||
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty | |||||
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO) | |||||
Package etexcmds Info: Could not find \expanded. | |||||
(etexcmds) That can mean that you are not using pdfTeX 1.50 or | |||||
(etexcmds) that some package has redefined \expanded. | |||||
(etexcmds) In the latter case, load this package earlier. | |||||
))) | |||||
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4 | |||||
38. | |||||
Package grfext Info: Graphics extension search list: | |||||
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE | |||||
G,.JBIG2,.JB2,.eps] | |||||
(grfext) \AppendGraphicsExtensions on input line 456. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg | |||||
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv | |||||
e | |||||
)) | |||||
Package caption Info: Begin \AtBeginDocument code. | |||||
Package caption Info: End \AtBeginDocument code. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <12> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <8> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <6> on input line 11. | |||||
(./11.toc | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <10.95> on input line 3. | |||||
) | |||||
\tf@toc=\write3 | |||||
\openout3 = `11.toc'. | |||||
Overfull \hbox (11.59073pt too wide) in paragraph at lines 16--17 | |||||
\OT1/cmr/m/n/10.95 stal-la-tions. These sen-sors use ZMTrig-ger.pl (wiki.zonemi | |||||
nder.com/ZMTrigger) | |||||
[] | |||||
LaTeX Font Info: Try loading font information for OMS+cmr on input line 21. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd | |||||
File: omscmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions | |||||
) | |||||
LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10.95> not available | |||||
(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 21. | |||||
[1 | |||||
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] | |||||
<../pics/DSCN0207.JPG, id=14, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0207.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0207.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0207.JPG used on input line 53. | |||||
(pdftex.def) Requested size: 321.1943pt x 240.89572pt. | |||||
Package caption Warning: \captionsetup{type*=...} or \captionof | |||||
(caption) outside box or environment on input line 54. | |||||
See the caption package documentation for explanation. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <9> on input line 56. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <5> on input line 56. | |||||
[3 <../pics/DSCN0207.JPG>] <../pics/DSCN0217.JPG, id=18, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0217.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0217.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0217.JPG used on input line 73. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[4] | |||||
<../pics/DSCN0220.JPG, id=25, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0220.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0220.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0220.JPG used on input line 76. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0225.JPG, id=26, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0225.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0225.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0225.JPG used on input line 79. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0227.JPG, id=27, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0227.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0227.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0227.JPG used on input line 82. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[5 <../pics/DSCN0217.JPG> <../pics/DSCN0220.JPG> <../pics/DSCN0225.JPG>] | |||||
<../pics/walloutlet2.jpg, id=31, 481.8pt x 642.4pt> | |||||
File: ../pics/walloutlet2.jpg Graphic file (type jpg) | |||||
<use ../pics/walloutlet2.jpg> | |||||
Package pdftex.def Info: ../pics/walloutlet2.jpg used on input line 85. | |||||
(pdftex.def) Requested size: 120.44969pt x 160.59961pt. | |||||
[6 <../pics/DSCN0227.JPG> <../pics/walloutlet2.jpg>] <../pics/DSCN0265.JPG, id | |||||
=35, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0265.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0265.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0265.JPG used on input line 94. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
Overfull \hbox (7.91602pt too wide) in paragraph at lines 112--112 | |||||
[] \OT1/cmtt/m/n/10.95 is. To use with 5v ttl (using a second 5v source) wire a | |||||
s such:[] | |||||
[] | |||||
<../pics/DSCN0273.JPG, id=36, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0273.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0273.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0273.JPG used on input line 115. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[7 <../pics/DSCN0265.JPG>] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no œ in font cmtt10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no ™ in font cmtt10! | |||||
Missing character: There is no  in font cmtt10! | |||||
Missing character: There is no in font cmtt10! | |||||
Missing character: There is no  in font cmtt10! | |||||
Missing character: There is no in font cmtt10! | |||||
Overfull \hbox (94.14633pt too wide) in paragraph at lines 146--146 | |||||
[]\OT1/cmtt/m/n/10.95 Heres a small utility function which determines how much | |||||
RAM iscurrentlyunused:[] | |||||
[] | |||||
Overfull \hbox (71.15158pt too wide) in paragraph at lines 146--146 | |||||
[] \OT1/cmtt/m/n/10.95 return (int) &v - (__brkval == 0 ? (int) &__heap_start | |||||
: (int) __brkval);[] | |||||
[] | |||||
[8 <../pics/DSCN0273.JPG>] | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no ™ in font cmtt10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no œ in font cmtt10! | |||||
Underfull \hbox (badness 4391) in paragraph at lines 149--153 | |||||
[]\OT1/cmr/m/n/10.95 An easy res-o-lu-tion for this is to put all se-rial.print | |||||
lines into | |||||
[] | |||||
Underfull \hbox (badness 1158) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 flash mem-ory. You can ver-ify this helps, by tak-ing a se-r | |||||
ial.print, | |||||
[] | |||||
Underfull \hbox (badness 2426) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 and com-ment-ing it out, and com-par-ing the be-fore and af- | |||||
ter dy- | |||||
[] | |||||
Underfull \hbox (badness 1546) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 namic mem-ory used in ver-ify. To put se-rial print lines in | |||||
flash: | |||||
[] | |||||
Overfull \hbox (67.99345pt too wide) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 (https://www.arduino.cc/reference/en/language/functions/comm | |||||
unication/serial/write/) | |||||
[] | |||||
Overfull \hbox (67.08095pt too wide) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 (https://www.arduino.cc/reference/en/language/functions/comm | |||||
unication/serial/print/) | |||||
[] | |||||
<../pics/wshark1.jpg, id=45, 1018.55531pt x 883.80188pt> | |||||
File: ../pics/wshark1.jpg Graphic file (type jpg) | |||||
<use ../pics/wshark1.jpg> | |||||
Package pdftex.def Info: ../pics/wshark1.jpg used on input line 158. | |||||
(pdftex.def) Requested size: 509.27641pt x 441.89986pt. | |||||
Overfull \hbox (149.27641pt too wide) in paragraph at lines 158--159 | |||||
[][] | |||||
[] | |||||
[9] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
[10 <../pics/wshark1.jpg>] | |||||
! Missing $ inserted. | |||||
<inserted text> | |||||
$ | |||||
l.176 | |||||
? | |||||
! Emergency stop. | |||||
<inserted text> | |||||
$ | |||||
l.176 | |||||
End of file on the terminal! | |||||
Here is how much of TeX's memory you used: | |||||
2642 strings out of 494945 | |||||
42418 string characters out of 6181032 | |||||
96817 words of memory out of 5000000 | |||||
5920 multiletter control sequences out of 15000+600000 | |||||
10198 words of font info for 36 fonts, out of 8000000 for 9000 | |||||
14 hyphenation exceptions out of 8191 | |||||
39i,8n,39p,658b,227s stack positions out of 5000i,500n,10000p,200000b,80000s | |||||
! ==> Fatal error occurred, no output PDF file produced! |
@ -0,0 +1,184 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\section{Omrom Photoelectric IR Emitter/Receiver} | |||||
All electronics is currently selling used Omrom photoelectric sensors, they are model: e3f2-r2c4. These types of photoelectric sensors are from a large catalog of different types. Some AC some DC powered. Different max distance, etc... See resources in this git repository for some PDFs. | |||||
I tested one without knowing how to use them, but had poor results. I was only able to get the light to flash when I dismantled the device, and put my hand very close to the IR. Teardown pictures are in the photos folder. The devices were not easy to dismantle, and can't really be put back together as they were originally. However, they did seem otherwise well made. \footnote{Repairs may be difficult.} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0265.JPG} | |||||
\captionof{figure}{Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.} | |||||
After finding some documentation on these in the reviews, I found out that the IR emitters require a reflective sticker in order to 'see' their IR beam reflect back. Not just a white surface, but the type of reflector you might see on a construction or night worker orange vest. | |||||
Hookup Instructions from All Electronics Comments: | |||||
\begin{verbatim} | |||||
is. To use with 5v ttl (using a second 5v source) wire as such: | |||||
Brown to +12V; Blue to ground; Pink to either +12 or ground | |||||
depending whether you want Light-ON or Dark-ON mode; | |||||
Black to a 4.7K resistor with the other side of the resistor | |||||
connected to a separate +5V source (the arduino). The 5v ttl | |||||
signal is at the point where the black wire connects to the | |||||
resistor. | |||||
\end{verbatim} | |||||
One thing I also noticed, was that used photo electric sensors from brand names can be obtained for discounts on the auction sites, to see if a good deal can be had. When buying them new, they can be relatively expensive for a hobbyist working out of his/her garage. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0273.JPG} | |||||
\captionof{figure}{IR in action. (without a reflective sticker, it doesn't go very far!)} | |||||
\section{Using the HFS-DC06H Microwave Sensor} | |||||
As I've tried with the HB100 (just the RF part of this HFS-DC06H), without success, I've moved to the HFS-DC06H microwave sensor which includes the Op Amp and accompanying circuitry (it simply outputs a digital high or low). | |||||
During testing, I found that the HFS sensor would not work correctly with my laptops usb 2.0 power supply. I thought it might be RF interferance from the metallic perf board – something I've seen before with an FM bug radio – but it was not. The HFS and the ENC require external power that is greater than my laptop can output. | |||||
\subsection{Uno Memory Limitations} | |||||
Using ethernet with the Uno is always touchy. Version control is important, to have a functional version to work off of. | |||||
When writing my code, I found errors creep in due to using too much of what the Arduino IDE calls dynamic memory. You can see how much dynamic memory is used in Arduino by hitting verify (not upload but verify)and reading the output from the toolchain. You can also use a tool to see how much SRAM is used (code is online:https://jeelabs.org/2011/05/22/atmega-memory-use/) the following function: | |||||
\begin{verbatim} | |||||
“Here’s a small utility function which determines how much RAM is currently unused: | |||||
int freeRam () { | |||||
extern int __heap_start, *__brkval; | |||||
int v; | |||||
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); | |||||
} | |||||
And here’s a sketch using that code: | |||||
void setup () { | |||||
Serial.begin(57600); | |||||
Serial.println("\n[memCheck]"); | |||||
Serial.println(freeRam()); | |||||
} | |||||
void loop () {} | |||||
The result will be: | |||||
[memCheck] | |||||
1846 | |||||
“ | |||||
\end{verbatim} | |||||
The UIPEthernet code requires significant RAM for the Uno. This is not a new problem for me, but it rears its ugly head again. However, this is a good thing. Limits are good. | |||||
An easy resolution for this is to put all serial.print lines into flash memory. You can verify this helps, by taking a serial.print, and commenting it out, and comparing the before and after dynamic memory used in verify. To put serial print lines in flash: | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/write/) | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/print/) | |||||
As I recall, there may be limitations to what you can do with Serial.print(F()), fotr example, converting variables into it will likely not work without further finesse, and libraries that print through serial likely won't work. | |||||
Low RAM errors can creep into strange places. For example, see these two wiresharks, where my code was running, equally as well, but the new code revision simply didn't work: | |||||
As you can see the data packet is mangled in the new rev. I've seen this enough to know, it was low SRAM. Otherwise, the code worked without major error. This small error effectively broke the program! Testing is always important, as well as saving multiple copies as you go, or alternatively version control. | |||||
\includegraphics[scale=0.5]{../pics/wshark1.jpg} | |||||
\captionof{figure}{First capture is correct. Second one, the lack of RAM causes the ENC to fail to send data to ZMTrigger.} | |||||
\section{Deployment} | |||||
Today I deployed both sensor boxes on site, connecting them to the ZM system. They both work\footnote{And have continued to work for about a year now}. I found that these HFS sensors appear to be fairly directional. I've been unable to get them to fire, when behind a wall, or up a floor, which is good – I don't want them to do that. The metal shield they have, seems to work well – blocking radio waves from going behind it. I mounted one on the ceiling and one on a wall, setting the cameras to nodect. Success. | |||||
However I have seen some issues with these, in the following situations. | |||||
\begin{itemize} | |||||
\item Mice in the ceiling, setting off the alarm | |||||
\item Flourescent lights being within 2 feet of the installation causing false alarms | |||||
\end{itemize} | |||||
Keep in mind, that if anything moves, it can set off the alarms. Including small animals. | |||||
I'm not sure exactly what frequency they are, but I think it is around 5GHz, comparable to 5GHz wifi (not going through walls well). I'm also considering putting some copper tape on the inside of the box, to help block anything through the wall it's mounted to, possibly... | |||||
When building this new shield I've made for the motion sensor, you can use flush cut pliers (the ones that cut really close to a board, if you are not familiar) and cut the WS2812 RGB LEDs right off of a $3 RGB ring. You can also buy individual WS2812 LEDs. Cutting them off, is easier, and cheaper (and for those who run on a shoe-string budget) thus what I did here. There is a video I've made to show this process. | |||||
\end{document} | |||||
@ -0,0 +1,163 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\section{Omrom Photoelectric IR Emitter/Receiver} | |||||
All electronics is currently selling used Omrom photoelectric sensors, they are model: e3f2-r2c4. These types of photoelectric sensors are from a large catalog of different types. Some AC some DC powered. Different max distance, etc... See resources in this git repository for some PDFs. | |||||
I tested one without knowing how to use them, but had poor results. I was only able to get the light to flash when I dismantled the device, and put my hand very close to the IR. Teardown pictures are in the photos folder. The devices were not easy to dismantle, and can't really be put back together as they were originally. However, they did seem otherwise well made. \footnote{Repairs may be difficult.} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0265.JPG} | |||||
\captionof{figure}{Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.} | |||||
After finding some documentation on these in the reviews, I found out that the IR emitters require a reflective sticker in order to 'see' their IR beam reflect back. Not just a white surface, but the type of reflector you might see on a construction or night worker orange vest. | |||||
Hookup Instructions from All Electronics Comments: | |||||
\begin{verbatim} | |||||
is. To use with 5v ttl (using a second 5v source) wire as such: | |||||
Brown to +12V; Blue to ground; Pink to either +12 or ground | |||||
depending whether you want Light-ON or Dark-ON mode; | |||||
Black to a 4.7K resistor with the other side of the resistor | |||||
connected to a separate +5V source (the arduino). The 5v ttl | |||||
signal is at the point where the black wire connects to the | |||||
resistor. | |||||
\end{verbatim} | |||||
One thing I also noticed, was that used photo electric sensors from brand names can be obtained for discounts on the auction sites, to see if a good deal can be had. When buying them new, they can be relatively expensive for a hobbyist working out of his/her garage. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0273.JPG} | |||||
\captionof{figure}{IR in action. (without a reflective sticker, it doesn't go very far!)} | |||||
\section{Using the HFS-DC06H Microwave Sensor} | |||||
As I've tried with the HB100 (just the RF part of this HFS-DC06H), without success, I've moved to the HFS-DC06H microwave sensor which includes the Op Amp and accompanying circuitry (it simply outputs a digital high or low). | |||||
During testing, I found that the HFS sensor would not work correctly with my laptops usb 2.0 power supply. I thought it might be RF interferance from the metallic perf board – something I've seen before with an FM bug radio – but it was not. The HFS and the ENC require external power that is greater than my laptop can output. | |||||
\subsection{Uno Memory Limitations} | |||||
Using ethernet with the Uno is always touchy. Version control is important, to have a functional version to work off of. | |||||
When writing my code, I found errors creep in due to using too much of what the Arduino IDE calls dynamic memory. You can see how much dynamic memory is used in Arduino by hitting verify (not upload but verify)and reading the output from the toolchain. You can also use a tool to see how much SRAM is used (code is online:https://jeelabs.org/2011/05/22/atmega-memory-use/) the following function: | |||||
\begin{verbatim} | |||||
“Here’s a small utility function which determines how much RAM is currently unused: | |||||
int freeRam () { | |||||
extern int __heap_start, *__brkval; | |||||
int v; | |||||
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); | |||||
} | |||||
And here’s a sketch using that code: | |||||
void setup () { | |||||
Serial.begin(57600); | |||||
Serial.println("\n[memCheck]"); | |||||
Serial.println(freeRam()); | |||||
} | |||||
void loop () {} | |||||
The result will be: | |||||
[memCheck] | |||||
1846 | |||||
“ | |||||
\end{verbatim} | |||||
The UIPEthernet code requires significant RAM for the Uno. This is not a new problem for me, but it rears its ugly head again. However, this is a good thing. Limits are good. | |||||
An easy resolution for this is to put all serial.print lines into flash memory. You can verify this helps, by taking a serial.print, and commenting it out, and comparing the before and after dynamic memory used in verify. To put serial print lines in flash: | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/write/) | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/print/) | |||||
As I recall, there may be limitations to what you can do with Serial.print(F()), fotr example, converting variables into it will likely not work without further finesse, and libraries that print through serial likely won't work. | |||||
Low RAM errors can creep into strange places. For example, see these two wiresharks, where my code was running, equally as well, but the new code revision simply didn't work: | |||||
XW11.tex | |||||
\end{document} | |||||
@ -0,0 +1,25 @@ | |||||
\relax | |||||
\@writefile{toc}{\contentsline {section}{\numberline {1}Overview}{1}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {2}Parts List}{2}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Other Sensors}{3}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {3}Work Log}{3}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{3}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Testing the Sick IR Diode Tripwire \relax }}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{5}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces \relax }}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces \relax }}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.\relax }}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Arduino and Part 2 of sensor. Lined up with the other part.\relax }}{7}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{7}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.\relax }}{7}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces IR in action. (without a reflective sticker, it doesn't go very far!)\relax }}{8}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {5}Using the HFS-DC06H Microwave Sensor}{8}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Uno Memory Limitations}{9}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces First capture is correct. Second one, the lack of RAM causes the ENC to fail to send data to ZMTrigger.\relax }}{11}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {6}Deployment}{12}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1}Work Log 1/31/19}{12}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {6.2}The need for POE}{13}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {6.3}HB100 are Sensitive to Fluorescent Lighting and Mains}{13}} |
@ -0,0 +1,373 @@ | |||||
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex 2019.8.17) 11 NOV 2019 01:21 | |||||
entering extended mode | |||||
restricted \write18 enabled. | |||||
%&-line parsing enabled. | |||||
**/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/ | |||||
ZMHW_Modector/docs/12.tex | |||||
(/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/Z | |||||
MHW_Modector/docs/12.tex | |||||
LaTeX2e <2017/01/01> patch level 3 | |||||
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls | |||||
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo | |||||
File: size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option) | |||||
) | |||||
\c@part=\count79 | |||||
\c@section=\count80 | |||||
\c@subsection=\count81 | |||||
\c@subsubsection=\count82 | |||||
\c@paragraph=\count83 | |||||
\c@subparagraph=\count84 | |||||
\c@figure=\count85 | |||||
\c@table=\count86 | |||||
\abovecaptionskip=\skip41 | |||||
\belowcaptionskip=\skip42 | |||||
\bibindent=\dimen102 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty | |||||
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty | |||||
Package: keyval 2014/10/28 v1.15 key=value parser (DPC) | |||||
\KV@toks@=\toks14 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty | |||||
Package: graphics 2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty | |||||
Package: trig 2016/01/03 v1.10 sin cos tan (DPC) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg | |||||
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration | |||||
) | |||||
Package graphics Info: Driver file: pdftex.def on input line 99. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def | |||||
File: pdftex.def 2017/01/12 v0.06k Graphics/color for pdfTeX | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty | |||||
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty | |||||
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO) | |||||
) | |||||
\Gread@gobject=\count87 | |||||
)) | |||||
\Gin@req@height=\dimen103 | |||||
\Gin@req@width=\dimen104 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty | |||||
Package: caption 2016/02/21 v3.3-144 Customizing captions (AR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty | |||||
Package: caption3 2016/05/22 v1.7-166 caption3 kernel (AR) | |||||
Package caption3 Info: TeX engine: e-TeX on input line 67. | |||||
\captionmargin=\dimen105 | |||||
\captionmargin@=\dimen106 | |||||
\captionwidth=\dimen107 | |||||
\caption@tempdima=\dimen108 | |||||
\caption@indent=\dimen109 | |||||
\caption@parindent=\dimen110 | |||||
\caption@hangindent=\dimen111 | |||||
) | |||||
\c@ContinuedFloat=\count88 | |||||
) (./12.aux) | |||||
\openout1 = `12.aux'. | |||||
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii | |||||
[Loading MPS to PDF converter (version 2006.09.02).] | |||||
\scratchcounter=\count89 | |||||
\scratchdimen=\dimen112 | |||||
\scratchbox=\box26 | |||||
\nofMPsegments=\count90 | |||||
\nofMParguments=\count91 | |||||
\everyMPshowfont=\toks15 | |||||
\MPscratchCnt=\count92 | |||||
\MPscratchDim=\dimen113 | |||||
\MPnumerator=\count93 | |||||
\makeMPintoPDFobject=\count94 | |||||
\everyMPtoPDFconversion=\toks16 | |||||
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty | |||||
Package: pdftexcmds 2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty | |||||
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO) | |||||
Package ifluatex Info: LuaTeX not detected. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty | |||||
Package: ifpdf 2016/05/14 v3.1 Provides the ifpdf switch | |||||
) | |||||
Package pdftexcmds Info: LuaTeX not detected. | |||||
Package pdftexcmds Info: \pdf@primitive is available. | |||||
Package pdftexcmds Info: \pdf@ifprimitive is available. | |||||
Package pdftexcmds Info: \pdfdraftmode found. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty | |||||
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty | |||||
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty | |||||
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO) | |||||
)) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty | |||||
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty | |||||
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty | |||||
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO) | |||||
Package etexcmds Info: Could not find \expanded. | |||||
(etexcmds) That can mean that you are not using pdfTeX 1.50 or | |||||
(etexcmds) that some package has redefined \expanded. | |||||
(etexcmds) In the latter case, load this package earlier. | |||||
))) | |||||
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4 | |||||
38. | |||||
Package grfext Info: Graphics extension search list: | |||||
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE | |||||
G,.JBIG2,.JB2,.eps] | |||||
(grfext) \AppendGraphicsExtensions on input line 456. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg | |||||
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv | |||||
e | |||||
)) | |||||
Package caption Info: Begin \AtBeginDocument code. | |||||
Package caption Info: End \AtBeginDocument code. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <12> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <8> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <6> on input line 11. | |||||
(./12.toc | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <10.95> on input line 3. | |||||
) | |||||
\tf@toc=\write3 | |||||
\openout3 = `12.toc'. | |||||
Overfull \hbox (11.59073pt too wide) in paragraph at lines 16--17 | |||||
\OT1/cmr/m/n/10.95 stal-la-tions. These sen-sors use ZMTrig-ger.pl (wiki.zonemi | |||||
nder.com/ZMTrigger) | |||||
[] | |||||
[1 | |||||
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] | |||||
LaTeX Font Info: Try loading font information for OMS+cmr on input line 21. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd | |||||
File: omscmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions | |||||
) | |||||
LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10.95> not available | |||||
(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 21. | |||||
[2] | |||||
<../pics/DSCN0207.JPG, id=14, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0207.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0207.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0207.JPG used on input line 53. | |||||
(pdftex.def) Requested size: 321.1943pt x 240.89572pt. | |||||
Package caption Warning: \captionsetup{type*=...} or \captionof | |||||
(caption) outside box or environment on input line 54. | |||||
See the caption package documentation for explanation. | |||||
[3] | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <9> on input line 56. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <5> on input line 56. | |||||
[4 <../pics/DSCN0207.JPG>] | |||||
<../pics/DSCN0217.JPG, id=24, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0217.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0217.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0217.JPG used on input line 73. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0220.JPG, id=25, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0220.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0220.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0220.JPG used on input line 76. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[5 <../pics/DSCN0217.JPG>] <../pics/DSCN0225.JPG, id=29, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0225.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0225.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0225.JPG used on input line 79. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0227.JPG, id=30, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0227.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0227.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0227.JPG used on input line 82. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/walloutlet2.jpg, id=31, 481.8pt x 642.4pt> | |||||
File: ../pics/walloutlet2.jpg Graphic file (type jpg) | |||||
<use ../pics/walloutlet2.jpg> | |||||
Package pdftex.def Info: ../pics/walloutlet2.jpg used on input line 85. | |||||
(pdftex.def) Requested size: 120.44969pt x 160.59961pt. | |||||
[6 <../pics/DSCN0220.JPG> <../pics/DSCN0225.JPG> <../pics/DSCN0227.JPG>] <../p | |||||
ics/DSCN0265.JPG, id=35, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0265.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0265.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0265.JPG used on input line 94. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[7 <../pics/walloutlet2.jpg> <../pics/DSCN0265.JPG>] | |||||
Overfull \hbox (7.91602pt too wide) in paragraph at lines 112--112 | |||||
[] \OT1/cmtt/m/n/10.95 is. To use with 5v ttl (using a second 5v source) wire a | |||||
s such:[] | |||||
[] | |||||
<../pics/DSCN0273.JPG, id=40, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0273.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0273.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0273.JPG used on input line 115. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[8 <../pics/DSCN0273.JPG>] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no œ in font cmtt10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no ™ in font cmtt10! | |||||
Missing character: There is no  in font cmtt10! | |||||
Missing character: There is no in font cmtt10! | |||||
Missing character: There is no  in font cmtt10! | |||||
Missing character: There is no in font cmtt10! | |||||
Overfull \hbox (94.14633pt too wide) in paragraph at lines 146--146 | |||||
[]\OT1/cmtt/m/n/10.95 Heres a small utility function which determines how much | |||||
RAM iscurrentlyunused:[] | |||||
[] | |||||
Overfull \hbox (71.15158pt too wide) in paragraph at lines 146--146 | |||||
[] \OT1/cmtt/m/n/10.95 return (int) &v - (__brkval == 0 ? (int) &__heap_start | |||||
: (int) __brkval);[] | |||||
[] | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no ™ in font cmtt10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no œ in font cmtt10! | |||||
Underfull \hbox (badness 4391) in paragraph at lines 149--153 | |||||
[]\OT1/cmr/m/n/10.95 An easy res-o-lu-tion for this is to put all se-rial.print | |||||
lines into | |||||
[] | |||||
Underfull \hbox (badness 1158) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 flash mem-ory. You can ver-ify this helps, by tak-ing a se-r | |||||
ial.print, | |||||
[] | |||||
Underfull \hbox (badness 2426) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 and com-ment-ing it out, and com-par-ing the be-fore and af- | |||||
ter dy- | |||||
[] | |||||
Underfull \hbox (badness 1546) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 namic mem-ory used in ver-ify. To put se-rial print lines in | |||||
flash: | |||||
[] | |||||
Overfull \hbox (67.99345pt too wide) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 (https://www.arduino.cc/reference/en/language/functions/comm | |||||
unication/serial/write/) | |||||
[] | |||||
Overfull \hbox (67.08095pt too wide) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 (https://www.arduino.cc/reference/en/language/functions/comm | |||||
unication/serial/print/) | |||||
[] | |||||
[9] <../pics/wshark1.jpg, id=48, 1018.55531pt x 883.80188pt> | |||||
File: ../pics/wshark1.jpg Graphic file (type jpg) | |||||
<use ../pics/wshark1.jpg> | |||||
Package pdftex.def Info: ../pics/wshark1.jpg used on input line 158. | |||||
(pdftex.def) Requested size: 509.27641pt x 441.89986pt. | |||||
Overfull \hbox (149.27641pt too wide) in paragraph at lines 158--159 | |||||
[][] | |||||
[] | |||||
[10] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
[11 <../pics/wshark1.jpg>] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no � in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no � in font cmr10! | |||||
[12] [13] (./12.aux) ) | |||||
Here is how much of TeX's memory you used: | |||||
2645 strings out of 494945 | |||||
42438 string characters out of 6181032 | |||||
96817 words of memory out of 5000000 | |||||
5921 multiletter control sequences out of 15000+600000 | |||||
10198 words of font info for 36 fonts, out of 8000000 for 9000 | |||||
14 hyphenation exceptions out of 8191 | |||||
39i,8n,39p,658b,194s stack positions out of 5000i,500n,10000p,200000b,80000s | |||||
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfon | |||||
ts/cm/cmbx10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/ | |||||
cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10. | |||||
pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></u | |||||
sr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr6.pfb></usr/share | |||||
/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb></usr/share/texlive | |||||
/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb></usr/share/texlive/texmf-d | |||||
ist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fo | |||||
nts/type1/public/amsfonts/cm/cmtt10.pfb> | |||||
Output written on 12.pdf (13 pages, 1515817 bytes). | |||||
PDF statistics: | |||||
92 PDF objects out of 1000 (max. 8388607) | |||||
58 compressed objects within 1 object stream | |||||
0 named destinations out of 1000 (max. 500000) | |||||
46 words of extra memory for PDF output out of 10000 (max. 10000000) | |||||
@ -0,0 +1,201 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\section{Omrom Photoelectric IR Emitter/Receiver} | |||||
All electronics is currently selling used Omrom photoelectric sensors, they are model: e3f2-r2c4. These types of photoelectric sensors are from a large catalog of different types. Some AC some DC powered. Different max distance, etc... See resources in this git repository for some PDFs. | |||||
I tested one without knowing how to use them, but had poor results. I was only able to get the light to flash when I dismantled the device, and put my hand very close to the IR. Teardown pictures are in the photos folder. The devices were not easy to dismantle, and can't really be put back together as they were originally. However, they did seem otherwise well made. \footnote{Repairs may be difficult.} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0265.JPG} | |||||
\captionof{figure}{Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.} | |||||
After finding some documentation on these in the reviews, I found out that the IR emitters require a reflective sticker in order to 'see' their IR beam reflect back. Not just a white surface, but the type of reflector you might see on a construction or night worker orange vest. | |||||
Hookup Instructions from All Electronics Comments: | |||||
\begin{verbatim} | |||||
is. To use with 5v ttl (using a second 5v source) wire as such: | |||||
Brown to +12V; Blue to ground; Pink to either +12 or ground | |||||
depending whether you want Light-ON or Dark-ON mode; | |||||
Black to a 4.7K resistor with the other side of the resistor | |||||
connected to a separate +5V source (the arduino). The 5v ttl | |||||
signal is at the point where the black wire connects to the | |||||
resistor. | |||||
\end{verbatim} | |||||
One thing I also noticed, was that used photo electric sensors from brand names can be obtained for discounts on the auction sites, to see if a good deal can be had. When buying them new, they can be relatively expensive for a hobbyist working out of his/her garage. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0273.JPG} | |||||
\captionof{figure}{IR in action. (without a reflective sticker, it doesn't go very far!)} | |||||
\section{Using the HFS-DC06H Microwave Sensor} | |||||
As I've tried with the HB100 (just the RF part of this HFS-DC06H), without success, I've moved to the HFS-DC06H microwave sensor which includes the Op Amp and accompanying circuitry (it simply outputs a digital high or low). | |||||
During testing, I found that the HFS sensor would not work correctly with my laptops usb 2.0 power supply. I thought it might be RF interferance from the metallic perf board – something I've seen before with an FM bug radio – but it was not. The HFS and the ENC require external power that is greater than my laptop can output. | |||||
\subsection{Uno Memory Limitations} | |||||
Using ethernet with the Uno is always touchy. Version control is important, to have a functional version to work off of. | |||||
When writing my code, I found errors creep in due to using too much of what the Arduino IDE calls dynamic memory. You can see how much dynamic memory is used in Arduino by hitting verify (not upload but verify)and reading the output from the toolchain. You can also use a tool to see how much SRAM is used (code is online:https://jeelabs.org/2011/05/22/atmega-memory-use/) the following function: | |||||
\begin{verbatim} | |||||
“Here’s a small utility function which determines how much RAM is currently unused: | |||||
int freeRam () { | |||||
extern int __heap_start, *__brkval; | |||||
int v; | |||||
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); | |||||
} | |||||
And here’s a sketch using that code: | |||||
void setup () { | |||||
Serial.begin(57600); | |||||
Serial.println("\n[memCheck]"); | |||||
Serial.println(freeRam()); | |||||
} | |||||
void loop () {} | |||||
The result will be: | |||||
[memCheck] | |||||
1846 | |||||
“ | |||||
\end{verbatim} | |||||
The UIPEthernet code requires significant RAM for the Uno. This is not a new problem for me, but it rears its ugly head again. However, this is a good thing. Limits are good. | |||||
An easy resolution for this is to put all serial.print lines into flash memory. You can verify this helps, by taking a serial.print, and commenting it out, and comparing the before and after dynamic memory used in verify. To put serial print lines in flash: | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/write/) | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/print/) | |||||
As I recall, there may be limitations to what you can do with Serial.print(F()), fotr example, converting variables into it will likely not work without further finesse, and libraries that print through serial likely won't work. | |||||
Low RAM errors can creep into strange places. For example, see these two wiresharks, where my code was running, equally as well, but the new code revision simply didn't work: | |||||
As you can see the data packet is mangled in the new rev. I've seen this enough to know, it was low SRAM. Otherwise, the code worked without major error. This small error effectively broke the program! Testing is always important, as well as saving multiple copies as you go, or alternatively version control. | |||||
\includegraphics[scale=0.5]{../pics/wshark1.jpg} | |||||
\captionof{figure}{First capture is correct. Second one, the lack of RAM causes the ENC to fail to send data to ZMTrigger.} | |||||
\section{Deployment} | |||||
Today I deployed both sensor boxes on site, connecting them to the ZM system. They both work\footnote{And have continued to work for about a year now}. I found that these HFS sensors appear to be fairly directional. I've been unable to get them to fire, when behind a wall, or up a floor, which is good – I don't want them to do that. The metal shield they have, seems to work well – blocking radio waves from going behind it. I mounted one on the ceiling and one on a wall, setting the cameras to nodect. Success. | |||||
However I have seen some issues with these, in the following situations. | |||||
\begin{itemize} | |||||
\item Mice in the ceiling, setting off the alarm | |||||
\item Flourescent lights being within 2 feet of the installation causing false alarms | |||||
\end{itemize} | |||||
Keep in mind, that if anything moves, it can set off the alarms. Including small animals. | |||||
I'm not sure exactly what frequency they are, but I think it is around 5GHz, comparable to 5GHz wifi (not going through walls well). I'm also considering putting some copper tape on the inside of the box, to help block anything through the wall it's mounted to, possibly... | |||||
When building this new shield I've made for the motion sensor, you can use flush cut pliers (the ones that cut really close to a board, if you are not familiar) and cut the WS2812 RGB LEDs right off of a \$3 RGB ring. You can also buy individual WS2812 LEDs. Cutting them off, is easier, and cheaper (and for those who run on a shoe-string budget) thus what I did here. There is a video I've made in the repo to show this process. | |||||
There's some things I'd like to add to the prototypes. First off, a light pipe, from the RGB LED to the box. Perhaps, 3D printed. Second, the RGB LED should change colours, very slightly when motion is detected. Not so much colour change that a casual glance will notice, but enough that if you are watching for it, you will see it. | |||||
\subsection{Work Log 1/31/19} | |||||
I'm assembling three of these for a company today. I can see right away some of the mistakes I made, and it's all DFA, or design for assembly errors. | |||||
I made a whole Arduino UNO shield, and that was a bad idea. I don't want to solder all of the 0.1” headers. There's a 10, two 8s, and a 6. It takes say 3-5 minutes per board. Too slow. I need to make the next shield with as few 0.1” headers as possible. Also, possibly a different connecter besides these pin headers would be better. Something easier to solder, perhaps reflow possible. | |||||
Another option would be to use a nano. Make assembly easy. That is very important. I also might want to consider a micro with built in ethernet, but for simplicity sake, for now Arduino Uno will do. Unos also are as future proof as you can get. | |||||
\subsection{The need for POE} | |||||
I deployed three of these in one company, and power wiring was an issue for one of them. One of them is going to require it's own 12V wiring (the other two worked with passive POE). Based on this, and knowing that there is a limit to what passive 12V POE can do, I've decided that I will use an 802.11 48v POE board for this application going forward. I don't want to take any chances with power being an issue. POE Injectors are relatively cheap. Back to the drawing board. | |||||
\subsection{HB100 are Sensitive to Fluorescent Lighting and Mains} | |||||
Do not install these HB100-based sensors near either mains or tube lights. They are sensitive, and will not operate correctly. I found that being within roughly 2 feet was too close. In my case, the logic high of the HB100 would go off randomly. | |||||
\end{document} | |||||
@ -0,0 +1,184 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\section{Omrom Photoelectric IR Emitter/Receiver} | |||||
All electronics is currently selling used Omrom photoelectric sensors, they are model: e3f2-r2c4. These types of photoelectric sensors are from a large catalog of different types. Some AC some DC powered. Different max distance, etc... See resources in this git repository for some PDFs. | |||||
I tested one without knowing how to use them, but had poor results. I was only able to get the light to flash when I dismantled the device, and put my hand very close to the IR. Teardown pictures are in the photos folder. The devices were not easy to dismantle, and can't really be put back together as they were originally. However, they did seem otherwise well made. \footnote{Repairs may be difficult.} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0265.JPG} | |||||
\captionof{figure}{Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.} | |||||
After finding some documentation on these in the reviews, I found out that the IR emitters require a reflective sticker in order to 'see' their IR beam reflect back. Not just a white surface, but the type of reflector you might see on a construction or night worker orange vest. | |||||
Hookup Instructions from All Electronics Comments: | |||||
\begin{verbatim} | |||||
is. To use with 5v ttl (using a second 5v source) wire as such: | |||||
Brown to +12V; Blue to ground; Pink to either +12 or ground | |||||
depending whether you want Light-ON or Dark-ON mode; | |||||
Black to a 4.7K resistor with the other side of the resistor | |||||
connected to a separate +5V source (the arduino). The 5v ttl | |||||
signal is at the point where the black wire connects to the | |||||
resistor. | |||||
\end{verbatim} | |||||
One thing I also noticed, was that used photo electric sensors from brand names can be obtained for discounts on the auction sites, to see if a good deal can be had. When buying them new, they can be relatively expensive for a hobbyist working out of his/her garage. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0273.JPG} | |||||
\captionof{figure}{IR in action. (without a reflective sticker, it doesn't go very far!)} | |||||
\section{Using the HFS-DC06H Microwave Sensor} | |||||
As I've tried with the HB100 (just the RF part of this HFS-DC06H), without success, I've moved to the HFS-DC06H microwave sensor which includes the Op Amp and accompanying circuitry (it simply outputs a digital high or low). | |||||
During testing, I found that the HFS sensor would not work correctly with my laptops usb 2.0 power supply. I thought it might be RF interferance from the metallic perf board – something I've seen before with an FM bug radio – but it was not. The HFS and the ENC require external power that is greater than my laptop can output. | |||||
\subsection{Uno Memory Limitations} | |||||
Using ethernet with the Uno is always touchy. Version control is important, to have a functional version to work off of. | |||||
When writing my code, I found errors creep in due to using too much of what the Arduino IDE calls dynamic memory. You can see how much dynamic memory is used in Arduino by hitting verify (not upload but verify)and reading the output from the toolchain. You can also use a tool to see how much SRAM is used (code is online:https://jeelabs.org/2011/05/22/atmega-memory-use/) the following function: | |||||
\begin{verbatim} | |||||
“Here’s a small utility function which determines how much RAM is currently unused: | |||||
int freeRam () { | |||||
extern int __heap_start, *__brkval; | |||||
int v; | |||||
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); | |||||
} | |||||
And here’s a sketch using that code: | |||||
void setup () { | |||||
Serial.begin(57600); | |||||
Serial.println("\n[memCheck]"); | |||||
Serial.println(freeRam()); | |||||
} | |||||
void loop () {} | |||||
The result will be: | |||||
[memCheck] | |||||
1846 | |||||
“ | |||||
\end{verbatim} | |||||
The UIPEthernet code requires significant RAM for the Uno. This is not a new problem for me, but it rears its ugly head again. However, this is a good thing. Limits are good. | |||||
An easy resolution for this is to put all serial.print lines into flash memory. You can verify this helps, by taking a serial.print, and commenting it out, and comparing the before and after dynamic memory used in verify. To put serial print lines in flash: | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/write/) | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/print/) | |||||
As I recall, there may be limitations to what you can do with Serial.print(F()), fotr example, converting variables into it will likely not work without further finesse, and libraries that print through serial likely won't work. | |||||
Low RAM errors can creep into strange places. For example, see these two wiresharks, where my code was running, equally as well, but the new code revision simply didn't work: | |||||
As you can see the data packet is mangled in the new rev. I've seen this enough to know, it was low SRAM. Otherwise, the code worked without major error. This small error effectively broke the program! Testing is always important, as well as saving multiple copies as you go, or alternatively version control. | |||||
\includegraphics[scale=0.5]{../pics/wshark1.jpg} | |||||
\captionof{figure}{First capture is correct. Second one, the lack of RAM causes the ENC to fail to send data to ZMTrigger.} | |||||
\section{Deployment} | |||||
Today I deployed both sensor boxes on site, connecting them to the ZM system. They both work\footnote{And have continued to work for about a year now}. I found that these HFS sensors appear to be fairly directional. I've been unable to get them to fire, when behind a wall, or up a floor, which is good – I don't want them to do that. The metal shield they have, seems to work well – blocking radio waves from going behind it. I mounted one on the ceiling and one on a wall, setting the cameras to nodect. Success. | |||||
However I have seen some issues with these, in the following situations. | |||||
\begin{itemize} | |||||
\item Mice in the ceiling, setting off the alarm | |||||
\item Flourescent lights being within 2 feet of the installation causing false alarms | |||||
\end{itemize} | |||||
Keep in mind, that if anything moves, it can set off the alarms. Including small animals. | |||||
I'm not sure exactly what frequency they are, but I think it is around 5GHz, comparable to 5GHz wifi (not going through walls well). I'm also considering putting some copper tape on the inside of the box, to help block anything through the wall it's mounted to, possibly... | |||||
When building this new shield I've made for the motion sensor, you can use flush cut pliers (the ones that cut really close to a board, if you are not familiar) and cut the WS2812 RGB LEDs right off of a $3 RGB ring. You can also buy individual WS2812 LEDs. Cutting them off, is easier, and cheaper (and for those who run on a shoe-string budget) thus what I did here. There is a video I've made to show this process. | |||||
\end{document} | |||||
@ -0,0 +1,15 @@ | |||||
\contentsline {section}{\numberline {1}Overview}{1} | |||||
\contentsline {section}{\numberline {2}Parts List}{2} | |||||
\contentsline {subsection}{\numberline {2.1}Other Sensors}{3} | |||||
\contentsline {section}{\numberline {3}Work Log}{3} | |||||
\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{3} | |||||
\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{4} | |||||
\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{5} | |||||
\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{5} | |||||
\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{7} | |||||
\contentsline {section}{\numberline {5}Using the HFS-DC06H Microwave Sensor}{8} | |||||
\contentsline {subsection}{\numberline {5.1}Uno Memory Limitations}{9} | |||||
\contentsline {section}{\numberline {6}Deployment}{12} | |||||
\contentsline {subsection}{\numberline {6.1}Work Log 1/31/19}{12} | |||||
\contentsline {subsection}{\numberline {6.2}The need for POE}{13} | |||||
\contentsline {subsection}{\numberline {6.3}HB100 are Sensitive to Fluorescent Lighting and Mains}{13} |
@ -0,0 +1,25 @@ | |||||
\relax | |||||
\@writefile{toc}{\contentsline {section}{\numberline {1}Overview}{1}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {2}Parts List}{1}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Other Sensors}{2}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {3}Work Log}{2}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{2}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Testing the Sick IR Diode Tripwire \relax }}{3}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{3}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{4}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \relax }}{4}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.\relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Arduino and Part 2 of sensor. Lined up with the other part.\relax }}{6}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.\relax }}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces IR in action. (without a reflective sticker, it doesn't go very far!)\relax }}{7}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {5}Using the HFS-DC06H Microwave Sensor}{7}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Uno Memory Limitations}{8}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces First capture is correct. Second one, the lack of RAM causes the ENC to fail to send data to ZMTrigger.\relax }}{10}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {6}Deployment}{11}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1}Work Log 1/31/19}{11}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {6.2}The need for POE}{12}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {6.3}HB100 are Sensitive to Fluorescent Lighting and Mains}{12}} |
@ -0,0 +1,369 @@ | |||||
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex 2019.8.17) 11 NOV 2019 01:22 | |||||
entering extended mode | |||||
restricted \write18 enabled. | |||||
%&-line parsing enabled. | |||||
**/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/ | |||||
ZMHW_Modector/docs/13.tex | |||||
(/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/Z | |||||
MHW_Modector/docs/13.tex | |||||
LaTeX2e <2017/01/01> patch level 3 | |||||
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls | |||||
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo | |||||
File: size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option) | |||||
) | |||||
\c@part=\count79 | |||||
\c@section=\count80 | |||||
\c@subsection=\count81 | |||||
\c@subsubsection=\count82 | |||||
\c@paragraph=\count83 | |||||
\c@subparagraph=\count84 | |||||
\c@figure=\count85 | |||||
\c@table=\count86 | |||||
\abovecaptionskip=\skip41 | |||||
\belowcaptionskip=\skip42 | |||||
\bibindent=\dimen102 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty | |||||
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty | |||||
Package: keyval 2014/10/28 v1.15 key=value parser (DPC) | |||||
\KV@toks@=\toks14 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty | |||||
Package: graphics 2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty | |||||
Package: trig 2016/01/03 v1.10 sin cos tan (DPC) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg | |||||
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration | |||||
) | |||||
Package graphics Info: Driver file: pdftex.def on input line 99. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def | |||||
File: pdftex.def 2017/01/12 v0.06k Graphics/color for pdfTeX | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty | |||||
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty | |||||
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO) | |||||
) | |||||
\Gread@gobject=\count87 | |||||
)) | |||||
\Gin@req@height=\dimen103 | |||||
\Gin@req@width=\dimen104 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty | |||||
Package: caption 2016/02/21 v3.3-144 Customizing captions (AR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty | |||||
Package: caption3 2016/05/22 v1.7-166 caption3 kernel (AR) | |||||
Package caption3 Info: TeX engine: e-TeX on input line 67. | |||||
\captionmargin=\dimen105 | |||||
\captionmargin@=\dimen106 | |||||
\captionwidth=\dimen107 | |||||
\caption@tempdima=\dimen108 | |||||
\caption@indent=\dimen109 | |||||
\caption@parindent=\dimen110 | |||||
\caption@hangindent=\dimen111 | |||||
) | |||||
\c@ContinuedFloat=\count88 | |||||
) | |||||
No file 13.aux. | |||||
\openout1 = `13.aux'. | |||||
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii | |||||
[Loading MPS to PDF converter (version 2006.09.02).] | |||||
\scratchcounter=\count89 | |||||
\scratchdimen=\dimen112 | |||||
\scratchbox=\box26 | |||||
\nofMPsegments=\count90 | |||||
\nofMParguments=\count91 | |||||
\everyMPshowfont=\toks15 | |||||
\MPscratchCnt=\count92 | |||||
\MPscratchDim=\dimen113 | |||||
\MPnumerator=\count93 | |||||
\makeMPintoPDFobject=\count94 | |||||
\everyMPtoPDFconversion=\toks16 | |||||
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty | |||||
Package: pdftexcmds 2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty | |||||
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO) | |||||
Package ifluatex Info: LuaTeX not detected. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty | |||||
Package: ifpdf 2016/05/14 v3.1 Provides the ifpdf switch | |||||
) | |||||
Package pdftexcmds Info: LuaTeX not detected. | |||||
Package pdftexcmds Info: \pdf@primitive is available. | |||||
Package pdftexcmds Info: \pdf@ifprimitive is available. | |||||
Package pdftexcmds Info: \pdfdraftmode found. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty | |||||
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty | |||||
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty | |||||
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO) | |||||
)) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty | |||||
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty | |||||
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty | |||||
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO) | |||||
Package etexcmds Info: Could not find \expanded. | |||||
(etexcmds) That can mean that you are not using pdfTeX 1.50 or | |||||
(etexcmds) that some package has redefined \expanded. | |||||
(etexcmds) In the latter case, load this package earlier. | |||||
))) | |||||
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4 | |||||
38. | |||||
Package grfext Info: Graphics extension search list: | |||||
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE | |||||
G,.JBIG2,.JB2,.eps] | |||||
(grfext) \AppendGraphicsExtensions on input line 456. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg | |||||
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv | |||||
e | |||||
)) | |||||
Package caption Info: Begin \AtBeginDocument code. | |||||
Package caption Info: End \AtBeginDocument code. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <12> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <8> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <6> on input line 11. | |||||
No file 13.toc. | |||||
\tf@toc=\write3 | |||||
\openout3 = `13.toc'. | |||||
Overfull \hbox (11.59073pt too wide) in paragraph at lines 16--17 | |||||
\OT1/cmr/m/n/10.95 stal-la-tions. These sen-sors use ZMTrig-ger.pl (wiki.zonemi | |||||
nder.com/ZMTrigger) | |||||
[] | |||||
LaTeX Font Info: Try loading font information for OMS+cmr on input line 21. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd | |||||
File: omscmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions | |||||
) | |||||
LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10.95> not available | |||||
(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 21. | |||||
[1 | |||||
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] | |||||
<../pics/DSCN0207.JPG, id=10, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0207.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0207.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0207.JPG used on input line 53. | |||||
(pdftex.def) Requested size: 321.1943pt x 240.89572pt. | |||||
Package caption Warning: \captionsetup{type*=...} or \captionof | |||||
(caption) outside box or environment on input line 54. | |||||
See the caption package documentation for explanation. | |||||
[2] | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <10.95> on input line 56. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <9> on input line 56. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <5> on input line 56. | |||||
[3 <../pics/DSCN0207.JPG>] | |||||
<../pics/DSCN0217.JPG, id=20, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0217.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0217.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0217.JPG used on input line 73. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0220.JPG, id=21, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0220.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0220.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0220.JPG used on input line 76. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[4 <../pics/DSCN0217.JPG>] <../pics/DSCN0225.JPG, id=25, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0225.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0225.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0225.JPG used on input line 79. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0227.JPG, id=26, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0227.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0227.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0227.JPG used on input line 82. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/walloutlet2.jpg, id=27, 481.8pt x 642.4pt> | |||||
File: ../pics/walloutlet2.jpg Graphic file (type jpg) | |||||
<use ../pics/walloutlet2.jpg> | |||||
Package pdftex.def Info: ../pics/walloutlet2.jpg used on input line 85. | |||||
(pdftex.def) Requested size: 120.44969pt x 160.59961pt. | |||||
[5 <../pics/DSCN0220.JPG> <../pics/DSCN0225.JPG> <../pics/DSCN0227.JPG>] <../p | |||||
ics/DSCN0265.JPG, id=31, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0265.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0265.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0265.JPG used on input line 94. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[6 <../pics/walloutlet2.jpg> <../pics/DSCN0265.JPG>] | |||||
Overfull \hbox (7.91602pt too wide) in paragraph at lines 112--112 | |||||
[] \OT1/cmtt/m/n/10.95 is. To use with 5v ttl (using a second 5v source) wire a | |||||
s such:[] | |||||
[] | |||||
<../pics/DSCN0273.JPG, id=35, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0273.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0273.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0273.JPG used on input line 115. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[7 <../pics/DSCN0273.JPG>] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no œ in font cmtt10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no ™ in font cmtt10! | |||||
Missing character: There is no  in font cmtt10! | |||||
Missing character: There is no in font cmtt10! | |||||
Missing character: There is no  in font cmtt10! | |||||
Missing character: There is no in font cmtt10! | |||||
Overfull \hbox (94.14633pt too wide) in paragraph at lines 146--146 | |||||
[]\OT1/cmtt/m/n/10.95 Heres a small utility function which determines how much | |||||
RAM iscurrentlyunused:[] | |||||
[] | |||||
Overfull \hbox (71.15158pt too wide) in paragraph at lines 146--146 | |||||
[] \OT1/cmtt/m/n/10.95 return (int) &v - (__brkval == 0 ? (int) &__heap_start | |||||
: (int) __brkval);[] | |||||
[] | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no ™ in font cmtt10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no œ in font cmtt10! | |||||
Underfull \hbox (badness 4391) in paragraph at lines 149--153 | |||||
[]\OT1/cmr/m/n/10.95 An easy res-o-lu-tion for this is to put all se-rial.print | |||||
lines into | |||||
[] | |||||
Underfull \hbox (badness 1158) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 flash mem-ory. You can ver-ify this helps, by tak-ing a se-r | |||||
ial.print, | |||||
[] | |||||
Underfull \hbox (badness 2426) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 and com-ment-ing it out, and com-par-ing the be-fore and af- | |||||
ter dy- | |||||
[] | |||||
Underfull \hbox (badness 1546) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 namic mem-ory used in ver-ify. To put se-rial print lines in | |||||
flash: | |||||
[] | |||||
Overfull \hbox (67.99345pt too wide) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 (https://www.arduino.cc/reference/en/language/functions/comm | |||||
unication/serial/write/) | |||||
[] | |||||
Overfull \hbox (67.08095pt too wide) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 (https://www.arduino.cc/reference/en/language/functions/comm | |||||
unication/serial/print/) | |||||
[] | |||||
[8] <../pics/wshark1.jpg, id=44, 1018.55531pt x 883.80188pt> | |||||
File: ../pics/wshark1.jpg Graphic file (type jpg) | |||||
<use ../pics/wshark1.jpg> | |||||
Package pdftex.def Info: ../pics/wshark1.jpg used on input line 158. | |||||
(pdftex.def) Requested size: 509.27641pt x 441.89986pt. | |||||
Overfull \hbox (149.27641pt too wide) in paragraph at lines 158--159 | |||||
[][] | |||||
[] | |||||
[9] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
[10 <../pics/wshark1.jpg>] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no � in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no � in font cmr10! | |||||
[11] [12] (./13.aux) ) | |||||
Here is how much of TeX's memory you used: | |||||
2639 strings out of 494945 | |||||
42386 string characters out of 6181032 | |||||
96817 words of memory out of 5000000 | |||||
5920 multiletter control sequences out of 15000+600000 | |||||
9890 words of font info for 35 fonts, out of 8000000 for 9000 | |||||
14 hyphenation exceptions out of 8191 | |||||
39i,8n,39p,658b,194s stack positions out of 5000i,500n,10000p,200000b,80000s | |||||
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfon | |||||
ts/cm/cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/ | |||||
cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.p | |||||
fb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr6.pfb></usr | |||||
/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb></usr/share/t | |||||
exlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb></usr/share/texlive/t | |||||
exmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-d | |||||
ist/fonts/type1/public/amsfonts/cm/cmtt10.pfb> | |||||
Output written on 13.pdf (12 pages, 1497976 bytes). | |||||
PDF statistics: | |||||
84 PDF objects out of 1000 (max. 8388607) | |||||
52 compressed objects within 1 object stream | |||||
0 named destinations out of 1000 (max. 500000) | |||||
46 words of extra memory for PDF output out of 10000 (max. 10000000) | |||||
@ -0,0 +1,201 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\section{Omrom Photoelectric IR Emitter/Receiver} | |||||
All electronics is currently selling used Omrom photoelectric sensors, they are model: e3f2-r2c4. These types of photoelectric sensors are from a large catalog of different types. Some AC some DC powered. Different max distance, etc... See resources in this git repository for some PDFs. | |||||
I tested one without knowing how to use them, but had poor results. I was only able to get the light to flash when I dismantled the device, and put my hand very close to the IR. Teardown pictures are in the photos folder. The devices were not easy to dismantle, and can't really be put back together as they were originally. However, they did seem otherwise well made. \footnote{Repairs may be difficult.} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0265.JPG} | |||||
\captionof{figure}{Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.} | |||||
After finding some documentation on these in the reviews, I found out that the IR emitters require a reflective sticker in order to 'see' their IR beam reflect back. Not just a white surface, but the type of reflector you might see on a construction or night worker orange vest. | |||||
Hookup Instructions from All Electronics Comments: | |||||
\begin{verbatim} | |||||
is. To use with 5v ttl (using a second 5v source) wire as such: | |||||
Brown to +12V; Blue to ground; Pink to either +12 or ground | |||||
depending whether you want Light-ON or Dark-ON mode; | |||||
Black to a 4.7K resistor with the other side of the resistor | |||||
connected to a separate +5V source (the arduino). The 5v ttl | |||||
signal is at the point where the black wire connects to the | |||||
resistor. | |||||
\end{verbatim} | |||||
One thing I also noticed, was that used photo electric sensors from brand names can be obtained for discounts on the auction sites, to see if a good deal can be had. When buying them new, they can be relatively expensive for a hobbyist working out of his/her garage. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0273.JPG} | |||||
\captionof{figure}{IR in action. (without a reflective sticker, it doesn't go very far!)} | |||||
\section{Using the HFS-DC06H Microwave Sensor} | |||||
As I've tried with the HB100 (just the RF part of this HFS-DC06H), without success, I've moved to the HFS-DC06H microwave sensor which includes the Op Amp and accompanying circuitry (it simply outputs a digital high or low). | |||||
During testing, I found that the HFS sensor would not work correctly with my laptops usb 2.0 power supply. I thought it might be RF interferance from the metallic perf board – something I've seen before with an FM bug radio – but it was not. The HFS and the ENC require external power that is greater than my laptop can output. | |||||
\subsection{Uno Memory Limitations} | |||||
Using ethernet with the Uno is always touchy. Version control is important, to have a functional version to work off of. | |||||
When writing my code, I found errors creep in due to using too much of what the Arduino IDE calls dynamic memory. You can see how much dynamic memory is used in Arduino by hitting verify (not upload but verify)and reading the output from the toolchain. You can also use a tool to see how much SRAM is used (code is online:https://jeelabs.org/2011/05/22/atmega-memory-use/) the following function: | |||||
\begin{verbatim} | |||||
“Here’s a small utility function which determines how much RAM is currently unused: | |||||
int freeRam () { | |||||
extern int __heap_start, *__brkval; | |||||
int v; | |||||
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); | |||||
} | |||||
And here’s a sketch using that code: | |||||
void setup () { | |||||
Serial.begin(57600); | |||||
Serial.println("\n[memCheck]"); | |||||
Serial.println(freeRam()); | |||||
} | |||||
void loop () {} | |||||
The result will be: | |||||
[memCheck] | |||||
1846 | |||||
“ | |||||
\end{verbatim} | |||||
The UIPEthernet code requires significant RAM for the Uno. This is not a new problem for me, but it rears its ugly head again. However, this is a good thing. Limits are good. | |||||
An easy resolution for this is to put all serial.print lines into flash memory. You can verify this helps, by taking a serial.print, and commenting it out, and comparing the before and after dynamic memory used in verify. To put serial print lines in flash: | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/write/) | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/print/) | |||||
As I recall, there may be limitations to what you can do with Serial.print(F()), fotr example, converting variables into it will likely not work without further finesse, and libraries that print through serial likely won't work. | |||||
Low RAM errors can creep into strange places. For example, see these two wiresharks, where my code was running, equally as well, but the new code revision simply didn't work: | |||||
As you can see the data packet is mangled in the new rev. I've seen this enough to know, it was low SRAM. Otherwise, the code worked without major error. This small error effectively broke the program! Testing is always important, as well as saving multiple copies as you go, or alternatively version control. | |||||
\includegraphics[scale=0.5]{../pics/wshark1.jpg} | |||||
\captionof{figure}{First capture is correct. Second one, the lack of RAM causes the ENC to fail to send data to ZMTrigger.} | |||||
\section{Deployment} | |||||
Today I deployed both sensor boxes on site, connecting them to the ZM system. They both work\footnote{And have continued to work for about a year now}. I found that these HFS sensors appear to be fairly directional. I've been unable to get them to fire, when behind a wall, or up a floor, which is good – I don't want them to do that. The metal shield they have, seems to work well – blocking radio waves from going behind it. I mounted one on the ceiling and one on a wall, setting the cameras to nodect. Success. | |||||
However I have seen some issues with these, in the following situations. | |||||
\begin{itemize} | |||||
\item Mice in the ceiling, setting off the alarm | |||||
\item Flourescent lights being within 2 feet of the installation causing false alarms | |||||
\end{itemize} | |||||
Keep in mind, that if anything moves, it can set off the alarms. Including small animals. | |||||
I'm not sure exactly what frequency they are, but I think it is around 5GHz, comparable to 5GHz wifi (not going through walls well). I'm also considering putting some copper tape on the inside of the box, to help block anything through the wall it's mounted to, possibly... | |||||
When building this new shield I've made for the motion sensor, you can use flush cut pliers (the ones that cut really close to a board, if you are not familiar) and cut the WS2812 RGB LEDs right off of a \$3 RGB ring. You can also buy individual WS2812 LEDs. Cutting them off, is easier, and cheaper (and for those who run on a shoe-string budget) thus what I did here. There is a video I've made in the repo to show this process. | |||||
There's some things I'd like to add to the prototypes. First off, a light pipe, from the RGB LED to the box. Perhaps, 3D printed. Second, the RGB LED should change colours, very slightly when motion is detected. Not so much colour change that a casual glance will notice, but enough that if you are watching for it, you will see it. | |||||
\subsection{Work Log 1/31/19} | |||||
I'm assembling three of these for a company today. I can see right away some of the mistakes I made, and it's all DFA, or design for assembly errors. | |||||
I made a whole Arduino UNO shield, and that was a bad idea. I don't want to solder all of the 0.1” headers. There's a 10, two 8s, and a 6. It takes say 3-5 minutes per board. Too slow. I need to make the next shield with as few 0.1” headers as possible. Also, possibly a different connecter besides these pin headers would be better. Something easier to solder, perhaps reflow possible. | |||||
Another option would be to use a nano. Make assembly easy. That is very important. I also might want to consider a micro with built in ethernet, but for simplicity sake, for now Arduino Uno will do. Unos also are as future proof as you can get. | |||||
\subsection{The need for POE} | |||||
I deployed three of these in one company, and power wiring was an issue for one of them. One of them is going to require it's own 12V wiring (the other two worked with passive POE). Based on this, and knowing that there is a limit to what passive 12V POE can do, I've decided that I will use an 802.11 48v POE board for this application going forward. I don't want to take any chances with power being an issue. POE Injectors are relatively cheap. Back to the drawing board. | |||||
\subsection{HB100 are Sensitive to Fluorescent Lighting and Mains} | |||||
Do not install these HB100-based sensors near either mains or tube lights. They are sensitive, and will not operate correctly. I found that being within roughly 2 feet was too close. In my case, the logic high of the HB100 would go off randomly. | |||||
\end{document} | |||||
@ -0,0 +1,15 @@ | |||||
\contentsline {section}{\numberline {1}Overview}{1} | |||||
\contentsline {section}{\numberline {2}Parts List}{1} | |||||
\contentsline {subsection}{\numberline {2.1}Other Sensors}{2} | |||||
\contentsline {section}{\numberline {3}Work Log}{2} | |||||
\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{2} | |||||
\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{3} | |||||
\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{4} | |||||
\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{4} | |||||
\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{6} | |||||
\contentsline {section}{\numberline {5}Using the HFS-DC06H Microwave Sensor}{7} | |||||
\contentsline {subsection}{\numberline {5.1}Uno Memory Limitations}{8} | |||||
\contentsline {section}{\numberline {6}Deployment}{11} | |||||
\contentsline {subsection}{\numberline {6.1}Work Log 1/31/19}{11} | |||||
\contentsline {subsection}{\numberline {6.2}The need for POE}{12} | |||||
\contentsline {subsection}{\numberline {6.3}HB100 are Sensitive to Fluorescent Lighting and Mains}{12} |
@ -0,0 +1,25 @@ | |||||
\relax | |||||
\@writefile{toc}{\contentsline {section}{\numberline {1}Overview}{1}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {2}Parts List}{2}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Other Sensors}{3}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {3}Work Log}{3}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{3}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Testing the Sick IR Diode Tripwire \relax }}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{5}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces \relax }}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces \relax }}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.\relax }}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Arduino and Part 2 of sensor. Lined up with the other part.\relax }}{7}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{7}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.\relax }}{7}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces IR in action. (without a reflective sticker, it doesn't go very far!)\relax }}{8}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {5}Using the HFS-DC06H Microwave Sensor}{8}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Uno Memory Limitations}{9}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces First capture is correct. Second one, the lack of RAM causes the ENC to fail to send data to ZMTrigger.\relax }}{11}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {6}Deployment}{12}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1}Work Log 1/31/19}{12}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {6.2}The need for POE}{13}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {6.3}HB100 are Sensitive to Fluorescent Lighting and Mains}{13}} |
@ -0,0 +1,373 @@ | |||||
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex 2019.8.17) 22 NOV 2019 23:57 | |||||
entering extended mode | |||||
restricted \write18 enabled. | |||||
%&-line parsing enabled. | |||||
**/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/ | |||||
ZMHW_Modector/docs/14.tex | |||||
(/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/Z | |||||
MHW_Modector/docs/14.tex | |||||
LaTeX2e <2017/01/01> patch level 3 | |||||
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls | |||||
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo | |||||
File: size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option) | |||||
) | |||||
\c@part=\count79 | |||||
\c@section=\count80 | |||||
\c@subsection=\count81 | |||||
\c@subsubsection=\count82 | |||||
\c@paragraph=\count83 | |||||
\c@subparagraph=\count84 | |||||
\c@figure=\count85 | |||||
\c@table=\count86 | |||||
\abovecaptionskip=\skip41 | |||||
\belowcaptionskip=\skip42 | |||||
\bibindent=\dimen102 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty | |||||
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty | |||||
Package: keyval 2014/10/28 v1.15 key=value parser (DPC) | |||||
\KV@toks@=\toks14 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty | |||||
Package: graphics 2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty | |||||
Package: trig 2016/01/03 v1.10 sin cos tan (DPC) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg | |||||
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration | |||||
) | |||||
Package graphics Info: Driver file: pdftex.def on input line 99. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def | |||||
File: pdftex.def 2017/01/12 v0.06k Graphics/color for pdfTeX | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty | |||||
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty | |||||
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO) | |||||
) | |||||
\Gread@gobject=\count87 | |||||
)) | |||||
\Gin@req@height=\dimen103 | |||||
\Gin@req@width=\dimen104 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty | |||||
Package: caption 2016/02/21 v3.3-144 Customizing captions (AR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty | |||||
Package: caption3 2016/05/22 v1.7-166 caption3 kernel (AR) | |||||
Package caption3 Info: TeX engine: e-TeX on input line 67. | |||||
\captionmargin=\dimen105 | |||||
\captionmargin@=\dimen106 | |||||
\captionwidth=\dimen107 | |||||
\caption@tempdima=\dimen108 | |||||
\caption@indent=\dimen109 | |||||
\caption@parindent=\dimen110 | |||||
\caption@hangindent=\dimen111 | |||||
) | |||||
\c@ContinuedFloat=\count88 | |||||
) (./14.aux) | |||||
\openout1 = `14.aux'. | |||||
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii | |||||
[Loading MPS to PDF converter (version 2006.09.02).] | |||||
\scratchcounter=\count89 | |||||
\scratchdimen=\dimen112 | |||||
\scratchbox=\box26 | |||||
\nofMPsegments=\count90 | |||||
\nofMParguments=\count91 | |||||
\everyMPshowfont=\toks15 | |||||
\MPscratchCnt=\count92 | |||||
\MPscratchDim=\dimen113 | |||||
\MPnumerator=\count93 | |||||
\makeMPintoPDFobject=\count94 | |||||
\everyMPtoPDFconversion=\toks16 | |||||
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty | |||||
Package: pdftexcmds 2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty | |||||
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO) | |||||
Package ifluatex Info: LuaTeX not detected. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty | |||||
Package: ifpdf 2016/05/14 v3.1 Provides the ifpdf switch | |||||
) | |||||
Package pdftexcmds Info: LuaTeX not detected. | |||||
Package pdftexcmds Info: \pdf@primitive is available. | |||||
Package pdftexcmds Info: \pdf@ifprimitive is available. | |||||
Package pdftexcmds Info: \pdfdraftmode found. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty | |||||
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty | |||||
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty | |||||
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO) | |||||
)) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty | |||||
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty | |||||
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty | |||||
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO) | |||||
Package etexcmds Info: Could not find \expanded. | |||||
(etexcmds) That can mean that you are not using pdfTeX 1.50 or | |||||
(etexcmds) that some package has redefined \expanded. | |||||
(etexcmds) In the latter case, load this package earlier. | |||||
))) | |||||
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4 | |||||
38. | |||||
Package grfext Info: Graphics extension search list: | |||||
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE | |||||
G,.JBIG2,.JB2,.eps] | |||||
(grfext) \AppendGraphicsExtensions on input line 456. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg | |||||
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv | |||||
e | |||||
)) | |||||
Package caption Info: Begin \AtBeginDocument code. | |||||
Package caption Info: End \AtBeginDocument code. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <12> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <8> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <6> on input line 11. | |||||
(./14.toc | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <10.95> on input line 3. | |||||
) | |||||
\tf@toc=\write3 | |||||
\openout3 = `14.toc'. | |||||
Overfull \hbox (11.59073pt too wide) in paragraph at lines 16--17 | |||||
\OT1/cmr/m/n/10.95 stal-la-tions. These sen-sors use ZMTrig-ger.pl (wiki.zonemi | |||||
nder.com/ZMTrigger) | |||||
[] | |||||
[1 | |||||
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] | |||||
LaTeX Font Info: Try loading font information for OMS+cmr on input line 21. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd | |||||
File: omscmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions | |||||
) | |||||
LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10.95> not available | |||||
(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 21. | |||||
[2] | |||||
<../pics/DSCN0207.JPG, id=14, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0207.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0207.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0207.JPG used on input line 53. | |||||
(pdftex.def) Requested size: 321.1943pt x 240.89572pt. | |||||
Package caption Warning: \captionsetup{type*=...} or \captionof | |||||
(caption) outside box or environment on input line 54. | |||||
See the caption package documentation for explanation. | |||||
[3] | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <9> on input line 56. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <5> on input line 56. | |||||
[4 <../pics/DSCN0207.JPG>] | |||||
<../pics/DSCN0217.JPG, id=24, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0217.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0217.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0217.JPG used on input line 73. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0220.JPG, id=25, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0220.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0220.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0220.JPG used on input line 76. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[5 <../pics/DSCN0217.JPG>] <../pics/DSCN0225.JPG, id=29, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0225.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0225.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0225.JPG used on input line 79. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0227.JPG, id=30, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0227.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0227.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0227.JPG used on input line 82. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/walloutlet2.jpg, id=31, 481.8pt x 642.4pt> | |||||
File: ../pics/walloutlet2.jpg Graphic file (type jpg) | |||||
<use ../pics/walloutlet2.jpg> | |||||
Package pdftex.def Info: ../pics/walloutlet2.jpg used on input line 85. | |||||
(pdftex.def) Requested size: 120.44969pt x 160.59961pt. | |||||
[6 <../pics/DSCN0220.JPG> <../pics/DSCN0225.JPG> <../pics/DSCN0227.JPG>] <../p | |||||
ics/DSCN0265.JPG, id=35, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0265.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0265.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0265.JPG used on input line 94. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[7 <../pics/walloutlet2.jpg> <../pics/DSCN0265.JPG>] | |||||
Overfull \hbox (7.91602pt too wide) in paragraph at lines 112--112 | |||||
[] \OT1/cmtt/m/n/10.95 is. To use with 5v ttl (using a second 5v source) wire a | |||||
s such:[] | |||||
[] | |||||
<../pics/DSCN0273.JPG, id=40, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0273.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0273.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0273.JPG used on input line 115. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[8 <../pics/DSCN0273.JPG>] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no œ in font cmtt10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no ™ in font cmtt10! | |||||
Missing character: There is no  in font cmtt10! | |||||
Missing character: There is no in font cmtt10! | |||||
Missing character: There is no  in font cmtt10! | |||||
Missing character: There is no in font cmtt10! | |||||
Overfull \hbox (94.14633pt too wide) in paragraph at lines 146--146 | |||||
[]\OT1/cmtt/m/n/10.95 Heres a small utility function which determines how much | |||||
RAM iscurrentlyunused:[] | |||||
[] | |||||
Overfull \hbox (71.15158pt too wide) in paragraph at lines 146--146 | |||||
[] \OT1/cmtt/m/n/10.95 return (int) &v - (__brkval == 0 ? (int) &__heap_start | |||||
: (int) __brkval);[] | |||||
[] | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no ™ in font cmtt10! | |||||
Missing character: There is no â in font cmtt10! | |||||
Missing character: There is no € in font cmtt10! | |||||
Missing character: There is no œ in font cmtt10! | |||||
Underfull \hbox (badness 4391) in paragraph at lines 149--153 | |||||
[]\OT1/cmr/m/n/10.95 An easy res-o-lu-tion for this is to put all se-rial.print | |||||
lines into | |||||
[] | |||||
Underfull \hbox (badness 1158) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 flash mem-ory. You can ver-ify this helps, by tak-ing a se-r | |||||
ial.print, | |||||
[] | |||||
Underfull \hbox (badness 2426) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 and com-ment-ing it out, and com-par-ing the be-fore and af- | |||||
ter dy- | |||||
[] | |||||
Underfull \hbox (badness 1546) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 namic mem-ory used in ver-ify. To put se-rial print lines in | |||||
flash: | |||||
[] | |||||
Overfull \hbox (67.99345pt too wide) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 (https://www.arduino.cc/reference/en/language/functions/comm | |||||
unication/serial/write/) | |||||
[] | |||||
Overfull \hbox (67.08095pt too wide) in paragraph at lines 149--153 | |||||
\OT1/cmr/m/n/10.95 (https://www.arduino.cc/reference/en/language/functions/comm | |||||
unication/serial/print/) | |||||
[] | |||||
[9] <../pics/wshark1.jpg, id=48, 1018.55531pt x 883.80188pt> | |||||
File: ../pics/wshark1.jpg Graphic file (type jpg) | |||||
<use ../pics/wshark1.jpg> | |||||
Package pdftex.def Info: ../pics/wshark1.jpg used on input line 158. | |||||
(pdftex.def) Requested size: 509.27641pt x 441.89986pt. | |||||
Overfull \hbox (149.27641pt too wide) in paragraph at lines 158--159 | |||||
[][] | |||||
[] | |||||
[10] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no “ in font cmr10! | |||||
[11 <../pics/wshark1.jpg>] | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no � in font cmr10! | |||||
Missing character: There is no â in font cmr10! | |||||
Missing character: There is no € in font cmr10! | |||||
Missing character: There is no � in font cmr10! | |||||
[12] [13] (./14.aux) ) | |||||
Here is how much of TeX's memory you used: | |||||
2645 strings out of 494945 | |||||
42438 string characters out of 6181032 | |||||
96817 words of memory out of 5000000 | |||||
5921 multiletter control sequences out of 15000+600000 | |||||
10198 words of font info for 36 fonts, out of 8000000 for 9000 | |||||
14 hyphenation exceptions out of 8191 | |||||
39i,8n,39p,658b,194s stack positions out of 5000i,500n,10000p,200000b,80000s | |||||
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfon | |||||
ts/cm/cmbx10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/ | |||||
cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10. | |||||
pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></u | |||||
sr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr6.pfb></usr/share | |||||
/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb></usr/share/texlive | |||||
/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb></usr/share/texlive/texmf-d | |||||
ist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fo | |||||
nts/type1/public/amsfonts/cm/cmtt10.pfb> | |||||
Output written on 14.pdf (13 pages, 1515773 bytes). | |||||
PDF statistics: | |||||
92 PDF objects out of 1000 (max. 8388607) | |||||
58 compressed objects within 1 object stream | |||||
0 named destinations out of 1000 (max. 500000) | |||||
46 words of extra memory for PDF output out of 10000 (max. 10000000) | |||||
@ -0,0 +1,201 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\section{Omrom Photoelectric IR Emitter/Receiver} | |||||
All electronics is currently selling used Omrom photoelectric sensors, they are model: e3f2-r2c4. These types of photoelectric sensors are from a large catalog of different types. Some AC some DC powered. Different max distance, etc... See resources in this git repository for some PDFs. | |||||
I tested one without knowing how to use them, but had poor results. I was only able to get the light to flash when I dismantled the device, and put my hand very close to the IR. Teardown pictures are in the photos folder. The devices were not easy to dismantle, and can't really be put back together as they were originally. However, they did seem otherwise well made. \footnote{Repairs may be difficult.} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0265.JPG} | |||||
\captionof{figure}{Omrom 'Photoelectric' IR Emitter and Receiver Pair. Notice the two diodes behind the black cover on the right side.} | |||||
After finding some documentation on these in the reviews, I found out that the IR emitters require a reflective sticker in order to 'see' their IR beam reflect back. Not just a white surface, but the type of reflector you might see on a construction or night worker orange vest. | |||||
Hookup Instructions from All Electronics Comments: | |||||
\begin{verbatim} | |||||
is. To use with 5v ttl (using a second 5v source) wire as such: | |||||
Brown to +12V; Blue to ground; Pink to either +12 or ground | |||||
depending whether you want Light-ON or Dark-ON mode; | |||||
Black to a 4.7K resistor with the other side of the resistor | |||||
connected to a separate +5V source (the arduino). The 5v ttl | |||||
signal is at the point where the black wire connects to the | |||||
resistor. | |||||
\end{verbatim} | |||||
One thing I also noticed, was that used photo electric sensors from brand names can be obtained for discounts on the auction sites, to see if a good deal can be had. When buying them new, they can be relatively expensive for a hobbyist working out of his/her garage. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0273.JPG} | |||||
\captionof{figure}{IR in action. (without a reflective sticker, it doesn't go very far!)} | |||||
\section{Using the HFS-DC06H Microwave Sensor} | |||||
As I've tried with the HB100 (just the RF part of this HFS-DC06H), without success, I've moved to the HFS-DC06H microwave sensor which includes the Op Amp and accompanying circuitry (it simply outputs a digital high or low). | |||||
During testing, I found that the HFS sensor would not work correctly with my laptops usb 2.0 power supply. I thought it might be RF interferance from the metallic perf board – something I've seen before with an FM bug radio – but it was not. The HFS and the ENC require external power that is greater than my laptop can output. | |||||
\subsection{Uno Memory Limitations} | |||||
Using ethernet with the Uno is always touchy. Version control is important, to have a functional version to work off of. | |||||
When writing my code, I found errors creep in due to using too much of what the Arduino IDE calls dynamic memory. You can see how much dynamic memory is used in Arduino by hitting verify (not upload but verify)and reading the output from the toolchain. You can also use a tool to see how much SRAM is used (code is online:https://jeelabs.org/2011/05/22/atmega-memory-use/) the following function: | |||||
\begin{verbatim} | |||||
“Here’s a small utility function which determines how much RAM is currently unused: | |||||
int freeRam () { | |||||
extern int __heap_start, *__brkval; | |||||
int v; | |||||
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); | |||||
} | |||||
And here’s a sketch using that code: | |||||
void setup () { | |||||
Serial.begin(57600); | |||||
Serial.println("\n[memCheck]"); | |||||
Serial.println(freeRam()); | |||||
} | |||||
void loop () {} | |||||
The result will be: | |||||
[memCheck] | |||||
1846 | |||||
“ | |||||
\end{verbatim} | |||||
The UIPEthernet code requires significant RAM for the Uno. This is not a new problem for me, but it rears its ugly head again. However, this is a good thing. Limits are good. | |||||
An easy resolution for this is to put all serial.print lines into flash memory. You can verify this helps, by taking a serial.print, and commenting it out, and comparing the before and after dynamic memory used in verify. To put serial print lines in flash: | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/write/) | |||||
(https://www.arduino.cc/reference/en/language/functions/communication/serial/print/) | |||||
As I recall, there may be limitations to what you can do with Serial.print(F()), fotr example, converting variables into it will likely not work without further finesse, and libraries that print through serial likely won't work. | |||||
Low RAM errors can creep into strange places. For example, see these two wiresharks, where my code was running, equally as well, but the new code revision simply didn't work: | |||||
As you can see the data packet is mangled in the new rev. I've seen this enough to know, it was low SRAM. Otherwise, the code worked without major error. This small error effectively broke the program! Testing is always important, as well as saving multiple copies as you go, or alternatively version control. | |||||
\includegraphics[scale=0.5]{../pics/wshark1.jpg} | |||||
\captionof{figure}{First capture is correct. Second one, the lack of RAM causes the ENC to fail to send data to ZMTrigger.} | |||||
\section{Deployment} | |||||
Today I deployed both sensor boxes on site, connecting them to the ZM system. They both work\footnote{And have continued to work for about a year now}. I found that these HFS sensors appear to be fairly directional. I've been unable to get them to fire, when behind a wall, or up a floor, which is good – I don't want them to do that. The metal shield they have, seems to work well – blocking radio waves from going behind it. I mounted one on the ceiling and one on a wall, setting the cameras to nodect. Success. | |||||
However I have seen some issues with these, in the following situations. | |||||
\begin{itemize} | |||||
\item Mice in the ceiling, setting off the alarm | |||||
\item Flourescent lights being within 2 feet of the installation causing false alarms | |||||
\end{itemize} | |||||
Keep in mind, that if anything moves, it can set off the alarms. Including small animals. | |||||
I'm not sure exactly what frequency they are, but I think it is around 5GHz, comparable to 5GHz wifi (not going through walls well). I'm also considering putting some copper tape on the inside of the box, to help block anything through the wall it's mounted to, possibly... | |||||
When building this new shield I've made for the motion sensor, you can use flush cut pliers (the ones that cut really close to a board, if you are not familiar) and cut the WS2812 RGB LEDs right off of a \$3 RGB ring. You can also buy individual WS2812 LEDs. Cutting them off, is easier, and cheaper (and for those who run on a shoe-string budget) thus what I did here. There is a video I've made in the repo to show this process. | |||||
There's some things I'd like to add to the prototypes. First off, a light pipe, from the RGB LED to the box. Perhaps, 3D printed. Second, the RGB LED should change colours, very slightly when motion is detected. Not so much colour change that a casual glance will notice, but enough that if you are watching for it, you will see it. | |||||
\subsection{Work Log 1/31/19} | |||||
I'm assembling three of these for a company today. I can see right away some of the mistakes I made, and it's all DFA, or design for assembly errors. | |||||
I made a whole Arduino UNO shield, and that was a bad idea. I don't want to solder all of the 0.1” headers. There's a 10, two 8s, and a 6. It takes say 3-5 minutes per board. Too slow. I need to make the next shield with as few 0.1” headers as possible. Also, possibly a different connecter besides these pin headers would be better. Something easier to solder, perhaps reflow possible. | |||||
Another option would be to use a nano. Make assembly easy. That is very important. I also might want to consider a micro with built in ethernet, but for simplicity sake, for now Arduino Uno will do. Unos also are as future proof as you can get. | |||||
\subsection{The need for POE} | |||||
I deployed three of these in one company, and power wiring was an issue for one of them. One of them is going to require it's own 12V wiring (the other two worked with passive POE). Based on this, and knowing that there is a limit to what passive 12V POE can do, I've decided that I will use an 802.11 48v POE board for this application going forward. I don't want to take any chances with power being an issue. POE Injectors are relatively cheap. Back to the drawing board. | |||||
\subsection{HB100 are Sensitive to Fluorescent Lighting and Mains} | |||||
Do not install these HB100-based sensors near either mains or tube lights. They are sensitive, and will not operate correctly. I found that being within roughly 2 feet was too close. In my case, the logic high of the HB100 would go off randomly. | |||||
\end{document} | |||||
@ -0,0 +1,15 @@ | |||||
\contentsline {section}{\numberline {1}Overview}{1} | |||||
\contentsline {section}{\numberline {2}Parts List}{2} | |||||
\contentsline {subsection}{\numberline {2.1}Other Sensors}{3} | |||||
\contentsline {section}{\numberline {3}Work Log}{3} | |||||
\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{3} | |||||
\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{4} | |||||
\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{5} | |||||
\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{5} | |||||
\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{7} | |||||
\contentsline {section}{\numberline {5}Using the HFS-DC06H Microwave Sensor}{8} | |||||
\contentsline {subsection}{\numberline {5.1}Uno Memory Limitations}{9} | |||||
\contentsline {section}{\numberline {6}Deployment}{12} | |||||
\contentsline {subsection}{\numberline {6.1}Work Log 1/31/19}{12} | |||||
\contentsline {subsection}{\numberline {6.2}The need for POE}{13} | |||||
\contentsline {subsection}{\numberline {6.3}HB100 are Sensitive to Fluorescent Lighting and Mains}{13} |
@ -0,0 +1,90 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\end{document} | |||||
@ -0,0 +1,17 @@ | |||||
\relax | |||||
\@writefile{toc}{\contentsline {section}{\numberline {1}Overview}{1}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {2}Parts List}{1}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Other Sensors}{2}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {3}Work Log}{3}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{3}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Testing the Sick IR Diode Tripwire \relax }}{3}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{4}} | |||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{4}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces \relax }}{5}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.\relax }}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Arduino and Part 2 of sensor. Lined up with the other part.\relax }}{6}} | |||||
\@writefile{toc}{\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{6}} | |||||
\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Omrom 'Photoelectric' IR Emitter and Receiver Pair\relax }}{7}} |
@ -0,0 +1,269 @@ | |||||
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex 2019.8.17) 11 NOV 2019 01:02 | |||||
entering extended mode | |||||
restricted \write18 enabled. | |||||
%&-line parsing enabled. | |||||
**/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/ | |||||
ZMHW_Modector/docs/9.te | |||||
(/home/layoutdev/Desktop/code/documentation_general/Electronics_Projects_2019/Z | |||||
MHW_Modector/docs/9.te | |||||
LaTeX2e <2017/01/01> patch level 3 | |||||
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls | |||||
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo | |||||
File: size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option) | |||||
) | |||||
\c@part=\count79 | |||||
\c@section=\count80 | |||||
\c@subsection=\count81 | |||||
\c@subsubsection=\count82 | |||||
\c@paragraph=\count83 | |||||
\c@subparagraph=\count84 | |||||
\c@figure=\count85 | |||||
\c@table=\count86 | |||||
\abovecaptionskip=\skip41 | |||||
\belowcaptionskip=\skip42 | |||||
\bibindent=\dimen102 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty | |||||
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty | |||||
Package: keyval 2014/10/28 v1.15 key=value parser (DPC) | |||||
\KV@toks@=\toks14 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty | |||||
Package: graphics 2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty | |||||
Package: trig 2016/01/03 v1.10 sin cos tan (DPC) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg | |||||
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration | |||||
) | |||||
Package graphics Info: Driver file: pdftex.def on input line 99. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def | |||||
File: pdftex.def 2017/01/12 v0.06k Graphics/color for pdfTeX | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty | |||||
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO) | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty | |||||
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO) | |||||
) | |||||
\Gread@gobject=\count87 | |||||
)) | |||||
\Gin@req@height=\dimen103 | |||||
\Gin@req@width=\dimen104 | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty | |||||
Package: caption 2016/02/21 v3.3-144 Customizing captions (AR) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty | |||||
Package: caption3 2016/05/22 v1.7-166 caption3 kernel (AR) | |||||
Package caption3 Info: TeX engine: e-TeX on input line 67. | |||||
\captionmargin=\dimen105 | |||||
\captionmargin@=\dimen106 | |||||
\captionwidth=\dimen107 | |||||
\caption@tempdima=\dimen108 | |||||
\caption@indent=\dimen109 | |||||
\caption@parindent=\dimen110 | |||||
\caption@hangindent=\dimen111 | |||||
) | |||||
\c@ContinuedFloat=\count88 | |||||
) (./9.aux) | |||||
\openout1 = `9.aux'. | |||||
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 9. | |||||
LaTeX Font Info: ... okay on input line 9. | |||||
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii | |||||
[Loading MPS to PDF converter (version 2006.09.02).] | |||||
\scratchcounter=\count89 | |||||
\scratchdimen=\dimen112 | |||||
\scratchbox=\box26 | |||||
\nofMPsegments=\count90 | |||||
\nofMParguments=\count91 | |||||
\everyMPshowfont=\toks15 | |||||
\MPscratchCnt=\count92 | |||||
\MPscratchDim=\dimen113 | |||||
\MPnumerator=\count93 | |||||
\makeMPintoPDFobject=\count94 | |||||
\everyMPtoPDFconversion=\toks16 | |||||
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty | |||||
Package: pdftexcmds 2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty | |||||
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO) | |||||
Package ifluatex Info: LuaTeX not detected. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty | |||||
Package: ifpdf 2016/05/14 v3.1 Provides the ifpdf switch | |||||
) | |||||
Package pdftexcmds Info: LuaTeX not detected. | |||||
Package pdftexcmds Info: \pdf@primitive is available. | |||||
Package pdftexcmds Info: \pdf@ifprimitive is available. | |||||
Package pdftexcmds Info: \pdfdraftmode found. | |||||
) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty | |||||
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty | |||||
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty | |||||
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO) | |||||
)) | |||||
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty | |||||
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty | |||||
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO) | |||||
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty | |||||
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO) | |||||
Package etexcmds Info: Could not find \expanded. | |||||
(etexcmds) That can mean that you are not using pdfTeX 1.50 or | |||||
(etexcmds) that some package has redefined \expanded. | |||||
(etexcmds) In the latter case, load this package earlier. | |||||
))) | |||||
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4 | |||||
38. | |||||
Package grfext Info: Graphics extension search list: | |||||
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE | |||||
G,.JBIG2,.JB2,.eps] | |||||
(grfext) \AppendGraphicsExtensions on input line 456. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg | |||||
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv | |||||
e | |||||
)) | |||||
Package caption Info: Begin \AtBeginDocument code. | |||||
Package caption Info: End \AtBeginDocument code. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <12> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <8> on input line 11. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <6> on input line 11. | |||||
(./9.toc | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <10.95> on input line 3. | |||||
) | |||||
\tf@toc=\write3 | |||||
\openout3 = `9.toc'. | |||||
Overfull \hbox (11.59073pt too wide) in paragraph at lines 16--17 | |||||
\OT1/cmr/m/n/10.95 stal-la-tions. These sen-sors use ZMTrig-ger.pl (wiki.zonemi | |||||
nder.com/ZMTrigger) | |||||
[] | |||||
LaTeX Font Info: Try loading font information for OMS+cmr on input line 21. | |||||
(/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd | |||||
File: omscmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions | |||||
) | |||||
LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10.95> not available | |||||
(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 21. | |||||
[1 | |||||
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] | |||||
<../pics/DSCN0207.JPG, id=14, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0207.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0207.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0207.JPG used on input line 53. | |||||
(pdftex.def) Requested size: 321.1943pt x 240.89572pt. | |||||
Package caption Warning: \captionsetup{type*=...} or \captionof | |||||
(caption) outside box or environment on input line 54. | |||||
See the caption package documentation for explanation. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <9> on input line 56. | |||||
LaTeX Font Info: External font `cmex10' loaded for size | |||||
(Font) <5> on input line 56. | |||||
[3 <../pics/DSCN0207.JPG>] <../pics/DSCN0217.JPG, id=18, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0217.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0217.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0217.JPG used on input line 73. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[4] | |||||
<../pics/DSCN0220.JPG, id=25, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0220.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0220.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0220.JPG used on input line 76. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0225.JPG, id=26, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0225.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0225.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0225.JPG used on input line 79. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
<../pics/DSCN0227.JPG, id=27, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0227.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0227.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0227.JPG used on input line 82. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
[5 <../pics/DSCN0217.JPG> <../pics/DSCN0220.JPG> <../pics/DSCN0225.JPG>] | |||||
<../pics/walloutlet2.jpg, id=31, 481.8pt x 642.4pt> | |||||
File: ../pics/walloutlet2.jpg Graphic file (type jpg) | |||||
<use ../pics/walloutlet2.jpg> | |||||
Package pdftex.def Info: ../pics/walloutlet2.jpg used on input line 85. | |||||
(pdftex.def) Requested size: 120.44969pt x 160.59961pt. | |||||
[6 <../pics/DSCN0227.JPG> <../pics/walloutlet2.jpg>] <../pics/DSCN0265.JPG, id | |||||
=35, 803.0pt x 602.25pt> | |||||
File: ../pics/DSCN0265.JPG Graphic file (type jpg) | |||||
<use ../pics/DSCN0265.JPG> | |||||
Package pdftex.def Info: ../pics/DSCN0265.JPG used on input line 94. | |||||
(pdftex.def) Requested size: 200.74951pt x 150.56212pt. | |||||
Overfull \hbox (7.91602pt too wide) in paragraph at lines 111--111 | |||||
[] \OT1/cmtt/m/n/10.95 is. To use with 5v ttl (using a second 5v source) wire a | |||||
s such:[] | |||||
[] | |||||
[7 <../pics/DSCN0265.JPG>] (./9.aux) ) | |||||
Here is how much of TeX's memory you used: | |||||
2636 strings out of 494945 | |||||
42211 string characters out of 6181032 | |||||
96817 words of memory out of 5000000 | |||||
5913 multiletter control sequences out of 15000+600000 | |||||
10198 words of font info for 36 fonts, out of 8000000 for 9000 | |||||
14 hyphenation exceptions out of 8191 | |||||
39i,8n,39p,656b,192s stack positions out of 5000i,500n,10000p,200000b,80000s | |||||
</usr/share/texlive/texmf-dist/fonts/type | |||||
1/public/amsfonts/cm/cmbx10.pfb></usr/share/texlive/texmf-dist/fonts/type1/publ | |||||
ic/amsfonts/cm/cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/ams | |||||
fonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/c | |||||
m/cmr12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr6. | |||||
pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb></us | |||||
r/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb></usr/share/ | |||||
texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texliv | |||||
e/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb> | |||||
Output written on 9.pdf (7 pages, 1004753 bytes). | |||||
PDF statistics: | |||||
71 PDF objects out of 1000 (max. 8388607) | |||||
45 compressed objects within 1 object stream | |||||
0 named destinations out of 1000 (max. 500000) | |||||
36 words of extra memory for PDF output out of 10000 (max. 10000000) | |||||
@ -0,0 +1,118 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\section{Omrom Photoelectric IR Emitter/Receiver} | |||||
All electronics is currently selling used Omrom photoelectric sensors, they are model: e3f2-r2c4. These types of photoelectric sensors are from a large catalog of different types. Some AC some DC powered. Different max distance, etc... See resources in this git repository for some PDFs. | |||||
I tested one without knowing how to use them, but had poor results. I was only able to get the light to flash when I dismantled the device, and put my hand very close to the IR. Teardown pictures are in the photos folder. The devices were not easy to dismantle, and can't really be put back together as they were originally. However, they did seem otherwise well made. \footnote{Repairs may be difficult.} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0265.JPG} | |||||
\captionof{figure}{Omrom 'Photoelectric' IR Emitter and Receiver Pair} | |||||
After finding some documentation on these in the reviews, I found out that the IR emitters require a reflective sticker in order to 'see' their IR beam reflect back. Not just a white surface, but the type of reflector you might see on a construction or night worker orange vest. | |||||
Hookup Instructions from All Electronics Comments: | |||||
\begin{verbatim} | |||||
is. To use with 5v ttl (using a second 5v source) wire as such: | |||||
Brown to +12V; Blue to ground; Pink to either +12 or ground | |||||
depending whether you want Light-ON or Dark-ON mode; | |||||
Black to a 4.7K resistor with the other side of the resistor | |||||
connected to a separate +5V source (the arduino). The 5v ttl | |||||
signal is at the point where the black wire connects to the | |||||
resistor. | |||||
\end{verbatim} | |||||
One thing I also noticed, was that used photo electric sensors from brand names can be obtained for discounts on the auction sites, to see if a good deal can be had. When buying them new, they can be relatively expensive for a hobbyist working out of his/her garage. | |||||
\end{document} | |||||
@ -0,0 +1,100 @@ | |||||
\documentclass[11pt]{article} | |||||
%Gummi|065|=) | |||||
\usepackage{graphicx} | |||||
\usepackage{caption} | |||||
\title{\textbf{ZMHW Modector}} | |||||
\author{Steak Electronics} | |||||
\date{} | |||||
\begin{document} | |||||
\maketitle | |||||
\tableofcontents | |||||
\section{Overview} | |||||
Making and deploying a Motion Sensor for Zoneminder CCTV software installations. These sensors use ZMTrigger.pl (wiki.zoneminder.com/ZMTrigger) to activate an alarm on a camera for a period of time. The advantage of hardware motion sensors over the software detection of Zoneminder, is that the hardware motion sensors avoid some of the problems inherent in software detection, such as false positives from day-to-night, bugs, missed detections, and others. | |||||
I've tried different motion sensors. Let's start with the Infrared Laser Diode. | |||||
\section{Parts List} | |||||
\begin{itemize} | |||||
\item Arduino Uno (official recommended)(DIP recommended) | |||||
\item ENC28J60 ethernet module | |||||
\item Passive PoE adaptors for IP Cameras | |||||
\item Series 1A fuse | |||||
\item Sick WS15-D1130 Infrared Laser Diode Motion Sensor | |||||
\item General Purpose Diode (I used 1N4818 diode) (may also use transistor, per data sheet for Sick) | |||||
\item Jumper Wires | |||||
\item Copper Wire (22-26 gauge) | |||||
\item Enclosure | |||||
\item Ethernet Wire | |||||
\item (optional) Low Profile one and two gang wall outlet | |||||
\item (optional) Blank cover plate, for one and two wall gang wall outlet | |||||
\item (optional) Electrical tape (I prefer halfway decent electrical tape) | |||||
\item (optional) piezo speaker | |||||
\item (optional) extras of everything, in case anything fails | |||||
\end{itemize} | |||||
Later on we will try a different sensor. The HFS-DC06H. This sensor is a combination of an HB100 radio, with a decoding board that will read the signal and output a logic high or low. You may also want to try PIR sensors. | |||||
\subsection{Other Sensors} | |||||
\begin{itemize} | |||||
\item HFS-DC06H | |||||
\item PIR Sensor | |||||
\item Any other Laser Diode Sensor you like | |||||
\item Reflective tape | |||||
\end{itemize} | |||||
%\includegraphics[scale=0.8]{../pics/resistances.png} | |||||
%\captionof{figure}{Application Note resistance table} | |||||
\section{Work Log} | |||||
\subsection{Sick Motion Sensor} | |||||
The first tests were with the Sick diode sensor and receiver. This device is good for a doorway, where the door must be opened in order for people to pass. Putting it in the way of the door ensures that it will activate. It has a distance of at a max 15 feet or 3 meters. It is a laser type tripwire, which means it can be avoided, if someone knows where it is. | |||||
Device was assembled and using the ZMHW Modector source code. This is simply an Arduino sketch with UIPEthernet (to use the ENC28J60) (make sure CS is pin 10 on Uno). For more details see source code. Explaining the details is out of the spec of this doc. Simply put, the ENC28J60 is connected, the Sick sensor black wire is connected to Analog input 1, and a speaker is connected. | |||||
\includegraphics[scale=0.4]{../pics/DSCN0207.JPG} | |||||
\captionof{figure}{Testing the Sick IR Diode Tripwire } | |||||
Figure 1 shows two things, first off a diode connected in series with the output of the Sick sensor, and also the orange LED on the top of the sensor. The orange led will be green when there is no connection between the diodes and orange when the Diodes (or LEDs) are lined up correctly. When someone moves across the field of their vision, the orange LED will change to green.\footnote{This will later become important when installing the IR diode and receiver, as they must be lined up correctly.} | |||||
\subsection{Diode on Output of Sick Sensor instead of Transistor (Hack)} | |||||
Some IR diode / receiver pairs output a high or low. Some, like the Sick sensor, output a high or low (depending on whether you connect to white or black wire), however they are meant to be connected to a transistor, and thus if you connect it directly to a micro expecting it to go high or low, it will not. Being lazy, and seeking a quick solution, I put a 1N4819 in series with the output of the Sick sensor. | |||||
TODO: pictures showing waveforms | |||||
\footnote{This is possibly an issue of output impedance, but I will admit, at the time, I didn't bother to check.} | |||||
Using the black wire, it will be normally low and go high when motion is detected (the white wire is the opposite). If you connect to a micro it will fail to go high (why?). If you put a diode on the end in series, it will turn the normally low to a noisy normally low, and sometimes it will go between 2.5-5 volts in spikes. This allows us to use the ADC to read the Sick sensor, and avoid the use of adding a transistor in. The transistor would allow for a digitalRead to be used, but we have plenty of Analog inputs to use, so let's use one of those. | |||||
It's important to line up the emitter and receiver. If they are not lined up precisely, they will not get a sync, and the motion detection will fail. Thankfully, the diode outputs more of a cone, and less of a straight line, so some buffer is there. When the lights are dark, it is possible to see the red IR emitted if the distance is not too much. | |||||
\subsection{Broken ENC28J60 Module} | |||||
During my testing, I suddenly was unable to get an IP address. I checked the testsuite sketches, which didn't work, then began tearing down my setup, testing another Arduino and ENC module. It turned out, the ENC28J60 module failed on me. Make sure to buy backups. | |||||
\subsection{Installation Log in Pictures} | |||||
Here is an overview of what installing this in the wall might look like. One side is emitter, the other the receiver. | |||||
\includegraphics[scale=0.25]{../pics/DSCN0217.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0220.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0225.JPG} | |||||
\captionof{figure}{} | |||||
\includegraphics[scale=0.25]{../pics/DSCN0227.JPG} | |||||
\captionof{figure}{Part 1 of sensor. By mounting it on the right side of a project box, we can get a 90 degree angle.} | |||||
\includegraphics[scale=0.25]{../pics/walloutlet2.jpg} | |||||
\captionof{figure}{Arduino and Part 2 of sensor. Lined up with the other part.} | |||||
\section{Omrom Photoelectric IR Emitter/Receiver} | |||||
All electronics is currently selling used Omrom photoelectric sensors, they are model: e3f2-r2c4. These types of photoelectric sensors are from a large catalog of different types. Some AC some DC powered. Different max distance, etc... See resources in this git repository for some PDFs. | |||||
I tested one without knowing how to use them, but had poor results. I was only able to get the light to flash when I dismantled the device, and put my hand very close to the IR. Teardown pictures are in the photos folder. The devices were not easy to dismantle, and can't really be put back together as they were originally. However, they did seem otherwise well made. \footnote{Repairs may be difficult.} | |||||
After finding some documentation on these in the reviews, I found out that the IR emitters require a reflective sticker in order to 'see' their IR beam reflect back. Not just a white surface, but the type of reflector you might see on a construction or night worker orange vest. | |||||
\end{document} | |||||
@ -0,0 +1,9 @@ | |||||
\contentsline {section}{\numberline {1}Overview}{1} | |||||
\contentsline {section}{\numberline {2}Parts List}{1} | |||||
\contentsline {subsection}{\numberline {2.1}Other Sensors}{2} | |||||
\contentsline {section}{\numberline {3}Work Log}{3} | |||||
\contentsline {subsection}{\numberline {3.1}Sick Motion Sensor}{3} | |||||
\contentsline {subsection}{\numberline {3.2}Diode on Output of Sick Sensor instead of Transistor (Hack)}{4} | |||||
\contentsline {subsection}{\numberline {3.3}Broken ENC28J60 Module}{4} | |||||
\contentsline {subsection}{\numberline {3.4}Installation Log in Pictures}{4} | |||||
\contentsline {section}{\numberline {4}Omrom Photoelectric IR Emitter/Receiver}{6} |