So, this is my second project and after so many views on the first one. I was really filled with enthusiasm and made this one. Hope you like it.
Here, we make an obstruction sensor using the ultrasonic sensor module(HC-SR04) and connecting it via bluetooth(HC-05 wireless UART module) and showing the result on an android app which I made using mit app inventor.
The ConnectionsNow, let us come to the connections part. It's quite easy!
So, the HC-SRo4 ultrasonic sensor module has 4 pins i.e., VCC, Trig, Echo and GND pins.
My connections are as follows(with Arduino UNO):
VCC- 3.3V
Trig- Pin 7
Echo- Pin 8
GND- GND
Remember you can always change your pin on the Arduino board according to your requirements.
And, Secondly, the connections to your bluetooth module. I have used HC-05. If you have a different one, you have to use accordingly.
NOTE-theHC-05modulehas6pinsbutonly4 will be used i.e., EN and STATE pinswillnotbeused.
My connections with the bluetooth module are as follows:
VCC-5V
GND-GND
RX - TX(RX of the module should always be connected to the TX pin on board)
TX - RX(TX of the module should always be connected to the RX pin on board)
So, connections are done here.
Explanation for the codeThere is nothing much to explain about the code. But I'll say how it works.
So,
I used two modules in this project. One for the HC-SR04(Ultrasonic Sensor) and the other for HC-05(Bluetooth module).
Those are HCSR04, download it here and SoftwareSerial, which is already included in the IDE. Or if you are using the web editor Eureka You don't have to download any!!!!
And, also there is nothing much to explain about the app. It is plain and simple and you can make it easily:) I will advise you to do so... because everyone have their own preferences and mit appinventor makes it very easy. Also, there are many tutorials on youtube.
Comments
Please log in or sign up to comment.