All you need to make this prank: Arduino board, Android phone, and an ultrasonic sensor.
The video below shows the final result:
Step 1: What You NeedHardware:
- Arduino Uno or Mega.
- 1Sheeld
- Ultrasonic sensor HC-SR04
- Android phone (or iOS)
- 3 x Connection wires
- 1 x Breadboard
Software:
- The Arduino IDE which you can download here
- Get the 1Sheeld Arduino library and the phone app here
PS: Make sure to go through the 1Sheeld intro tutorial here and how to use 1Sheeld with different Arduino boards here. I will be using Arduino Mega for the rest of the tutorial.
Step 2: Wiring and SetupMount 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.
Step 3: SoftwareSimply, the code opens the mp3 file that is selected from the Media Player Shield 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 let's 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.
Step 4: Putting It All TogetherAfter 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 as I can.
Zowail
Comments