Thursday, June 23, 2011

SCAN ELECTRONIC VIDEO 4 input with motion detection



 
This black and white video system is capable of scanning compact four video inputs and send them sequentially to a computer through a serial connection. It has the functions and QUAD "MOTION DETECTOR" (motion sensor) digital sensitivity adjustment.


electronic video digitizer
4 input with motion detection
Among the devices for the security sector, there are very sophisticated devices able to visualize what is happening inside a bank, a store or just in the outbuildings of a house (garage, yard, entry, etc.).. The simplest systems, that is to say, control panels, sensors can be used by the most diverse (from simple volumetric magnetic contact to the sensor), but if your goal (in the case of the say!) is a degree of security even higher, you have to go to the visual inspection of the room to watch. Indeed, there is no case (vault of a bank, department stores, and generally, all places where a continuous monitoring is essential and extremely rigorous) where we did not use a system closed circuit video, with viewing and recording any video signal picked up in several places by course, multiple cameras placed in strategic positions. For this, the modules are available QUAD (they can visualize simultaneously four video sources), long-term video recorders (by reducing the "frame rate", or frame rate, they can store 960 hours of film on single 180-minute VHS tapes) and digital video cameras motion sensors (they are possible variations of the video signal and automatically activate the recording on tape or digital).

Specifications
- 4 video inputs
- Serial connection to PC via RS232
- Automatic Video Recording
or manual
- Alarm output activated by motion detector
- Date and time in OSD
- External alarm input

Editing

The assembly that we are about to describe together in a single chip the functions described above. Taking advantage of the flexibility of digital technology and the power of modern computers and microcontrollers, we have developed a compact circuit able to scan four video inputs and send them sequentially to a PC via a serial link. This circuit is also capable of responding to a change of image ("Motion Detector" or motion sensor) on the first of four video signals, and if that happens, inform the computer of the occurrence of alarm. We plan, in addition, another external alarm input. QUAD function and the function of digital recording are carried out by a special software for Windows.

The deck does not have a clean scan but it uses the module EF.360. A microcontroller U1, a PIC 16F876-MF402 already programmed in the factory working at 20 MHz, manages the flow of data from the scanner EF.360, serial communication with the PC, the video switching module, the output relay and entrance to the external alarm. All these operations are controlled by "firmware" (software program residing in ROM) complex and sophisticated: for reasons of timeliness tion was mainly written in Assembler. Before analyzing in detail the software features, it is necessary in order to further the operation of the equipment Vant meticulously observed the wiring diagram.

The electronic diagram:
Figure 1 : Schéma électrique du numériseur vidéo à quatre entrées avec détecteur de mouvement

The power stage is a classic circuit with integrated voltage regulator 5 V. This voltage supplies almost the entire assembly with the exception of the winding of the alarm relay powered directly by Val upstream regulator.

The heart of the plate is, we have seen, the microcontroller PIC 16F876-MF402, already programmed at the factory, which are connected to various devices. To perform serial communication with the PC we used a MAX232, whose role is to convert the signal level of +5 V to ± 12 V PIC necessary to the PC. S1 and S2, representing the two micro-switches configuration, control the level of the pins 15 and 16 of the microcontroller, these micro-switches, when they are in position, put the pins to ground, which normally are held at logic high (1) by the two resistors "pull-up" R14 and R15.
The alarm signal from any external devices, has led to

pin 6 of the microcontroller via a special resistive bridge comprising R12 and R13 reduce the potential 12 to 5 V or so. Most sensors have, in fact, alarm outputs 12 V when, as we know, the inputs accept a voltage microcontrollers equal to their maximum voltage, that is Adire 5 V.

The relay is controlled by the transistor T1 which, in turn, is biased or blocked by the signal on pin 7 of the microcontroller.

The section of video switching around the integrated circuit U4, a classic 4066, deserves special attention: within this integrated circuit analog switches 4 are controlled by so many digital control signals. If one driver, as appropriate, four internal switches, it is possible to route one of the four video signals, present on the inputs to the scanning unit EF.360. In fact, if you look at the chart of U4, you will see that the pins 1,4, 8 and 11, connected to four input video signals, are a cluster of switches controlled by control signals present on pins 13 respectively , 5, 6 and 12. The other pole of each switch (pins 2, 3, 9 and 10) is connected to the input of the digitizer. In practice, the four outputs are connected together. The microcontroller will provide for the activation of a single switch at a time so as to connect the corresponding video input module EF.360. Next to each video input, we have provided a pair of 150 ohm resistors in parallel (which is 75 ohms) allowing, through the "straps" corresponding J1, J2, J3 and J4, to insert or not Such resistive load on the corresponding entries. This option is independent for each input, was provided in case the video signal should be applied, in addition to our deck to another video device internally predisposed for a load of 75 ohms (ie, the value Typical impedance of all the video signal). Hence the "strap" will be inserted only if the corresponding video signal is then routed to a monitor, VCR or any other device stan-
dard input with composite video at 75
ohms impedance.

