Azatrax Quad Infrared Proximity Detector Shield for ArduinoTM Uno, Mega and compatibles

Similar documents
Installation Instructions Azatrax HexDetex Model Train Detector with Grade Crossing Trigger MRD6X

Installation Instructions Azatrax Dual Infrared Model Train Detector MRD2 'Turnout' Edition

Connections, displays and operating elements C D E G H. Installing the control unit

Description of the application programme for KNX occupancy detectors version 3.1

TrainBoss Defect Detector Displaying Detector Model No. TB-21D

Sensors SR Programming manual

D-Tect 2 GJD300 Quad PIR Movement Detector

B.E.G. LUXOMAT KNX-OCCUPANCY DETECTOR

UP 258E11 OPTISENS OFFICE

D-TECT Introduction. Connecting the Unit. Quick Installation. Multi Beam Alignment & Masking. Mounting the Unit

DOCUMENTATION IPS640

DOCUMENTATION IPS640

Model 3300 Technical Support and Installation Manual

CONTENTS BEFORE YOU BEGIN

Microwave/PIR Intrusion Detector with POPIT Interface ZX970

200 SERIES ADVANCED PHOTO/THERMAL/IR DETECTOR PRODUCT SPECIFICATION

Sensing the World. When you have finished this lecture you should be able to:

Characteristics of different sensors used for Distance Measurement

TSEV01S01C10 SPECIFICATIONS

RS485 MODBUS Module 8AI

Dishwasher Load-Unload Indicator. Jitendra Tailor

AUTOMATIC ROOM LIGHT AND FAN CONTROLLER WITH BI- DIRECTIONAL VISITOR COUNTER

Color Mark Sensor. Sensing gdsa distance Spot diameter e. Possible to switch between vertical or horizontal connection using the M12 rotary connector.

Table of Contents. What to Expect with Your Installation. Tools Needed. Mounting Options. Ceiling Bracket. Wiring.

Open Source Home Security System

, ,

Owner s Guide and Installation Manual

Exercise 1: IR Transmission and Reception

Sensors SR Programming manual

Dual Technology Wall Mounted Occupancy Sensor. Manual & Specification

1 Safety instructions. 2 Device components. Observer 220. Art.-No.: W 220 WW. Operationsmanual

ECO N DATE DESCRIPTION OF CHANGE CHG

Automatic Customer Counter and Payment Tool for Shopping Centers and commercial spaces

Dual Technology Wall Switch Occupancy Sensor. Manual & Specification

F 2 MC-8FX FAMILY MB95200 SERIES SMOKE DETECTOR DEMO REFERENCE SOLUTION 8-BITMICROCONTROLLER APPLICATION NOTE

D-TECT Dual Tech. GJD360 Triple Technology External Detector

Installation Instructions

C - B u s C - T o u c h U s e r s G u i d e C T Series

RC802/ B 8E1 Modular Fiber-Optic Multiplexer (Rev. M) User Manual

INSTALLATION INSTRUCTIONS

Smoke Detector Demo Reference Solution

Movement Detector GJD 300

GDC 087R Issue 1 - May Installation and Operation UAS Network/Dropside Interface Unit Model NIU/DIU 7624.

Table of Contents. What to Expect with. Tools Needed. Mounting Options. Blades

Rev KNX Technical Reference Manual Busch Präsenz tech 6131/ /11-500

INSTALLATION INSTRUCTION for ceiling fan

ENERGY AWARE SMART HOME AUTOMATION USING ARDUINO AND LABVIEW

PYROSELF Innovative Snow Sensor and Controller for 2 x 24A loads outputs. Installation and Operating manual

E3M-V. Mark Sensor. Applications

DESIGN MANUAL. The information in this doucment is applicable to sensors built in September, 2009 or later (Firmware 3.0)

DESIGN MANUAL MODEL GIR900 INFRARED COMBUSTIBLE GAS SENSOR

Table of Contents. What to Expect with. Mounting Options. Tools Needed

Product and Applications Description

MINI RECEIVER. Installation and Operation Manual. Model # MR1214-MC 418 MHZ RECEIVER. Document #

STEP BY STEP INSTALLATION INSTRUCTIONS. Vertical Honeycomb Shades

IMPORTANT. PLEASE NOTE: The infrared beam path MUST be kept clear of obstructions at all times!

