Download Project Resources View on Github
Build a simple alert that speaks or chimes when people come within range
Build a simple alert for when people get too close to keep their distance and wash their hands. As the ultrasonic sensor detects the person getting too close, it will use the record and playback module to playback a pre-recorded message. Use it to remind people to wash their hands or as an alert to keep them at a distance.
Qty | Code | Description |
---|---|---|
1 | XC4410 | UNO board |
1 | XC4605 | record and playback module |
1 | WC6028 | plug to socket jumper wires |
1 | PH9251 | battery snap 9V |
1 | XC4442 | ultrasonic sensor |
1 | AS3006 | speaker 1W round |
1 | SB2423 | 9V battery eclipse |
The speaker is easy to hook up, just get two lengths of wire with an adequate amount of exposed wire on each end, and loop it through the two hoops on the speaker. If you are comfortable with soldering, you can solder them in place so that they don't fall out. Here we used some prototyping wires we had lying around.
Next up, attach it into the module; there's no polarity with this, just one wire goes to one screw terminal, and the other wire goes into the other.
Make sure that the stray ends of your wire don't cross over. If you want, an easy way to make a connection is via using PT4433 to tidy up the wires and attach them into the terminals, but that's not needed for now.
The schematic diagram is something like this:
UNO pin | Connection | Description |
---|---|---|
A0 | PLAYE on playback module |
triggers the playback |
A1 | ECHO on ultrasonic |
receives sonar |
A2 | TRIG on ultrasonic |
sends sonar |
This becomes a pretty easy connection to do. If you have a look at the front of the ultrasonic sensor, you should find which one is which:
You can use the plug-socket jumper leads to connect between the playback module, Uno, and ultrasonic sensor, while also connecting GND
and VCC
pins.
the ultrasonic can be connected to VIN
pin with no issue. This pin has 7v from the 9v battery connection.
Hook it up to power so it turns on, then hold the record button on the playback module so you can record a short message.
After recording the message, wave your hand infront of the ultrasonic sensor. you should find that when something passes the ultrasonic sensor, it will play back your message automatically.
Problem | Possible cause |
---|---|
It keeps playing back the message | This could be caused by a few things:\ |
either the REPEAT switch is kept on, \ |
|
or the ultrasonic sensor is not detecting correctly. \ | |
if changing the REPEAT switch doesn't fix it, have a \ |
|
look at the Serial monitor for what the ultrasonic is doing | |
It's not detecting movement | Definitely check the serial monitor |