Reports.EPIR History

Hide minor edits - Show changes to output

Changed line 86 from:
{++Keywords++]
to:
[++Keywords++]
Changed lines 86-87 from:
Keywords
to:
{++Keywords++]
Changed lines 82-91 from:
[[Code.ePIR_Hardware | ePIR Hardware Interface Sample]]

[[Code
.ePIR_Serial | ePIR Serial Interface Sample]]. Arduino simply acts as a pass-through, you can write your code directly in Processing.

Application Notes
Describe your own application of the sensor. Link to any external documentation of your project, and discuss how you got the sensor to do what you needed it to.

References/Bibliography
Add links to any reference material you used to learn about your sensor
. Cite your sources for explanations, code, and circuits.
to:
[[Code.ePIR_Hardware | ePIR Hardware Interface Sample]]. Here is [[http://vimeo.com/40980487 | an example of the hardware mode in action.]]

[[Code.ePIR_Serial | ePIR Serial Interface Sample]]. Arduino simply acts as a pass-through, you can write your code directly in Processing. Here is [[http://vimeo.com/40987005 | an example of the serial mode in action
.]]
Changed line 87 from:
List any useful tags or keywords that will make this report more searchable.
to:
motion detection, movement, ePIR, PIR, passive infrared, zilog
Changed lines 84-91 from:
In your code sample, show how to do the following:

read the sensor's output and save in a variable.
convert the sensor's output range to a voltage range corresponding to the microcontroller's analog-to-digital range.
convert from voltage to the physical property that the sensor measures. Provide the appropriate math in a separate function, as needed.
print the raw sensor reading, the voltage reading, and the physical property reading serially
Typical Behavior
Describe the behavior of the sensor when you use it to sense something. Note any peculiarities that you had to work around, or things that might affect someone else's use. Graphs and images are useful here
.
to:
[[Code.ePIR_Serial | ePIR Serial Interface Sample]]. Arduino simply acts as a pass-through, you can write your code directly in Processing.
Deleted lines 80-81:

Give a code sample for the microcontroller you developed the example on. Link it to the Code group of the wiki, formatting the link like this:
Changed lines 77-81 from:
Code Sample
to:
This is a drawing of the hookup for the serial interface to an Arduino Uno. When the sensor powers on, we are sending the full voltage to pin 4 to indicate that we want to use the serial interface. There are two connections to the arduino now, one for reading and one for writing.

[++Code Sample++]
Changed line 84 from:
[[Code.myCodeSample | Code Sample]]
to:
[[Code.ePIR_Hardware | ePIR Hardware Interface Sample]]
Changed lines 71-74 from:
Explain how to connect the sensor to a microcontroller or computer. Include a schematic and any other necessary diagrams. Make sure to include a list of every part in the schematic.

Additional parts needed to use it
List any hardware needed
to interface this sensor to a microcontroller or computer.
to:
This is a drawing of the hookup to an Arduino Uno for the hardware interface mode. This is a diagram of the microcontroller connections for the hardware interface mode. There is a photocell connected to pin 6 to take in the ambient light levels.

The most interesting part of this circuit is the potentiometer hooked up to pin 4. The amount of voltage supplied to pin 4 determines whether you go into hardware mode or serial mode. If you give pin 4 between 0 and 1.8V, you go into hardware mode. The entire sensor can take up to 3.6V, which is two times 1.8. So the potentiometer is connected to power and ground through 10K resistors. This splits the voltage evenly. So if youíre connecting to a full 3.6, your max voltage here will be 1.8V. Then you can turn the potentiometer down if you want to lower the voltage, which would increase the sensitivity of the ePIR.

Attach:SerialHookup_Small.jpg
Changed line 69 from:
Attach:HardwareHookup
to:
Attach:HardwareHookup_Small.jpg
Changed lines 67-69 from:

Microcontroller Connections
to:
[++Microcontroller Connections++]

Attach:HardwareHookup
Changed lines 53-54 from:
Attach:PinTable.jpg
Attach:PinTable
.jpg
to:
Attach:PinTable_Small.jpg
Added line 53:
Attach:PinTable.jpg
Changed line 53 from:
attach:PinTable.jpg
to:
Attach:PinTable.jpg
Changed line 53 from:
attach:PinTable.png
to:
attach:PinTable.jpg
Changed lines 45-52 from:
Put a link to the datasheet at the top. Also link any retail sources, for example if you're using a breakout board, or any other parts that making the sensor easier.

Give the voltage and amperage ranges, and any other relevant electrical data.

Describe the electrical changes when the sensor senses whatever physical changes it senses. Include graphs as needed
.

Pin Descriptions
Give a list of the pins, and a pin diagram as appropriate
. Detail the function of each pin in a short paragraph following the list.
to:
[[http://www.sparkfun.com/datasheets/Sensors/Proximity/SEN-09587-PS0284.pdf | The datasheet]] for the ePIR is very helpful.

The ePIR runs off of 2.7-3.6V. It draws 8.9 mA of current when active at 3.3V. It draws only 2.3 mA when in sleep mode.

The ePIR has an automatic Brownout Reset Threshold to protect the sensor from damage
. The brownout typically takes effect at 2.4V.

[++Pin Descriptions++]

attach:PinTable.png

Pins 1 and 8 are ground. Pin 2 is power. The sensor takes between 2
.7 and 3.6V.

Pin 4 is the key for selecting which mode you would like to use. If you supply pin 4 with 0 to 1.8 V, you will be in hardware mode and the amount of voltage you supply this pin will determine the sensitivity of the sensor. 0V is the highest sensitivity, and 1.8V is the lowest sensitivity. If you supply pin 4 with more than 2.5V, you will enter serial interface mode. In serial mode, pin 4 is used to transmit data.

In hardware mode, pin 3 is the delay. This determines how long the sensor will wait after it has detected motion to look again. The delay can be anywhere from 2 seconds to 15 minutes. This feature is useful if youíre tracking people entering a room, for example. You donít want to activate multiple times for the same person, so you institute a properly timed delay. In serial mode, pin 3 is used to receive data.

Pin 5 is motion detection in hardware mode. It reads 0 when motion is detected, 1 when no motion is detected. In serial mode, pin 5 can either be motion detection or reset. It defaults to acting as a reset pin.

Pin 6 is the light gate for both hardware and serial modes. The best way to use this pin is to attach a light sensor like a photocell that will take into account the ambient light in the environment so that changes in light donít falsely trigger the ePIR. When I first set up my circuit, I attached a potentiometer to this pin so that I could adjust the levels manually and see how it affected the sensor.

Pin 7 is sleep. Sleep mode is useful to conserve energy when the sensor does not need to be in use. Like the motion detection pin, this is an active low pin, so when it is sent Ď0í, it goes into sleep mode.
Changed lines 23-24 from:
* 'b': Read Current Light Gate Input Level
* 'l': Read Light Gate Threshold
to:
* 'b': Read Current Light Gate Input Level. You will receive a value between 0-255.
* 'l': Read Light Gate Threshold. You will receive a value between 0-255.
Changed lines 28-34 from:
* 'f': Read Frequency Response Setting
* 'F': Write Frequency Response Setting
*
's': Read Sensitivity.
* 'S': Write Sensitivity.
* 'v': Read Direction.
* 'V': Write Direction
.
to:
* 'f': Read Frequency Response Setting. You will receive an 'L' if both low and high frequency motion is being detected and an 'H' if only high frequency movement is being detected.
* 'F': Write Frequency Response Setting. Send an 'L' to detect both low and high frequency movement and an 'H' to detect only high frequency motion.
* 's': Read Sensitivity. You will receive a value between 0-255.
* 'S': Write Sensitivity. Enter a value between 0-255.
* 'v': Read Direction. You will receive an 'A' if there is motion in any direction, a '+' if there is motion in the rightward direction, and a '-' if there is motion in the leftward direction.
* 'V': Write Direction. Send an 'A' to detect motion in all directions, a '+' to detect motion in the rightward direction, and a '-' to detect motion in the leftward direction.
Changed lines 28-33 from:
to:
* 'f': Read Frequency Response Setting
* 'F': Write Frequency Response Setting
* 's': Read Sensitivity.
* 'S': Write Sensitivity.
* 'v': Read Direction.
* 'V': Write Direction.
Changed lines 20-22 from:
You communicate these advanced configurations by sending ASCII values to the sensor. Here is a list of commands for the ePIR:

* '''a''': Read Motion Status. You will receive "N" for no motion and "Y" for motion.
to:
You communicate these advanced configurations by sending ASCII values to the sensor. Here is a list of some of the commands for the ePIR:

* 'a': Read Motion Status. You will receive 'N' for no motion and 'Y' for motion.
* 'b': Read Current Light Gate Input Level
* 'l': Read Light Gate Threshold
* 'L': Write Light Gate Threshold. Then send a value between 0-255 to set the treshold.
* 'e': Read Extended Range Settings. You will receive a 'Y' if extended range is enables and an 'N' if it is not.
* 'E': Write Extended Range Settings. Send a 'Y' to enable extended range and an 'N' to disable it
.
Changed line 22 from:
* "'a'": Read Motion Status. You will receive "N" for no motion and "Y" for motion.
to:
* '''a''': Read Motion Status. You will receive "N" for no motion and "Y" for motion.
Changed line 22 from:
* ""'a'"": Read Motion Status. You will receive "N" for no motion and "Y" for motion.
to:
* "'a'": Read Motion Status. You will receive "N" for no motion and "Y" for motion.
Changed lines 18-23 from:
The serial interface mode is basically a souped up version of the hardware mode. It has all of the same features as the hardware interface mode, but it also allows for advanced configuration. You can tailor the threshold through the sensitivity settings and also a threshold for the light gate. You can change the range of the sensor so that it is either regular range or extended range. You can also choose to read the directionality of motion.
to:
The serial interface mode is basically a souped up version of the hardware mode. It has all of the same features as the hardware interface mode, but it also allows for advanced configuration. You can tailor the sensor through the sensitivity settings and also a threshold for the light gate. You can change the range of the sensor so that it is either regular range (3m x 3m) or extended range (5m x 5m). You can also choose to read the directionality of motion. And you can adjust the frequency response settings. Objects in the lower frequency are horizontal, like pets. The ePIR can either react to objects in all frequencies or objects that are just in the upper frequency. This would be a useful setting, for example, if you wanted to create a motion-activated alarm that reacted to people but not pets.

You communicate these advanced configurations by sending ASCII values to the sensor. Here is a list of commands for the ePIR:

* ""'a'"": Read Motion Status. You will receive "N" for no motion and "Y" for motion.
Changed lines 4-5 from:
Introduction
to:
[++Introduction++]
Changed lines 10-21 from:
You can connect to the ePIR in two ways: through hardware interface or through serial interface. In hardware mode, you can adjust the sensitivity of the sensor, the delay -- how long after detecting motion before the sensor will look again -- and you can add a light sensor to take into account the ambient light conditions. Serial mode offers all of the same features as hardware mode and also some more advanced configurations. You can set a sensitivity value and a light gate threshold value. You can also ask the sensor to look for motion in only one direction. See the Microcontroller Connection section for more information.

Key Concepts
What are the things that you are assuming?

Sources
Outline here where you got your sensor, how much it cost and what your experience of getting it was like.

Applications
Describe some typical applications of this sensor. You can often get this from
the datasheet, but a few examples from companies or individuals who've used it would be useful as well.

Electrical Characteristics
to:
You can connect to the ePIR in two ways: through hardware interface or through serial interface. In hardware mode, you can adjust the sensitivity of the sensor, the delay -- how long after detecting motion before the sensor will look again -- and you can add a light sensor to take into account the ambient light conditions. Serial mode offers all of the same features as hardware mode and also some more advanced configurations. You can set a sensitivity value and a light gate threshold value. You can also ask the sensor to look for motion in only one direction. See the Key Concepts section for more information.

[++Key Concepts++]

There
are two ways of connecting to the ePIRó hardware interface mode and serial interface mode. The ePIR uses asynchronous serial communication and runs at a 9600 baud rate.

The hardware interface mode allows you to adjust the sensitivity of
the sensoró in other words, you can adjust how much motion is required to trigger the sensor. You can also adjust the delay, which determines the interval after the sensor is tripped before it will be active again. There is also an option to input a value for the ambient light level so that the sensor will not be accidentally triggered by changing light values.

The serial interface mode is basically a souped up version of the hardware mode. It has all of the same features as the hardware interface mode, but it also allows for advanced configuration. You can tailor the threshold through the sensitivity settings and also a threshold for the light gate. You can change the range of the sensor so that it is either regular range or extended range. You can also choose to read the directionality of motion.


[++Sources++]

The ePIR is [[http://www.sparkfun.com/products/9587 | available from Sparkfun]] for $11.95.

[++Applications++]

The ePIR is most often used for security, for example motion-activated lights, cameras, and alarms. It could also be used for animal camera traps, motion-activated pet food dispensers, holiday props, and robotics.

[++Electrical Characteristics++]
Changed line 6 from:
Attach:ePIR.jpg
to:
Attach:ePIR_Small.jpg
Changed line 10 from:
You can connect to the ePIR in two ways: through hardware interface or through serial interface. In hardware mode, you can adjust the sensitivity of the sensor, the delay -- how long after detecting motion before the sensor will look again -- and you can add a light sensor to take into account the ambient light conditions. In serial mode, you can do more advanced configurations. You can set a sensitivity value and a light gate threshold value. You can also ask the sensor to look for motion in only one direction. See the Microcontroller Connection section for more information.
to:
You can connect to the ePIR in two ways: through hardware interface or through serial interface. In hardware mode, you can adjust the sensitivity of the sensor, the delay -- how long after detecting motion before the sensor will look again -- and you can add a light sensor to take into account the ambient light conditions. Serial mode offers all of the same features as hardware mode and also some more advanced configurations. You can set a sensitivity value and a light gate threshold value. You can also ask the sensor to look for motion in only one direction. See the Microcontroller Connection section for more information.
Changed lines 3-5 from:
Attach:image.jpg
to:
Changed line 6 from:
Attach: ePIR.jpg
to:
Attach:ePIR.jpg
Added lines 1-60:
Initial report by [[~ls3101 | Luca Shapiro]], 25 May 2012

Attach:image.jpg


Introduction

Attach: ePIR.jpg

The ePIR is a motion detection sensor made by Zilog. The difference between the ePIR and a standard [[http://itp.nyu.edu/physcomp/sensors/Reports/PassiveInfraRedSensor | PIR]] is that this sensor includes an onboard microcontroller called the z8 Encore! XP MCU.

You can connect to the ePIR in two ways: through hardware interface or through serial interface. In hardware mode, you can adjust the sensitivity of the sensor, the delay -- how long after detecting motion before the sensor will look again -- and you can add a light sensor to take into account the ambient light conditions. In serial mode, you can do more advanced configurations. You can set a sensitivity value and a light gate threshold value. You can also ask the sensor to look for motion in only one direction. See the Microcontroller Connection section for more information.

Key Concepts
What are the things that you are assuming?

Sources
Outline here where you got your sensor, how much it cost and what your experience of getting it was like.

Applications
Describe some typical applications of this sensor. You can often get this from the datasheet, but a few examples from companies or individuals who've used it would be useful as well.

Electrical Characteristics
Put a link to the datasheet at the top. Also link any retail sources, for example if you're using a breakout board, or any other parts that making the sensor easier.

Give the voltage and amperage ranges, and any other relevant electrical data.

Describe the electrical changes when the sensor senses whatever physical changes it senses. Include graphs as needed.

Pin Descriptions
Give a list of the pins, and a pin diagram as appropriate. Detail the function of each pin in a short paragraph following the list.

Microcontroller Connections
Explain how to connect the sensor to a microcontroller or computer. Include a schematic and any other necessary diagrams. Make sure to include a list of every part in the schematic.

Additional parts needed to use it
List any hardware needed to interface this sensor to a microcontroller or computer.

Code Sample
Give a code sample for the microcontroller you developed the example on. Link it to the Code group of the wiki, formatting the link like this:

[[Code.myCodeSample | Code Sample]]

In your code sample, show how to do the following:

read the sensor's output and save in a variable.
convert the sensor's output range to a voltage range corresponding to the microcontroller's analog-to-digital range.
convert from voltage to the physical property that the sensor measures. Provide the appropriate math in a separate function, as needed.
print the raw sensor reading, the voltage reading, and the physical property reading serially
Typical Behavior
Describe the behavior of the sensor when you use it to sense something. Note any peculiarities that you had to work around, or things that might affect someone else's use. Graphs and images are useful here.

Application Notes
Describe your own application of the sensor. Link to any external documentation of your project, and discuss how you got the sensor to do what you needed it to.

References/Bibliography
Add links to any reference material you used to learn about your sensor. Cite your sources for explanations, code, and circuits.

Keywords
List any useful tags or keywords that will make this report more searchable.