SERVICING THE PRIZE BOX SENSOR PCBs

The most user friendly Security Alarm System L S Section 1 Overview of System Section 2 Planning your Installation

Ceiling PIR HS presence detector. Product Guide. Overview. Features

2 General Application Photoelectric Sensors

PIR/INT & PIR/INT-D. Batten mount PIR detectors. Product Guide. Overview. Features

LUX Hardwired - Installation Notes

Multi - Purpose Fire Fighter Robot

P2267 NETWORK INTERFACE

LPCMPIRM65 & LPCMPIRDSI65

MODEL AC-SCC-5 INSTALLATION, OPERATION & MAINTENANCE MANUAL

Team Rescue X: Autonomous Firefighting Robot

Break-in Detection and Alarm System

HANDBUCH / MANUAL / MANUEL / MANUALE TopScan-S

Devices for Special Applications

Use of the application program

Cadence Design of clock/calendar using 240*8 bit RAM using Verilog HDL

GJD OPAL RFX WIRELESS 35 METRE EXTERNAL PIR INSTALLATION MANUAL

Ethernet General Purpose

Revision November 2013 JVA Technologies. Ethernet General Purpose IO Technical Manual

DHR3. Accessories. NOTE: Set up for this sensor should be performed by an AAADM-certified installer. INSTALLATION INSTRUCTIONS

LPC3BSP65 & LPC3BDP65

Yale Locks. Z-Wave+ System Integrators Guide. Yale nextouch Sectional Mortise Keypad Lock NTM 610/615/620/625/630/635/640/645

PARTS & ACCESSORIES INSTALLATION AND SAFETY INSTRCUTIONS ITEM NO.:60010BZGTGLD SAFETY PRECAUTION. Canopy. Downrod. Housing. Transmitter CR2032/3V

EBMPIR-MB. Batten mount PIR detectors. Product Guide. Overview. Features

Flame Monitor for Multiple Burner Furnaces D-LE 603 D-UG 660

General Purpose IO Technical Manual

2-inch Network Speed Dome Installation Manual

F series. echoflex. Slim Line Dimming Controller. Product Overview ER1S-FC

Speed Gate ST-01. Double-Sided Section STD-01 ASSEMBLY AND OPERATION MANUAL

E340 BOILER CONTROL INSTALLATION MANUAL

Ax60+ Kiosk Option. Quick Start Guide

ADDITIONAL INFORMATION

Infrared Wall Mount Occupancy Sensor

ECO-IR 360C NT. Presence detector. Art. Nr Bedienungsanleitung 2. Notice d utilisation 22. Installation manual 42

REMOTE CONTROL CAR ALARM SYSTEM

Smoke Detector and Siren. Manual

USER MANUAL FOR OPERATING SYSTEM

Ceiling PIR presence detector DALI / DSI dimming. PIR Sensor. IR Receiver. Light Level Sensor. Status LEDs. PIR Sensor.

SM3000 Videographic Recorder. User Guide. Modbus (RTU) Communications Option

DS9370-BEL. Installation Instructions TriTech Ceiling Mount PIR/Microwave Intrusion Detector

Pyroelectric Infrared Sensor PIR

easydetect and easydetect deluxe model train detector kits Quickar Electronics, Inc.

Installation Guide: PowerAire Quad

SECTION DIGITAL-NETWORKING LIGHTING CONTROLS ENLIGHTED LIGHT MANAGEMENT SYSTEM

Transcription:

