Hello, this tutorial is about measuring distance in « cm » and « inches », using an ultrasonic module, it’s called JSN SR-04 T, similar to the famous HC-SR04, but this one has a waterproof probe, and we will wire it with Arduino Uno board and LCD i2c screen.
This module is handy if you want to use it to measure something outdoor like parking sensor, an embbeded distance measure device that can handle tough environment, or supervising water level in a fish tank…
Here are few information about the module from its datasheet:
For this project we gonna need: Arduino UNO board, LCD i²c screen and the JSN SR-04T
That’s pretty much the wiring both modules are wired with GND and 5V, Trigger and Echo pins are with D11 and D12, then the SDA and SCL are with A4 and A5, in the video you’ll see that the Vcc of the LCD is wired with A0, it’s because I didn’t want to use a breadboard so I put A0 as a HIGH OUTPUT which provides 5V.
For most ultrasonic module we usually use the NewPing library but as you can see it doesn’t work well with the module but you can try it: Download here
LCD i²c NewLiquidCrystal library: Download here
If you download the NewPing library you can try the « NewPingExample »
Otherwise here are the 4 codes I’ve worked with, you’ll find measuring in metric and imperial with both Serial monitor and LCD: Download here
If you want to try to measure underwater here’s a code with a few modification, check to video for more informations: Download here
N.B: In the video tutorial I wired the A0 with LCD Vcc but in the codes above I removed those two lines, you can add them back if you want.
The module works pretty fine, but for close up measures it won’t be good and it’s better to use the HC SR04T, but this one has a waterproof, so it depends on your project.
Electronics, Automation engineering student... I try to share my little experience with other electronics amateur.