Whether it's an ultrasonic sensor or an LSR, they can both be expensive. However, using this very cheap and easy design of a sensor, you can do what a sensor can do but with very few materials.
Step 1: Step 1: Materials
- 1 Arduino Leonardo board
- 1 breadboard
- 8 wires
- 1 speaker
- 1 LED light (optional color)
- 1 resistor
- cardboard (size depends on your Arduino board and breadboard)
Step 2: Step 2: Circuit
Follow this instruction to plug in the circuits for the speaker and the LED light. Plug a wire in analog 5 (A5), the other end of the wire does not need to attach to anything but make sure it is straight and it is far away from the circuit. That wire is your sensor.
Step 3: Step 3: Code
Download the attached file for the code. Explanation of the code is provided in the file. You can change the code to suit your need.
Step 4: Step 4: Decoration
This is totally optional and I didn't add a lot of decoration. One important thing to keep in mind is that anything you put on top of the circuit and the board cannot interfere with the sensor or else the sensor wouldn't work. Just keep any decoration away from the sensor until the sensor won't sense it.