User's Guide Azatrax Quad Infrared Proximity Detector Shield for ArduinoTM Uno, Mega and compatibles RIR4 What it is: The RIR4 has four infrared (IR) proximity detectors assembled on a circuit board with connectors that allow it to be plugged into an Arduino Uno, Arduino Mega, or compatible microcontroller. These detectors allow your microcontroller to "see" nearby objects. The IR sensors have their own light source, so they can be used in total darkness. The RIR4 circuit modulates the IR light of the sensors to eliminate the effects of changing room lighting. The IR light is invisible to human eyes. Communication between the microcontroller and RIR4 takes place over the two-wire interface (TWI, also known as I2CTM). The RIR4 has switches to select one of eight I2C addresses, which allows multiple RIR4 circuits to be connected ("stacked") to a single microcontroller. Pins used: A4 & A5 for I2C communication, +5v and ground. All other pins are pass-through only. If your RIR4 was supplied with a set of IR sensors, each sensor is equipped with a plastic mounting tube. The tubes are for protection of the sensor leads and to provide mounting support. They are not essential for detector operation and may be shortened or removed entirely to best fit your situation. Just use caution to avoid damaging the leads. The sensors and circuit are designed for indoor use. These instructions are tailored for use on a model railway, though the RIR4 may be used for robots and other automation applications. Installation Install the sensors: Each sensor pair may be installed in one of two different ways - 'Across Track' or 'Reflective.' Across Track sensing: The IR LED is positioned horizontally on one side of the track, and the IR photo receiver is placed on the opposite side. A train is detected when it blocks the light path between the LED and photo receiver. The distance between the LED and photo receiver can be up to 18 in. (46cm), or more with careful alignment. Placing the sensors at an angle across the track avoids possible detector flickering caused by the gaps between cars. Tip #1 - If mounting the sensors vertically as shown here, slide the plastic tubes away from the sensor then carefully bend the leads to a right angle. The leads are somewhat brittle, bending them more than two or three times may cause a break. Tip #2 - Locate the photo receiver so it faces away from bright lights or sunny windows. Use scenery or structures to conceal the sensors and shade them from room lighting. Reflective sensing: Trains are detected when light from the IR LED is reflected off a train and sensed by the IR photo receiver. Typically the sensors are mounted in two 3/16-inch (4.8mm) holes drilled in the roadbed as shown here. Vertical installation works for S and larger scales as long as there is no structure above the track such as a bridge. For N and HO scale and where the object to be sensed is close to the IR LED and receiver, mount the IR LED and its receiver so they are both pointing at the same spot on the object. Angle the IR LED and photo receiver so their centerlines intersect at the height of the bottom of your rolling stock. Tip #3 - You can ballast your track after sensors are installed. Cover each sensor with a bit of transparent tape. Apply 2018 Azatrax.com RIR4 user's guide pg. 1 of 5

ballast. When the glue has dried use a dental pick or similar tool to remove ballast from the sensors. An opening of just 1 or 2 mm is required. Connecting wires to the terminal blocks: The TS2 has 'spring cage' quick-connect terminal blocks. Strip 1/4 inch (6 mm) of insulation off the end of the wire. Solid wire works best, AWG #24 or #22 (0.2-0.4 mm 2 ). The end of the wire must be straight. Push it into the connector firmly, with a slight downward angle. To release the wire, push down the terminal's button with a small screwdriver. Push firmly. Pull the wire out. Connect sensor pair #1: Connect the orange or red wire from the IR LED to terminal 1K. Connect the green or blue wire from the IR photo receiver to terminal 1F. Now, how you connect the white and yellow wires to the RIR4 will determine whether this detector will operate in 'Across Track' or 'Reflective' mode. See the diagrams below: Connect the remaining sensor pairs: The orange or red wire from the IR LED connects to terminal K. Connect the green or blue wire from the IR receiver to terminal F. For all sensors, how you connect the white and yellow wires will determine whether each detector will operate in 'Across the Track' or 'Reflective' mode. Each detector may operate in the same mode or in different modes. Pairing is important! The IR LED that is connected to 1K must be paired on the layout with the IR receiver that is connected to 1F. The same is true for all other sensor pairs. Power: The RIR4 is powered by the microcontroller's +5v dc. The blue LED on the RIR4 will light when power is on and the RIR4 is functioning. Test and adjust the sensors: With no objects near any sensor pair, all yellow LEDs on the RIR4 circuit should be off. If any yellow LED is on, correct the false sensing condition. To fix false sensing for Across-Track mode: 2. Make sure the IR LED and photo receiver are pointed at each other, and nothing is between them. 3. Shade the photo receiver from bright lights, and point it away from windows or other strong light sources. 4. Change the nearby room light from incandescent to a fluorescent or LED bulb if possible. On Board LEDs The blue LED is on when the RIR4 has power and has completed its start-up sequence. The blue LED will 'wink' when the RIR4 receives an I2C command. Each detector has a yellow LED that lights when that detector is sensing an object. To fix false sensing for Reflective mode: 2. Pull the IR LED and photo receiver a bit deeper into the roadbed. 3. Infrared light may be 'leaking' through the roadbed material from the IR LED to the photo receiver. Push a metal shim, such as the tip of a hobby knife blade, vertically into the roadbed between the IR LED and photo receiver. 4. Is there an object above the sensor, such as a bridge, or an upper layout level? Mount the IR LED and photo receiver at a shallower angle, or paint the object flat black. Or use across-track sensing. 2018 Azatrax.com RIR4 user's guide pg. 2 of 5

