STC12C2052 and LCD1602 liquid crystal display those things (3)


1. Introduction

  This article is basically the same as the previous STC12C2052 and LCD1602 liquid crystal display (2) . The only difference is that the Hall sensor is replaced by a soil sensor. The principle is the same, no modification is required, just Unplug the Hall sensor and replace it with a soil moisture meter sensor.
Soil moisture sensor

2. Hardware preparation

  For specific details, see the first article on STC12C2052 and LCD1602 LCD screens .

New module: soil moisture meter detection sensor

Soil moisture meter detection module
Wiring instructions:
Insert picture description here

  • The blue potentiometer in this module is used to adjust the threshold of soil moisture. It is adjusted clockwise, and the controlled humidity will be larger, and counterclockwise will be smaller.
  • When the humidity is lower than the set value, D0 outputs high level, when the humidity is higher than the set value, D0 outputs low level,
  • The digital output D0 can be directly connected to the single-chip microcomputer, and the high and low levels are detected by the single-chip microcomputer, thereby detecting the soil moisture.
  • The analog output A0 can be connected to the A/D module, and through A/D conversion, a more accurate value of soil moisture can be obtained.

Three, software preparation

  Compared with the previous article, there is no change.


Experimental results:

  When it is dry, the highest value is 255.
When dry
  With continuous watering, the humidity keeps increasing, and the AD value keeps decreasing.
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41071754/article/details/115253758