NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
AN029701-1108 F1680 AN0297SC01 Z8FS040A Z8F082A QS0073 PS0284 PB0223 UM0223 - Datasheet Archive
ePIRTM and Z8 Encore! XP® in Serial Interface with Digital Picture Frame AN029701-1108 Abstract Features This Application
Application Note ePIRTM and Z8 Encore! XP® in Serial Interface with Digital Picture Frame AN029701-1108 AN029701-1108 Abstract Features This Application Note describes how Zilog's Enhanced Passive Infrared (ePIRTM) can be used to detect motion and identify the hand wave direction (left-to-right or right-to-left). Zilog's Z8 Encore! XP® F1680 F1680 MCU is used to turn ON/OFF and control the movement in the Digital Picture Frame (DPF). The key features of ePIR include: ePIRTM Overview ePIR Motion Detection Zdots® Single Board Computer (SBC) is a complete, compact, and high-performance product specifically designed for the rapid development and deployment of products requiring control based on infrared motion detection. It combines the unique features of the Z8 Encore! XP® MCU with powerful new software detection algorithms and delivers a significant performance improvement over traditional passive infrared (PIR) based solutions. Based on PIR sensor technology, it is a complete motion detector solution including PIR sensor and Fresnel lens. Parameters for sensitivity and output timing are provided through a simple hardware interface or more advanced settings and status are available through a serial interface. The ePIR Motion Detection Zdots SBC provides a dramatic improvement in both sensitivity and stability and is scalable to various market segments including Lighting Control, Access Control, Vending, Display, Proximity, and Power Management. Complete, fully functional motion detection SBC including Fresnel lens Comes pre-programmed with motion detection software · Small form factor-25.5 mm x 16.7 mm · Wide 5 m x 5 m, 60 degree detection pattern · Sensitivity control via simple hardware configuration · Advanced serial (UART) based configuration and interface · Note: The source code file associated with this application note, AN0297SC01 AN0297SC01.zip is available for download at www.zilog.com. · SLEEP mode for low-power applications · No temperature compensation required · Input to support CDS photocell input for ambient light detection · Minimal components ensure highest possible Mean Time Between Failures (MTBF) · Application code can also be modified to support custom solutions · Complete development system available Discussion This section describes ePIR, F1680 F1680 MCU and DPF connections, and state diagram. Hardware Architecture Figure 1 on page 2 displays the data flow between ePIRTM, F1680 F1680 MCU, and the Digital Picture Frame (DPF). ePIR continuously sends the status signals to the F1680 F1680 MCU, whether the (left-to-right, right-to-left) motion is detected or there is no Copyright ©2008 by Zilog®, Inc. All rights reserved. www.zilog.com ePIRTM and Z8 Encore! XP® in Serial Interface with Digital Picture Frame motion. Information is transferred between ePIR and F1680 F1680 MCU through UART communication. The F1680 F1680 MCU interprets the information from the ePIR and responds according to its state diagram (see Figure 7 on page 6). It powers ON the LCD if a motion is detected by sending logic 1 to the relay (see Figure 2 on page 3). The relay closes the power line of the DPF's LCD to turn it ON. The LCD is turned OFF by sending logic 0 to the relay by the F1680 F1680 MCU. This occurs after 4 sec (approximately) if the motion is not detected ePIR within the ePIR range (3 m x 3 m with a 60 degree angle). In this hardware setup, logic 0 is required to activate NEXT and PREV of the DPF. These are connected to PB0 and PB1 of the F1680 F1680 MCU, respectively. PB0 and PB1 are configured as opendrain requiring pull-up resistor. TM Figure 1. Hardware Setup AN029701-1108 AN029701-1108 Page 2 of 9 ePIRTM and Z8 Encore! XP® in Serial Interface with Digital Picture Frame Vcc ® Z8 Encore! XP F1680 F1680 MCU ePIR DPF TM NEXT TX RX RX PB0 10k 10k LCD Power Line PB1 TX PREV PC0 relay GND LCD Power Line GND Figure 2. Schematic of Energy Saver Controller for DPF using ePIRTM Figure 3. ePIRTM Pin Diagram AN029701-1108 AN029701-1108 Page 3 of 9 ePIRTM and Z8 Encore! XP® in Serial Interface with Digital Picture Frame Table 1. ePIRTM Pin Description Pin No. Signal Name Hardware Interface Mode Serial Interface Mode Description 1 GND Ground Ground - 2 VDD Supply Voltage Supply Voltage - 3 RXD/DLY DLY-Delay (analog input) RXD-Receive Data (digital input) 4 TXD/SNS SNS-Sensitivity (analog input) TXD-Transmit Data (digital Mode select during Reset output) 5 /MD/RST Motion Detect (digital output) Configurable: /RST-Reset Default is /RST (Reset) in Serial Interface Mode (digital input) /MD-Motion Detect (digital input) 6 LG Light Gate (analog input) Light Gate (analog input) If unused, connect to Vdd 7 /SLP/DBG /SLP-Sleep (digital input) /SLP-Sleep (digital input) DBG is used for programming and debug 8 GND Ground Ground - Controlling DPF with ePIRTM Between the LCD and main board of the DPF (see Figure 4) are two wires (black is GND and orange is VCC) for LCD power. The VCC wire is connected to a relay. This is used to turn ON/OFF the LCD. Figure 4. DPF LCD Power Line AN029701-1108 AN029701-1108 Page 4 of 9 ePIRTM and Z8 Encore! XP® in Serial Interface with Digital Picture Frame Figure 5 displays the wire connection to control NEXT and PREV. These wires are connected to the F1680 F1680 MCU (see Figure 2 on page 3). Figure 6 displays the wire connections inside the DPF including GND. PREV NEXT NEXT PREV Figure 5. NEXT and PREV Wire Connection PREV NEXT LCD Power: Connected to Relay GND Figure 6. Wire Connections Inside the DPF AN029701-1108 AN029701-1108 Page 5 of 9 ePIRTM and Z8 Encore! XP® in Serial Interface with Digital Picture Frame The firmware on the ePIRTM Zdots® SBC sends 'R' and 'L' to its UART when left-to-right motion and right-to-left motion is detected, respectively. When there is no motion, it sends '_' (off1). Software Implementation Two firmware developed are: 1. For Z8FS040A Z8FS040A (based on the Z8F082A Z8F082A device) of the ePIR 2. For Z8 Encore! XP® F1680 F1680 MCU START `R' or `L' `R' `R' `_' NEXT LCD ON `R' `L' `L' `L' `_' PREV LCD OFF `_' `R' or `L' Figure 7. State Diagram The state diagram in Figure 7 displays how the code on F1680 F1680 MCU flows. In the START state, the DPF is OFF and the initializations are completed. Note: In the DPF, only the LCD is OFF, and it is possible that pictures are running in slide show. Once the motion is detected, the state changes to LCD ON, turning ON the DPF's LCD and displays the picture. In the code, the F1680 F1680 MCU continuously monitors the data on the UART. If either 'L' or 'R' is received, logic 1 is send to the relay to turn AN029701-1108 AN029701-1108 ON the LCD. Also, the STATUS is changed to 1. It is used in the program to monitor if the LCD is ON (STATUS = 1) or OFF (STATUS = 0). data=getchar(); if (data ='L') || (data='R') { lcd_on; STATUS = 1; } As the viewer waves the hand from left-to-right ('R'), NEXT state occurs which displays the next picture and for right-to-left ('L'), PREV state occurs which returns to the previous picture. Page 6 of 9 ePIRTM and Z8 Encore! XP® in Serial Interface with Digital Picture Frame The following code snippet displays that the F1680 F1680 MCU continuously counts the number of 'R' (NEXT), 'L' (PREV), and '_' (off1) received from ePIR. Everytime it increments the number NEXT and PREV, counter for off1 that is used to trigger LCD OFF, is Reset. for (i=0;iprev) { disp_next; delay(1); disp_idle; delay(4); next=0; prev=0; off1 =0; } else if(prev>next) { disp_prev; delay(1); disp_idle; AN029701-1108 AN029701-1108 delay(4); next=0; prev=0; off1 =0; } If there is no motion, the F1680 F1680 MCU receives '_'. LCD OFF state occurs after 4 sec (approximately). In this state, the F1680 F1680 MCU sends logic 0 to relay and turns OFF the LCD. When LCD turns OFF, the LCD, off1, and STATUS are Reset. else if(off1 >= 50) { lcd_off; delay(10); off1=0; STATUS = 0; } Theory of Operation The ePIRTM controller on DPF demonstration performs the following: 1. If a viewer is within the range of the ePIR, DPF turns ON. 2. Once the DPF is ON, the viewer can control the slide show by waving the hand either leftto-right for next picture or right-to-left for previous picture. 3. If the viewer exits the range of the ePIR, the DPF turns OFF after 4 sec (approximately). Summary Using ePIR and Z8 Encore! XP® F1680 F1680, you can save power and control the DPF slide show with simple hand gestures. This setup turns the DPF ON/OFF by sensing the presence of human movement. Simple hand gestures left-to-right (NEXT) and right-to-left (PREV) controls the DPF's slideshow function. The life of the LCD is also more as power is turned OFF when not in use. Page 7 of 9 ePIRTM and Z8 Encore! XP® in Serial Interface with Digital Picture Frame References The documents associated with ePIRTM and Z8 Encore! XP® F1680 F1680 available on www.zilog.com are provided below: · ePIRTM Motion Detection Zdots® SBC Development Kit Quick Start Guide (QS0073 QS0073) · ePIRTM Motion Detection Zdots® SBC Product Specification (PS0284 PS0284) · ePIRTM Motion Detection Zdots® Single Board Computer Product Brief (PB0223 PB0223) · ePIRTM Motion Detection Zdots® SBC Development Kit User Manual (UM0223 UM0223) · Z8 Encore! XP® F1680 F1680 Series Product Specification (PS0250 PS0250) AN029701-1108 AN029701-1108 Page 8 of 9 ePIRTM and Z8 Encore! XP® in Serial Interface with Digital Picture Frame Warning: DO NOT USE IN LIFE SUPPORT LIFE SUPPORT POLICY ZILOG'S PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE SUPPORT DEVICES OR SYSTEMS WITHOUT THE EXPRESS PRIOR WRITTEN APPROVAL OF THE PRESIDENT AND GENERAL COUNSEL OF ZILOG CORPORATION. As used herein Life support devices or systems are devices which (a) are intended for surgical implant into the body, or (b) support or sustain life and whose failure to perform when properly used in accordance with instructions for use provided in the labeling can be reasonably expected to result in a significant injury to the user. A critical component is any component in a life support device or system whose failure to perform can be reasonably expected to cause the failure of the life support device or system or to affect its safety or effectiveness. Document Disclaimer ©2008 by Zilog, Inc. All rights reserved. Information in this publication concerning the devices, applications, or technology described is intended to suggest possible uses and may be superseded. ZILOG, INC. DOES NOT ASSUME LIABILITY FOR OR PROVIDE A REPRESENTATION OF ACCURACY OF THE INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED IN THIS DOCUMENT. Z I L O G A L S O D O E S N O T A S S U M E L I A B I L I T Y F O R I N T E L L E C T U A L P R O P E RT Y INFRINGEMENT RELATED IN ANY MANNER TO USE OF INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED HEREIN OR OTHERWISE. The information contained within this document has been verified according to the general principles of electrical and mechanical engineering. ePIR, Zdots, and Z8 Encore! XP are trademarks or registered trademarks of Zilog, Inc. All other product or service names are the property of their respective owners. AN029701-1108 AN029701-1108 Page 9 of 9