Reading Water Level Sensor Data with Arduino

Reading Water Level Sensor Data with Arduino

Limited Time Download: Reply “Tutorial” to get the microcontroller e-book, reply Simulation to get Proteus simulation materials, Baido cloud group share link update time: 2016-04-8, if expired, please leave a message at the end of the article, do not leave a message in the background, if there are no files, please privately chat with the group owner of the Baido group you joined, for some reason, sometimes shared files will be canceled by Baido!

First of all, this is a very simple small experiment, which is a small part of the project I am currently working on, but I still hope to share it, looking forward to seeing colleagues or enthusiasts communicate or critique with me.

The water level sensor I used is this, link: http://dwz.cn/5K0UTN Reading Water Level Sensor Data with Arduino

It is relatively cheap, one dollar each, but being cheap also has its shortcomings, because the measurement range is too small. I measured it with a ruler, and the deepest can only measure 4cm. However, it is small in size and lightweight, and can be DIY and customized according to needs, making it quite flexible to use. Let’s talk about the wiring. The water level sensor has three universal connections, one connected to VCC, one connected to GND, and the analog output terminal connected to any analog input port of the Arduino. I used the A0 port, as shown in the figure below:Reading Water Level Sensor Data with Arduino The code is as follows:

double temp, data;

void setup() {

// put your setup code here, to run once:

Serial.begin(9600);

}

void loop() {

// put your main code here, to run repeatedly:

temp=(long)analogRead(0);

data=(temp/650)*4;

Serial.print(“the depth is:”);

Serial.print(data);

Serial.println(“cm”);

delay(1000);

}

Insert the parallel wires of the sensor vertically into the water surface, as shown in the figure

Reading Water Level Sensor Data with Arduino You can see the following data in the serial monitor:Reading Water Level Sensor Data with Arduino

Source: http://blog.csdn.net/song527730241/article/details/50897997 Click to read the original article to enter the author’s blog

Limited Time Download: Reply “Tutorial” to get the microcontroller e-book, reply “Simulation” to get Proteus simulation materials.

> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

How to Share to Moments

Click the three dots in the upper right corner, and select “Share to Moments” from the pop-up menu

Microcontroller Subscription Account

WeChat Name: Microcontroller updates various knowledge about microcontrollers every day, electronic DIY production, and the latest news in the electronics industry, follow us, awesome!Reading Water Level Sensor Data with Arduino

Recommended Popular Articles

Reply with the numbers below or click directly to get related articles:

001:Must-Read for Microcontroller Beginners

002:Words from Zhou Ligong to Young People Learning Microcontrollers

003:Experts Discuss: The Difficulty of Getting Started with Software and Hardware and the Span of Mastery Time

004:Feelings on Learning the 51 Microcontroller; Recommended Learning Materials; Several Must-Written Programs

005:Comparison of Several Microcontrollers Used

006: “ARM+LINUX Learning Route (Learning Order, Knowledge Points, and Book Recommendations)

007:Differences and Connections between ARM/DSP/FPGA/CPLD/SOPC/SOC

008:Interesting Electronic Production: Food Power Generation in the Hands of Artists – Electronic DIY

009:My Experience: From a Production Line Worker to a Microcontroller Engineer

010:A Friend Brought Back a Toolbox from Germany for 200,000

Click the lower left corner “Read the Original“, to enterForum Communication!!!

Leave a Comment

×