The Arduino Uno
But first I had to install the Arduino onto the PC. This just involved downloading directly from the Arduino website. The only glitch was I had to install the driver software manually. This just involved going into the security file and device manager and update the driver software. Once that was up and running, you simply initialised the Arduino program, chose the board you were using from the drop down menu, the Arduino Uno, and selected the correct serial port.
First test I simulated was a simple blinking light using a LED. I expanded this using other LEDs to simulate traffic lights and a night rider simulation. I then introduced a tactile switch to use as a button to control a LED. I also used a potentiometer to adjust the brightness of a LED. These were all basic test that can be found on the Arduino website. Once I had a grasp of the board I moved on to the Ultrasonic.
The Ultrasonic Sensor
I had a fair understanding of the Ultrasonic sensor and had even tried to start writing the code before I had the part, so it wasn't long before I was able to use this.
Connecting the Arduino to the Sensor involved only 3 pins. Vcc, Gnd and a pin to control the sensor, I used pin 13. Basically, I initially used the pin as an output to make the sensor send out a pulse for 10ms then stop. I then changed the pin to an input to wait for the Sensors reply.
The sensor sends this pulse then waits for it to be reflected off the nearest obstruction and return. When the signals echo is returned, the Sensor sends this information back to the pin on the Arduino. The Arduino times the amount of time it takes for the signal to return. Then using the following calculation, I was able to determine the distance the obstruction was from the sensor.
![]() |
| Formula calculating time for 1cm |
I was able to display these results on the serial monitor of the Arduino's IDE. I then added LEDs into this design to simulate some kind of warning system. As the obstruction moved closer, the green LED was for okay, orange for warning and red for collision inevitable for simulation purposes.
![]() |
| Arduino including the Sensor |
![]() |
| Serial Monitor distance display |
![]() |
| Ultrasonic Sensor |
Next up, was the Shiftbrite and LCD unit.




No comments:
Post a Comment