mvrk33 / AgroBot

5 stars 1 forks source link

Ultrasonic Sensor study and integration #1

Open mvrk33 opened 5 months ago

mvrk33 commented 5 months ago
snehakalakonda03 commented 5 months ago

HCSR04-Ultrasonic.pdf lidar functionality picture image LIDAR is often a good choice for applications that need high precision and a greater range, but ultrasonic sensors are better suited for applications that need quick reaction times and are price sensitive. So, we are considering ultrasonic sensor for our model.

INTERFACING OF ULTRASONIC SENSOR TO RASPBERRY PI 4:

HARDWARE SETUP:

Connect the Ultrasonic Sensor:

Ultrasonic sensors typically have four pins: VCC, GND, Trig (trigger), and Echo. Connect them as follows: Connect the VCC pin to a 5V GPIO pin on the Raspberry Pi for power. Connect the GND pin to a ground GPIO pin on the Raspberry Pi. Connect the Trig pin to a GPIO pin on the Raspberry Pi (used for triggering the ultrasonic pulse). Connect the Echo pin to another GPIO pin on the Raspberry Pi (used for receiving the echo signal).

GVTGOPI commented 4 months ago

RADAR Sensor https://www.elprocus.com/radar-sensor/

snehakalakonda03 commented 3 months ago

INTERFACING OF HC-SR04 TO ARDUINO FOR DISTANCE MEASUREMENT: const int trigPin=5; const int echoPin=6; long duration; int distance; void setup() { pinMode(trigPin,OUTPUT); pinMode(echoPin,INPUT); Serial.begin(9600); } void loop() { digitalWrite(trigPin,LOW); delayMicroseconds(2); digitalWrite(trigPin,HIGH); delayMicroseconds(10); digitalWrite(trigPin,LOW); duration=pulseIn(echoPin,HIGH); distance=duration*0.034/2; if(distance<400) { Serial.print("Distance:"); Serial.print(distance); Serial.println("cm"); } delay(2000); } OUTPUT: Distance:3cm Distance:7cm Distance:10cm Distance:13cm Distance:20cm Distance:23cm Distance:28cm Distance:54cm Distance:112cm