This tutorial shows how to make a simple door prank using an Arduino board and 1Sheeld. All you need to make this prank: Arduino board, Android phone, Ultrasonic sensor. Feel free to ask any questions in the comments and I'll answer them as best I can. Video below shows the final result:
- Arduino Uno or Mega.
- Ultrasonic sensor hc-sr04
- Android Phone (or IOS).
- 3 x Connection Wires.
- 1 x Breadboard.
- The Arduino IDE which you can download here.
- Get the 1Sheeld Arduino library and the phone app here.
- Mount the 1Sheeld on the Arduino board
- Make sure the power switch shown above is turned to 5V (for Arduino UNO users) if you're using another Arduino board check here.
- Connect the ultrasonic sensor and the wires as shown in the figure.
Simply, the code opens the mp3 file that is selected from the media player sheeld in the 1Sheeld app and that happens only when any object is 25 cm or less in front of the ultrasonic sensor (you can change the distance as you like).
Upload the attached code and lets move to the next step.
Use your 1Sheeld Mobile App (Media Player Shield) to get the signal from the ultrasonic sensor to open the mp3 file.
PS: make sure the 1sheeld is in upload mode as seen in the image above.
After connecting all components as shown. Connect the Arduino to your laptop and make sure the code is uploaded. Switch the 1Sheeld back to operating mode. Open your 1Sheeld app and connect your phone to your 1Sheeld board. (Check 1Sheeld tutorial here if you haven't already).
Select Media Player Shield, and press on the multiple shields icon at the top right of the app. Now, put your circuit and your mobile phone in a hidden place and enjoy your prank. Feel free to ask any questions in the comments and I'll answer them as best I can.