Project Documentation - The Richard Pate School

advertisement
Theo Jesson
Miles Ray
Olivia Saha
Joseph English
Nina Counsell
Kishan Johal
Summary
We have developed a system to help old/disabled people
answer the door, especially people who have difficulty
walking or walk slowly. The system uses the Raspberry Pi
with the Piface attachment. The problem is that old and
disabled people sometimes take a very long time to reach the
door to answer it so this system aims to eliminate that
problem by letting the old or disabled person send a message
to the person at the door and unlock the door remotely. The
door can also be unlocked from the outside, and to make the
system safe, there is a code required to unlock the door that
the old/disabled person can give to trusted people (carers,
relatives and friends).
There are wireless and wired keypads for this. The wireless
keypad hangs round the neck of the old/disabled person and
they can use this anywhere in the house to unlock the door
or send a message to the person standing at the door.
Alternatively, the person waiting at the door can enter the
code on the wired keypad outside at the door and get in
straight away. There is a screen by the door with three items
on it. A padlock shows two different displays: open and shut.
This shows if the door is locked or unlocked. The other two
items are messages; one of them varies so that the old
person can send a message to the person standing at the
door and the other one will ask them to enter a code to open
the door and shows them how many keys they have entered.
We used the programming language “Scratch” to make the
system. We realised we would need a Piface in order for the
project to work. This took half of our budget. We needed the
Piface because we needed an interface between Scratch and
electronic items such as an electric door lock, LED lights and a
buzzer.
We tested the product in a play house we got from the
reception classroom and it works.
List of Items in the Project
These are the items in the project with the price of all the
extra items.
Items
Piface
Buzzer
Electric Lock
Wires (2m)
LED Lights
Resistor
Wireless numeric
keypad
Wired Numeric Keypad
12V Battery
Ribbon (1m)
Sticky label
Raspberry Pi
Monitor
Keyboard
Mouse
Scratch
4Gb SD Card
PiFace SD Card Image
Total (including vat)
Quantity
1
1
1
0.02
2
2
1
Price for one
£24.00
£1.10
£11.62
£9.11
£0.07
£0.29
£9.99
Total price
£24.00
£1.10
£11.62
£0.18
£0.14
£0.58
£9.99
1
2
0.01
0.01
1
1
1
1
1
1
1
£4.45
£2.00
£37.23
£12.00
£0.00
£0.00
£0.00
£0.00
£0.00
£0.00
£0.00
£4.45
£4.00
£0.37
£0.12
£0.00
£0.00
£0.00
£0.00
£0.00
£0.00
£0.00
£56.55
Instructions for Making the Project
This is how to make the door system.
Preparing the SD card
1. Copy the SD card image from the University of
Manchester http://pi.cs.man.ac.uk/download
2. It’s got a version of scratch that can talk to the Piface
board
3. Put it on to a 4GB SD card on a windows 7 system using
Win32DiskImager.
Setting up the wireless keypad
1. Tape a ribbon to the back of the wireless keypad.
2. Stick a sticker on the back showing how to use it.
Setting up the Piface
You will need, a red and a green LED, two resistors, a 390
ohm (orange white brown bands) and a 330 ohm (orange
orange brown bands), a buzzer and approximately 1m of
wire.
1. Warning! You may need an adult to do step 1
Solder the 390 ohm resistor to the red LED and solder
wires to the other ends. Solder the 330 ohm resistor to the
green LED and solder wires to the other ends. Use red wire
for positive and black wire for negative.
2. Connect the positive (Red) wires to the 5V terminal on
the Piface. Connect the negative (Black) wire of the
green LED to Output pin 1. Connect the negative (black)
wire of the Red LED to Output pin 2.
3. Connect the negative black wire of the buzzer into
output pin 3
Putting it all together
SET UP BY THE FRONT DOOR
1.
2.
3.
4.
5.
6.
7.
8.
Get the Raspberry Pi (with the keyboard, Monitor,
etc.) with Piface
Connect the Piface to the raspberry pi using the pins
on the boards
Connect the front door lock to the Piface. Connect
the 12V battery to the lock. Connect the other two
leads to relay 1 common and N.O (normally open)
terminals on the Piface
Put in the Raspberry Pi SD card in the rear slot
Connect the monitor using an HDMI cable
Connect the Keyboard and Mouse
Plug in power for Raspberry Pi and a red light will
come on.
When prompted. Type in the Username and
Password which, by default, are pi as the username
and raspberry as the password. When it has accepted
your entry type startx.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
Then you will be taken to the GUI (graphical user
interface) a.k.a the desktop. Run up scratch.
Use File Open to open the file Door System in the pi
folder.
Hold down the shift key and click on Share. If there is
a Host Mesh option, choose this. It will display an ip
address which is 127.0.1.1. If there is no Host Mesh
option, it’s already running.
Minimize Scratch and run up LX terminal
Type in this: cd piface/scratch. Then press return.
Then type in python scratch_handler.py 127.0.1.1
You will get a display saying sending sensor update.
This will establish the connection between the Piface
and Scratch.
Un-minimize Scratch
Press 09 to reset it first and then test. The code is
3579. Put scratch into presentation mode, top right
hand corner
Unplug the keyboard and mouse because they
interfere with the number pads.
Now plug the wireless keypad transmitter into a usb
socket.
Flick the switch on the back of the keypad.
Test out the number keys, if they do not work, press
the num lock key and try again.
If that doesn’t work repeat steps 19 to 21
23. Plug in the wired number pad and test the numbers
on that. If this doesn’t work press the num lock key
and try again.
Door system user guide
This system will help you answer the door. There is a wireless
keypad which you hang around your neck. Also a wired
keypad is available to put on the front wall by the front door.
A screen behind the window next to the door will display
messages and a place to put in a code.
Using the keypads
The disabled or elderly person keypad is able to give out
messages like “I am unlocking the door”. You can do so by
pressing 0 and pressing a number from 1 to 8. To reset the
system you must press 0 then 9.
These are the codes to use
code
01
02
03
04
05
06
07
08
09
message
Please wait five minutes while I get to the door
Please wait ten minutes while I get to the door
I am in the lounge, I’m just coming
I am in the kitchen, I’m just coming
I am just on the way
Please come to the window so I can see you
I am locking the door
I am unlocking the door, please come in
Please ring the doorbell [reset]
The outside keypad which is by the door is easy to use. You
simply press the code which has to be in correct order. The
correct code is 3579. Too many wrong codes will reset the
system. If the code is right the buzzer will go on for two
seconds and the door will unlock. The green led light means
unlocked and red led light means the door is locked.
Warning this product is not suitable for people who are blind,
deaf or can’t use their fingers.
How It Works
Our program is made out of three sprites, they are called
“messages”, “codes” and “lock”.
The Messages Sprite
The “messages” sprite is the sprite that changes the
costumes to show messages. The costume can only be
changed if 0 is pressed and when 0 is pressed it changes the
variable “0 pressed” to 1.
If you press a number and 0 has already been pressed, it
changes the costume which displays a new message.
If 0 hasn’t been pressed it broadcasts the number you
pressed to the codes sprite.
Once 0 has been pressed and then another number variable
“0 pressed” is set back to 0.
The Code Sprite
When the code sprite receives the broadcast ‘‘got number’’ it
changes the variable “number of codes” by one then it sets
the “1st number” to the number it was given in the “number”
variable. The same with “2nd, 3rd and 4th number’’.
Next it changes the code costume so it has one star if one
number’s been pressed then two so if you type in one
number it will put in one star, if you put in two then it’ll put
in two and so on.
Then if all the four numbers have been pressed and they’re
all correct then it broadcasts “unlock” to open the door and
change the costume to “the door is unlocked please come
in”.
If however the person gets the code wrong then it changes
the costume “wrong code please try again” broadcasts
“reset” and waits 7.5 seconds to reset the system.
The Lock Code
The lock sprite deals with unlocking the door and
broadcasting messages. We found out that we needed three
variables they were called piface-output1, piface-output2
and piface-output3. Piface-output1 would unlock the door
and set the green light on, piface-output2 would set the red
light on and piface-output3 would turn the buzzer on. When
the code is correct it would send a message to the lock sprite
which would unlock the door and set the green light on as
well as turning off the red light and making the buzzer work
then waiting for two seconds then turning off. If the code is
incorrect it will send a message and lock the door. Also if the
person inside thinks the person on the outside is not safe
they can send a message and lock the door as well as turning
the red light on.
The correct code is stored in some variables, e.g. one variable
is 3 the other is 5 the next is 7 and the last is 9. If the
variables are changed then the code is changed for example
if the 3 is changed to 6 then the code would be 6579.
The Making of the Product
We started off with a few ideas. As our mentor’s mother-inlaw has rheumatoid arthritis and Nina’s brother is disabled
we came up with an idea to help them answer the door. On
the way we had some crazy ideas including a heartbeat
sensor for people buried in an earthquake and a heat
detector for a bath?! Eventually the six of us decided on a
door answering system and decided to make the system send
messages and use a code entry to unlock the door or it can
be unlocked remotely from inside using a wireless numeric
keypad.
We met every Thursday lunch time to work on our project
but we realised our £50 budget would not be enough to do
everything we wanted so we had to decide. After a couple of
weeks of online shopping to check prices we were ready to
start programming! We divided the task up between the six
of us but we didn’t really get anywhere until Theo, Miles and
Joseph made a breakthrough, using broadcasts, we figured
out that you could make a sprite’s costume or a stage change
when you pressed a button. Joseph and Olivia set about
taking this to the next level while Miles worked on the lock
sprite and Theo and Kishan did costume designs and Nina
worked on the messaging system. Miles was first to finish,
presenting his working “lock sprite” to us. Theo and Kishan
were next presenting their costumes for the scripts, Theo’s
for Joseph’s and Kishan’s for Miles’. Nina then did her
costumes for Olivia’s scripts. But we came across a problem
while we were doing this. Since we were going to use two
numeric keypads we needed to make sure that only the
inside keypad could remotely unlock and lock the door. The
answer turned out to be simple, cover the zero and other
symbols so only numbers 1 to 9 are able to be pressed on the
outside and use zero for the inside controls.
We used a reception mini playhouse to test our system, it
worked perfectly.
Questions for a User
We put together a group of questions answered by Mr
Hooper’s mother-in-law.
Q. Can you use the keypad with your fingers easily?
A. Yes, it’s OK
Q. Can you use the keypad with it hanging round your neck?
A. A longer ribbon would make it easier.
Q. How many parcels do you get delivered every week?
A. About one a week.
Q. When do you need to answer the door for a parcel?
A. When it comes from the Post Office.
Q. Do you have any carers?
A. Yes. Two regular ones and 4 casual ones.
Q. Would you let them have the code to open the door?
A. Yes.
Q. If you are preparing food or doing something else in the
house, how long would it take to get to the door?
A. It depends what I’m doing. It can take more than 5
minutes, but usually less than 10 minutes. I have to get up
from where I am and use a walking frame to get to the door,
but I can only walk very slowly.
Q. Please look at all the messages you can send to someone
at the door. Are they OK?
A. They are good. There’s no need to change any of them.
Q. How good are the graphics?
A. Good. I love the padlock.
Q. Are there any more improvements we could make?
A. I would like to be able to see who is at the door. Also, I
think the keypad on the outside would need to be
waterproof.
Making this into a product
This product would be sold to the elderly and disabled or
people who find it hard going to the front door.
Before this could be sold as a proper product it would have
to have some changes made.
We would need to screw the keypad for the outside on to the
material of the outside wall of a house.
The outside keypad would only be numbered 1 to 9.
The outside keypad would have a water proof cover on top
to protect it from the rain.
The keypad that hangs around your neck would have to be
numbered 0 to 9.
We would make a way to change the code for opening the
door to whatever the old/disabled person wants.
We would also make a way to change the messages
displayed.
To make sure we only sell it to people with disability in their
legs.
Improvements We Could Make
We could put a flashing light outside by a window and get the
person outside to go to it so the person inside could see who
it is.
We could use a camera and monitor as well so the person
inside can see them.
The lock could stay locked automatically if the person outside
typed the code in wrong three times.
We could also have an LED screen instead of putting a screen
in the window to say the messages.
We could have a thumb print scanner or a retina scanner so
you can make sure they are who they say they are.
We could give everyone the person knows their own code.
We could make a personal alarm so if something happened
to the person they would be able to tell people without using
the phone.
We could do a sound system so the person outside can talk
to the person inside if there is no need to open the door.
Download