The connections between the base plate with 4 inputs and module EF.360 are provided by a connector through which passes the control signals and the 8-bit parallel bus.
Figure 2 : Le montage terminé. Le module EF.360 est prêt à être mis en place.

Le montage décrit dans cet article utilise le module numé riseur vidéo proposé dans le numéro 23 d'ELM, pages 31 à 42, sous l'appellation EF.360 (pour le “digitaliseur” vidéo proprement dit) et EF.362 (pour l'interface asso ciée). Sur ce module arrive le signal vidéo provenant d'une Le montage décrit dans cet article utilise le module numé riseur vidéo proposé dans le numéro 23 d'ELM, pages 31 à 42, sous l'appellation EF.360 (pour le “digitaliseur” vidéo proprement dit) et EF.362 (pour l'interface asso ciée). Sur ce module arrive le signal vidéo provenant d'une des 4 entrées de la platine, sélectionnée au moyen du commutateur numérique U4 contrôlé à son tour par le mi crocontrôleur U1. Ce dernier se charge de gérer les don nées de sortie du numériseur vidéo et de les envoyer, par l'intermédiaire du convertisseur MAX232, à l'ordinateur. des 4 entrées de la platine, sélectionnée au moyen du commutateur numérique U4 contrôlé à son tour par le mi crocontrôleur U1. Ce dernier se charge de gérer les don nées de sortie du numériseur vidéo et de les envoyer, par l'intermédiaire du convertisseur MAX232, à l'ordinateur.

Flowchart of the microcontroller MF402 or "firmware" and software


After initialization of I / O ports, the microcontroller manages alarms first by controlling the signal input level (if it is active, it sets the "Flag Alarm") and the the possible alarms generated by the motion detector routine, routine that analyzes the image received by the scanner and compared with those stored. In case of variation and if it exceeds a threshold set, the motion alarm is set. The subroutine "Analysis Flags alarm" monitoring of any alarm and is responsible for the deactivation of the relay (if active) when the period expired. In addition, the alarm status is sent to the PC via the serial link, using simple characters "F" means "no alarm", "A" "Movement Alarm active", "B" "Alarm from the external input "," C "" the two active alarms. " Returning to the beginning, the microcontroller monitors the status of the Flag of the motion detector and alarm in the event and depending on the setting of DIP switches, it activates the relay for the period determined. Are finally analyzed any requests made by the PC (eg, configuration of the sensitivity of the motion detector or request for image capture).


One of the most complex and critical entrusted to the microcontroller is probably the management of self-adaptive motion detector. This is a routine, written directly in assembler, which claimed many touches to get good stability, operational safety and immunity to false alarms that you can see. The algorithm used is configurable through the PC connection for optimal sensitivity according to the quality of the video signal applied and the type of recovery. The software in this section performs approximately 6 samples per second on channel 1 and by analyzing the image, it extracts a map of the average values ​​for a total of 70 sensitive areas distributed over the entire face of the screen . This card stored in the memory of the PIC is continuously corrected and compensated according to the slow image changes that may occur during the day. This ongoing analysis of the image makes the motion detector insensitive to environmental changes due to the movement of the sun during the day, the passage of clouds or artificial light "critical" like that of neon for example (typical of offices, closed shops or places to see on).

When the routine is an intrusion, it acts according to the setting of DIP switches found on the plate (Figure 4): if both are OFF, the function is déshabilitée ("disabled") and no action is taken, if a 2 is ON and is OFF, the relay is activated for two seconds, if 1 is OFF and 2 ON, the relay is activated for 10 seconds, if both are ON, the relay is activated for 60 seconds. These times are measured from the cessation of the event noted: which means that even if you set the switches for two seconds while in the visual field changes continue to occur, the relay will remain energized throughout the period of duration of the alarm and not return to rest after the two seconds have elapsed from the termination of the intrusion.
Figure 6: Diagram of board layout
the frame grabber with four inputs with motion detector
Apart from that just described, the microcontroller performs other operations that are reported to the PC in due course by the serial connection. The two-way relationship with the computer is used to manage the stage: a specific message is sent to the alarm motion detector and then another message to the alarm input signal. With this information, the computer will "decide" what to do with the software that we studied specifically and remotely manages all functions of the plate. The PC software is able to control the capture of a frame on any of the four available inputs or all together in QUAD mode. The capture functions can be manually (controlled by the touch of a button), continuous, to simulate the functions of a classic "Time Lapse" (long video recorder) or event (thus activated by the alarm of the plate). Each frame can contain, superimposed on the active camera number, date and time. The frames, if the corresponding function is authorized, can be saved automatically and continuously with a file name automatically generated by the software according to the date and time of the order of capture. In the recording mode activated by an event, if the alarm comes from the motion detector, the system stores the image on the channel 1, while if the alarm comes from the auxiliary input, the image the four channels is stored in QUAD mode. The program allows you to view a choice, none or both events and act accordingly. The capture rate of frames is limited by the intrinsic speed of the serial link. Even working with a "baud rate" of 57 600 bits / second, to transfer a "frame" or frame, low resolution, 5 seconds are needed. Therefore, the possibility has been provided to configure the format of video capture by acting on the combinations of settings for resolution and depth (bit / pixel) to get the best value / performance, according to your own requirements. Now that we have seen the main functions of the software, we can take care of the practical.

The scanner module:
Figure 5a : Schéma synoptique du module numériseur EF.360
The video digitizer is essentially a stand-alone module with a parallel bus for connection to the control unit and an input to which you can send any video signal (B / W or color) while Scanning is done in black and white.

The role of the module is to sample the received signal as input, scan and store the data for each image in a special internal RAM and set up a "buffer" capacity of a frame, so that the interface module face to remove the data. The sampling is done by means of an A / D converter and 8-bit microcontroller with a Scenix SX18.
You will find 7, the photo of EF.360 in "pro" version (mounted
plant), based on our present assembly EF.402.
Figure 5b: The scanner module ("digitizer") EF.360
proposed in ELM 23, pages 31-42
Liste des composants :

R1 = 4.7 kOhms
R2 = 470Ω
R3 = 150Ω
R4 = 150Ω
R5 = 150Ω
R6 = 150Ω
R7 = 150Ω
R8 = 150Ω
R9 = 150Ω
R10 = 150Ω
R11 = 4.7 kOhms
R12 = 22 kOhms
R13 = 10 k
R14 = 10 k
R15 = 10 k

C1 = 100 nF multicouche
C2 = 100 nF multicouche
C3 = 220 µF 25 V électrolytique
C4 = 470 µF 25 V électrolytique
C5 = 1 µF 100 V électrolytique
C6 = 1 µF 100 V électrolytique
C7 = 1 µF 100 V électrolytique
C8 = 1 µF 100 V électrolytique
C9 = 100 nF multicouche

D1 = Diode 1N4007
D2 = Diode 1N4007
LD1 = LED rouge 5 mm
T1 = NPN BC547
U1 = PIC16F876-MF402
Regulator U2 = 7805
U3 = Integrated MAX232
U4 = Integrated HCF4066
DS1 = Dip-switch 2 micro-inter.
Relay RL1 = mini for it
12 V 1 RT
Q1 = 20 MHz Quartz

Misc:
1 Support 2 x 7-pin
1 Support 2 x 8-pin
1 Support 2 x 14-pin
4 BNC to this
1 DIN connector
This 5-pin
1 DB9 female connector
for this
1 9-pin serial cable
Taking a supply for these
Band scored 17 Plots
female
8 Pimples band scored
male
Cavaliers 4 not 2.54
type computer
 
The practical realization
Figure 7 : Photo d'un des prototypes du numériseur vidéo à quatre entrées avec détecteur de mouvement surmonté du module EF.360 en version “pro” (ce modèle est câblé en usine sur un circuit imprimé double face à trous métallisés, sérigraphié).  

Figure 8: Drawing, scale 1, the circuit board frame grabber with four inputs with motion sensor.
The construction of the frame grabber with four inputs with motion sensor has no particular difficulty. If you decide to make your own circuit board, which we give, figure 8 on a scale drawing, you can use your usual method.

When you purchased the printed circuit board or you will have engraved and pierced, start by inserting the wire bridges between tracks, shown in Figure 6 by black lines (we reserve the name "straps", or riders, to J1, J2, J3 and J4). Then place the components of the lowest profile (resistors and diodes) and supports integrated circuit by directing their mark immediately keyed as shown in Figure 6. Mount capacitors (attention to the polarity of electrolytic), the switches, the transistor T1, the LED, the voltage regulator and the relay (like miniature 12 V, a contact).

As for the links to the scanner module EF.360, allow female strips and solder them in the holes: 11 + 2 + 2 right and 2 left side (Figure 6).

Do not forget the jumpers or "straps" removable D1 to D4 that are nothing more than strips cut to two males.

Finally, it remains to solder the connector input / output and supply. We planned a "plug" of standard power PCB, four female BNC for video input, one serial DB9 connector for connecting the PC and a 5-pin DIN connector for alarm input and output relay (pin 10 and 11). The connectors can only enter in a specific sense and there is no risk of them up incorrectly.

The welds are complete, insert the ICs into the sockets correctly oriented their corresponding reference keyed (usually in the same direction
media ... if you have thought! but when in doubt you still help figure 6), mount the regulator as shown lying in the same figure 6.

Finally, install the module by inserting its elements EF.360 strips males in the elements of our female mounting strips.

The connection between the video deck and the computer is performed by using a serial cable to COM1. At the DIN plug on the other hand are the outputs of the relay and the external alarm input, as shown in Figure 10.
Before turning on the circuit, you should set the switches according to your requirements and to insert or not the "straps" resistive (or jumpers) on the inputs.

The software will be installed in the normal Windows. You can now launch the "Motion-4" and put the mount on. The program appears, startup, with no default configuration. Just try to set the manual mode and force the capture of one or all video inputs (QUAD) to see the result on PC. All other functions are intuitive and you will succeed in a short time to get the most out of your device.

No comments:

Post a Comment

Thematic Links :