Introduction: The Manual Radar
The Manual Radar is a simple machine spins on a motor and test distances. It give you an output of the distance to the nearest obstacle from the pointed direction. It uses an LCD to show the numbers. Lets get into the making of the machine.
Well, first get the materials. Materials include:
- 1 arduino uno
- 1 USB cable
- Jumper Wires
- 1 Ultrasonic sensor
- 1 LCD with I2C module
- 3 Buttons
- 3 220Ω resisters
Step 1: Step 1: Connecting the Wires
There are quite a few wires that will be needed to connect. Lets start with the buttons. The 5 vaults (positive) pin is connected to the button. The other side of the button you connect it to your D-Pin and a 220Ω resister that is then connected to GND (negative). Repeat that three times and the wires for the buttons are done. I connected the three buttons to D7, D8 and D9. Second, the ultrasonic sensor. The ultrasonic sensor has 4 pins, VCC, GND, trigpin and echopin. Connect the VCC to 5V (positive) and GND to GND (negative). Then connected the trigpin to D2 and echopin to D3. Third is the servo motor. Depending on the colours of the servo, the wiring may vary. For instance mine has orange, yellow and brown. Brown being the GND, yellow being the VCC and orange being the signal wire. The signal wire is connectted to D10. Finally, the LCD. The diagram above is incorrect due to the fact that they didn't have the I2C module in the program. Instead I just connected the VCC and the GND. On your I2C module, you should see four pins. VCC, GND, SDA and SCL. SDA is connected to A4 and SDA is connected to A5.
Step 2: Step 2: the Code
I'm gonna put a link to the code. It has explanations in it. Remember to install the LCD I2C library This is how the code works. It first has an if to see if the middle button is pressed. The middle button is the button that activates the ultrasonic sensor and outputs the distance. If the middle button is not pressed, it proceeds to check if the buttons on the left or the right is pressed. Those two buttons are the rotating buttons. For more detail check out the code.
Step 3: Step 3: the Outside
Now its time to make the box. Follow the photo on top. Cut three round holes for the buttons on the top. Then cut a rectangular shape for the LCD. Finally can a square do that the ultrasonic sensor can peak out.