Are all detectors off? Now test for object detection. Place a locomotive or car at the #1 sensor. Yellow #1 LED should light. If the LED does not light, correct the #1 sensor pair for a false clear condition. To fix a false clear indication for Across-Track mode: 2. Adjust the sensor height so the train is fully blocking the light path from the IR LED to the photo receiver. To fix a false clear indication for Reflective mode: 2. Adjust the sensors higher or lower in the roadbed. 3. A bright light source above and to the side of the track may be saturating the IR photo receiver. Try pulling it deeper into the roadbed or create shade with scenery or a structure. Change the nearby light from incandescent to a fluorescent bulb. Test with several types of rolling stock and adjust the sensors as needed. The sensitivity of each IR detector can be adjusted by sending commands via the microcontroller. This is explained in the I2C Communication section, page 4. Detector Details How the IR detectors work: As mentioned above, each IR sensor has two parts, and IR LED (light source) and an IR receiver. The IR LED continuously sends out pulses of IR light. The receiver is constantly taking in IR light from its surroundings. The detector circuit converts the intensity of the received IR light into a number. A zero represents absolutely no received IR light. As the intensity of the received light increases, the calculated number increases, up to a maximum number of 255 (0xFF in hexadecimal). When the intensity reaches this maximum number, the IR receiver is said to be "saturated." As the intensity of the received light increases above this saturation level, the calculated number remains at 255. Detector sensitivity: The detector circuit is looking for variations in the received IR light that match the pulses transmitted by the IR LED. The received pulses ride on top of the ambient IR level. When the height of the received pulses -- the signal level -- exceeds the ambient IR level by a certain amount -- the threshold -- the detector state changes to "occupied." When the signal level is less than the threshold, the detector state changes to "vacant." Note that as the ambient IR level increases, the headroom on the above chart decreases. Increasing the threshold also decreases the headroom. Headroom is reduced to zero when the ambient IR level plus the threshold equals 255. When headroom is reduced to zero, the detector can no longer determine when a signal exceeds the threshold. The detector will never change to the "occupied" state. Therefor, do not set the threshold to a higher value than necessary, especially in areas of high ambient IR light. Stopwatches Measuring elapsed time and direction: Two timers -- stopwatches -- are embedded in the RIR4 and are controlled by the I2C bus master and the IR detectors. Each stopwatch is individually enabled by the microcontroller. See I2C Communication, page 4. Stopwatches can be set up as "speed traps," reporting the time it takes an object to go between detector #1 & #2, or between detector #3 & #4. If the distance between sensors in known, the microcontroller can calculate the object's speed. Stopwatches record minutes, seconds and 1/100 seconds. They will stop at 255 minutes. Accuracy is +/- 2%. 2018 Azatrax.com RIR4 user's guide pg. 3 of 5

