ROOM OCCUPANCY INDICATOR

Download Report

Transcript ROOM OCCUPANCY INDICATOR

ROOM OCCUPANCY INDICATOR
Abeer Zidan
Fatima Al-sayyied
INTRODUCTION
Our senior design project aims to create a functional
system where the number of people in a room can
be determined based on tabulating people entering
and exiting a room.
OUR OBJECTIVES
•Accurately
sense whether or not someone enters or
exits a room through ultrasonic sensors
•Keep/Update count value in the microcontroller
•Transmit and receive the count value wirelessly
•Convert count value so a computer can understand
it using MAX-232/RS-232
•Display count value on the computer
Applications
• Easy way to know the number of people in a
room or building
 • Connects settings of heating, lighting, and
other utilities to room occupancy
 • Assists situations where evacuation may be
necessary, e.g. bomb threats, fire alarms, etc.
 • Improves time management, e.g. hotel
housekeepers can skip occupied rooms

BENEFITS & FEATURES
•Low
overall cost
•Easy to use
•Wireless transmission of occupancy data
•Ability to toggle between two counting modes
•Mode I: keeps track of total number of people in
room (adds if people enter, subtracts if people leave)
•Mode II: keeps track of highest count (adds if people
enter, does not subtract if people leave)
REVIEW ORIGINAL DESIGN
ORIGINAL DESIGN
Channel 0
Room A
5 people
5 people
Room A
Wireless
Communication
Channel 1
4 people
Room B
Room B
4 people
Master Room
Sensors -> Pic -> Transmitter -> Receiver -> Pic -> MAX -> RS -> Display
PROJECT BUILD AND
FUNCTIONAL TESTS
•Ultrasonic
Sensors
•Microcontroller
•Wireless system
•MAX-232/RS-232
•Display ON PC
SUB PROJECTS


Sensor System: This consisted of two adjacent ultrasonic
sensors. The sensors sent out waves and if asignal
arrived back to its respective sensor faster than normal,
then the appropriate sensor detected aperson.
PICs: The system had two PICs. One simply acted as an
oscillating input for the sensors. It mimicked a 1Hz, 13%
duty cycle signal that signaled the sensors to send out
ultrasonic waves. The second PIC had the logic setup
which determined the current count of people in the
room.
CON.
Transmitter/Receiver System: This portion of
our design wirelessly transferred the occupancy
value from the first PIC to the MAX-232.
 MAX-232/RS-232: The MAX-232 converted the
signal that came from the receiver into a signal
that the RS-232 could read. The RS-232 then fed
this signal into the display.

BLOCK DIAGRAM
RX MODULE
TX MODULE
RS-232
MAX-232
WIRELESS RECEIVER
WIRELESS TRANSMITTER
SENSOR
#2
MICROCRONTROLLER
SENSOR
#1
PERSON
DISPLAY
Sensor SRF08

The SRF08 appears as a set of 36 registers
◦ Reg.0: read\ write ; read gives version of srf
◦
write gives unit of measure
◦ Reg.1: read; photo sensor gives a value from 0-255 that
represent light intensity
◦ Reg.2: gives the distance
SENSOR DISTANCE & RANGE
x=?
22°
x=?
22°
y=?
22°
22°
y=?
wall
wall
NOT PREFERRED
PREFERRED
tan 22° = 0.4 ≥ x/(2y)
 x/y ≥ 0.8
MICROCONTROLLER
Master Clear/ PIC Reset
(5V)
(GRND
4 MHz oscillator
)
LED Output – For Testing
LED Output – For Testing
LED Output– For Testing
LED Output – For Testing
LED Output– For Testing
LED Output – For Testing
LED Output – For Testing
LED Output – For Testing
(5V)
(GRND)
Count transmitted to wireless circuit
Input SDA
Input – SCL
Switch Input – Mode Type of Count
Switch Input – Count Reset
Microcontrollor
Detect the current count of people in the room and
make calculations on it and send it to Tx
 This process was done by making a state machine in
order to know previous input values and to handle the
frequency issues involved in checking the sensors’
outputs.
 The pic operates at two modes:
 Default mode :room occupancy indicator(tracked
current amount of people)
 Secondary mode: total amount of people who entered a
room over atime

STATE MACHINE
00/11
00/11/01
01 (S1 on 1st)
STATE 0
(START)
STATE 1
10 (S2 on 2nd)
10 (S2 on 1st)
00/11/10
STATE 2
11
ENTRY
(ADD 1)
01 (S1 on 2nd)
EXIT
(SUBTRACT 1)
unconditional
unconditional
TRANSITION
STATE
00/10/01
WIRELESS SYSTEM
•Xbee
(ZigBee series 2 ;ZN or 2.5)transmitter
•Xbee (ZigBee series 2 ;ZN or 2.5)receiver
. This is the very popular 2.4GHz XBee module
**transmitter take the output from the microcontroller and
send it to the receiver.
Features:

It's used for both transmitting and receiving

Small size and low cost and low power consumption

Power down sleep current less than 10 micro A

Supply voltage 2.8 to 3.4 v

3.3V @ 50mA( serial interface)

16-direct sequence channels

250kbps Max data rate

Frequency band 2.4 GHz

Indoor range\Urban range :133 ft (40 m)

Outdoor\ RF line of site range 400 ft (120 m)

Operating temperature : -40 c to 85 c

Built-in antenna( chip antenna, wire whip antenna, RF
connector.)

Point-to point or mesh network






Design Notes:
• Minimum connections:VCC, GND, DOUT & DIN
• Minimum connections to support firmware upgrades:VCC, GND,
DIN, DOUT, RTS & DTR
• Signal Direction is specified with respect to the module
• Module includes a 30k Ohm resistor attached to RESET
• Unused pins should be left disconnected
DTR - "Data terminal ready" this is a flow control pin
used to tell the XBee that the microcontroller or
computer host is ready to communicate.
 RST - this pin can be used to reset the XBee. By default
it is pulled high by the 10K resistor under the module.
To reset, pull this pin low.'
 Ground - common ground for power and signal
 CTS - "Clear to Send" this is a flow control pin that can
be used to determine if there is data in the XBee input
buffer ready to be read




RX - This is the XBee's serial recieve pin. Serial data is
sent on this pin into the XBee to be transmitted
wirelessly
TX - This it the XBee's serial transmit pin. Serial data is
sent on this pin out of the XBee, after it has been
transmitted wirelessly from another module
0 RTS - "Ready to Send" this is a flow control pin that
can be used to tell the XBee to signal that the
computer or microcontroller needs a break from
reading serial data.
Serial Data

Data enters the module UART through the DIN (pin 3) as
an asynchronous serial signal.The signal should idle high
when no data is being transmitted. Each data byte consists
of a start bit (low), 8 data bits (least significant bit first)
and a stop bit (high).The following figure illustrates the
serial bit pattern of data passing through the module.
Max232 and RS-232
No
Handshaking
1 CD
2 RXD
3 TXD
4 DTR
5 GND
6 DSR
7 RTS
8 CTS
9 RI
Carrier Detect
Receive Data
Transmit Data
Data Terminal Ready
Ground
Data Set Ready
Request to Send
Clear To Send
Ring Indicator
MAX-232/RS-232 INTERFACE
RECOMMENDATIONS
•Include
usage of infrared sensors to make sure humans
are detected as opposed to inanimate objects.
• TO solve the problems of the sensors; we can use
(motion detection) camera.
Questions?