Skip to content
Advertisements

Waterproof ultrasonic module JSN SR-04T to measure distance with Arduino

 

        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.

JSN SR04T_probe.jpg
Waterproof probe

    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:

Data.png

For this project we gonna need: Arduino UNO board, LCD i²c screen and the JSN SR-04T

Wiring:

Wiring.png

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.

Libraries:

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

Codes:

    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.

Tests:

     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.

Serial check.png
The measures were stable without the library
LCD check 2.png
Module still working fine after a swim
LCD check 3.png
While measuring underwater I always get this value, in air it changes but in water not

 

Advertisements

Yassine View All

Electronics, Automation engineering student... I try to share my little experience with other electronics amateur.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: