Can you use this to DIY a "fish finder?" Would the 450cm distance limit change in water? That would not be nearly deep enough. The 60* viewing angle would be really wide, for a fish finder.
If possible can you check it under water and please let me know the reading. I have used JSNSR04T sensor and placed in water, the readings is maximum number (782). @@ElectroniClinic
#include // Define pins for ultrasonic sensor const int trigPin = 14; const int echoPin = 12; // Define LCD pins const int rs = 35, en = 34, d4 = 32, d5 = 25, d6 = 26, d7 = 27; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { // Initialize serial communication Serial.begin(9600); // Set up the ultrasonic sensor pins pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); // Set up the LCD number of columns and rows lcd.begin(16, 2); // Print initial message to LCD lcd.print("Distance:"); } void loop() { // Variables for the duration of the ultrasonic pulse and the distance long duration; int distance; // Send a pulse to the trigger pin digitalWrite(trigPin, L); delayMicroseconds(2); digitalWrite(trigPin, H); delayMicroseconds(10); digitalWrite(trigPin, L); // Measure the duration of the echo pulse duration = pulseIn(echoPin, HIGH); // Calculate the distance (in cm) distance = duration * 0.034 / 2; // Print distance to serial monitor Serial.print("Distance: "); Serial.print(distance); Serial.println(" cm"); // Display distance on LCD lcd.setCursor(0, 1); // Set cursor to second line lcd.print(" "); // Clear previous distance lcd.setCursor(0, 1); // Set cursor to second line lcd.print(distance); // Print current distance // Example if-else conditions based on distance if (distance
Great video! I like the comparison and you do a great job with a tutorial❤❤❤
I am glad, you liked it. And thank you for the comment.
Great as always 👍👍👍
Thank you
Thanks for the support.
If this sensor was used inside of a portable water tank and the tank was placed on ground that was not level, how would that effect the reading?
NICE
I am using the code but I am getting an error :"softwareserial does not name a type"
Can you use this to DIY a "fish finder?" Would the 450cm distance limit change in water? That would not be nearly deep enough. The 60* viewing angle would be really wide, for a fish finder.
I didn't check this underwater
If possible can you check it under water and please let me know the reading. I have used JSNSR04T sensor and placed in water, the readings is maximum number (782). @@ElectroniClinic
I use a similar sensor for water tank level measurement. Ultrasonic waves rebounds on water surface.
Very good
Thanks
#include
// Define pins for ultrasonic sensor
const int trigPin = 14;
const int echoPin = 12;
// Define LCD pins
const int rs = 35, en = 34, d4 = 32, d5 = 25, d6 = 26, d7 = 27;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Set up the ultrasonic sensor pins
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
// Set up the LCD number of columns and rows
lcd.begin(16, 2);
// Print initial message to LCD
lcd.print("Distance:");
}
void loop() {
// Variables for the duration of the ultrasonic pulse and the distance
long duration;
int distance;
// Send a pulse to the trigger pin
digitalWrite(trigPin, L);
delayMicroseconds(2);
digitalWrite(trigPin, H);
delayMicroseconds(10);
digitalWrite(trigPin, L);
// Measure the duration of the echo pulse
duration = pulseIn(echoPin, HIGH);
// Calculate the distance (in cm)
distance = duration * 0.034 / 2;
// Print distance to serial monitor
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
// Display distance on LCD
lcd.setCursor(0, 1); // Set cursor to second line
lcd.print(" "); // Clear previous distance
lcd.setCursor(0, 1); // Set cursor to second line
lcd.print(distance); // Print current distance
// Example if-else conditions based on distance
if (distance
👍👍👌👌