Stopwatch A, after being enabled, is set to "ready" when detectors #1 & #2 are both in the same state, either vacant or occupied. Then if detector #1 changes first, stopwatch #1 starts running. Stopwatch #1 stops when detector #2 changes state. Direction register A is set to value 01 if the object is moving from sensor #1 to #2. It is set to 02 if the object is moving from sensor #2 to #1. Stopwatch B, after being enabled, is set to "ready" when detectors #3 & #4 are both in the same state, either vacant or occupied. Then if detector #3 changes first, stopwatch #3 starts running. Stopwatch #3 stops when detector #4 changes state. Direction register B is set to value 03 if the object is moving from sensor #3 to #4. It is set to 04 if the object is moving from sensor #4 to #3. I2C Communication The I2C communication bus is designed to have one 'master' device and one or more 'slave' devices. For the following explanations, the microcontroller (Arduino or compatible) is the I2C master and the RIR4 is a slave. I2C address: Every slave device must have its own unique I2C address. Three switches on the RIR4 allow you to select one of eight addresses for each RIR4. Orient the circuit board so that switch 3 is to the left. Push a switch handle up to set it to 1, and down to set it to 0. Device register addresses: The I2C address switches select the I2C address of the RIR4 (the "device"). The RIR4 has several 8-bit bytes of data ("registers") that the master can read from or write to. Each register has an address. Register addresses are separate from the device address. The I2C protocol specifies that the master initiates each exchange of data. Read registers: To learn what is happening within the RIR4, the master reads data from the RIR4 read registers. The master first sends the RIR4's I2C device address onto the I2C bus. This gets the attention of the RIR4. Second, the master sends the register address of the particular data byte of interest. Third, the RIR4 sends the contents of the specified register onto the I2C bus so the master can read it. Read Register Contents: This is the information that the master can read from the RIR4 device (addresses are shown in hexadecimal format): 0x00 Bitmap of the register states. Bit0 (least significant bit) is '0' if detector #1 is vacant (not sensing an object), and '1' if detector #1 is occupied (is sensing an object). Bit1 reports the state of detector #2. Bit2 reports the state of detector #3. 2018 Azatrax.com RIR4 user's guide pg. 4 of 5

Bit3 reports the state of detector #4. Bit4 through bit7 are always '0'. Examples: If all detectors are vacant, register 0x00 = 0000 0000. If only detector #1 is occupied, register 0x00 = 0000 0001. If only detector #3 is occupied, register 0x00 = 0000 0100. If detectors #4, #3 and #2 are occupied and #1 is vacant, register 0x00 = 00001110. 0x10 Detector #1 signal level 0x30 Detector #3 signal level 0x11 Detector #1 threshold value 0x31 Detector #3 threshold value 0x12 Detector #1 ambient IR level 0x32 Detector #3 ambient IR level 0x20 Detector #2 signal level 0x40 Detector #4 signal level 0x21 Detector #2 threshold value 0x41 Detector #4 threshold value 0x22 Detector #2 ambient IR level 0x42 Detector #4 ambient IR level 0x0A Bitmap of the stopwatch states. Bit0 (least significant bit) is '0' if stopwatch A is stopped, '1' if running. Bit1 reports the state of stopwatch B. Bit2 through bit7 are always '0'. Examples: If all stopwatches are stopped, register 0x0A = 0000 0000. If only stopwatch A is running, register 0x0A = 0000 0001. If only stopwatch B is running, register 0x0A = 0000 0010. 0xA0 Stopwatch A minutes 0xB0 Stopwatch B minutes 0xA1 Stopwatch A seconds 0xB1 Stopwatch B seconds 0xA2 Stopwatch A 1/100th seconds 0xB2 Stopwatch B 1/100th seconds 0xA3 Direction A, value 0x01 indicates movement 0xB3 Direction B, value 0x03 indicates movement from sensor #1 toward sensor #2. from sensor #3 toward sensor #4. 0x02 indicates movement from sensor #2 to #1. 0x04 indicates movement from sensor #4 to #3. Write registers: To control functions within the RIR4, the master writes data into RIR4 registers. The master first sends the RIR4's I2C device address onto the I2C bus. This gets the attention of the RIR4. Second, the master sends the register address of the particular data byte of interest. Third, the master sends the contents of the specified register onto the I2C bus so the RIR4 can read it. Write Register Contents: This is the information that the master can write to the RIR4 device (addresses are shown in hexadecimal format): 0x11 Detector #1 threshold value 0x31 Detector #3 threshold value 0x21 Detector #2 threshold value 0x41 Detector #4 threshold value Notes: Writing 0x00 or 0xFF to a threshold register will cause it to be reset to the factory default value of 0x18. Data written to a threshold register will be retained in the RIR4 after power is turned off / on. After writing to a threshold register, wait at least 4 millisec before sending the next I2C command. This gives the RIR4 time to update its non-volatile memory. 0xA0 0xB0 Writing 0x00 to this register resets stopwatch A and enables it for the next timing event. Writing 0x00 to this register resets stopwatch B and enables it for the next timing event. Arduino sketch examples (program code) can be found at www.azatrax.com/arduino Arduino is a trademark of Arduino, AG. I2C is a trademark of NXP B.V. 2018 Azatrax.com RIR4 user's guide pg. 5 of 5