I need help, ESP8266 + HC-SR04 + Relay

Hello everybody,
I want to make an automatic water pump system. But I do not understand how it works. Can you give me advice or samples for reference?
The circuit I have:

  • NodeMCU ESP8266 CP2102

  • Ultrasonic HC-SR04

  • Relay (Low level trigger)

  • DHT11

  • Oled SPI 0.96inch

    I want a system that can monitor and control over the network.

  • Ex: When the water level down = <100cm, Relay works.
    When the water level is up to <5, Relay stops working

  • If possible, add a button in Blynk to activate Relay when the water level is 120cm and turn off automatically when level = <5.

  • If possible, use temperature sensors and oled screens.

Sincerely thank you

Is this system already working and you want to add BLYNK? Or are you starting from scratch?

I would start by doing things individually, then work on putting them together as one. Maybe start with some simple examples from the sketch builder, and expand from there. Once you are familiar with the way BLYNK functions, and the special structure of the code (using BlynkTimer), try getting a bit more complex.

What you are trying to accomplish is not that difficult. You may even find what you are looking for by searching this forum, and combing bits of code.

1 Like

I started from scratch.
I used the search function of the forum with different keywords, to search for the sample. But I still have not found a sample. So I created a new topic.

  • Do you have any suggestions for me?

IF you dont have any experience with BLYNK, then I would set your project aside and start with some reading. Go through the DOCS and familiarize yourself with BLYNK. Then do a couple of the simple examples (blink an LED, etc.). Once you are comfortable with the simple stuff, try something a bit harder. You have to crawl before you walk.

You can find examples of code for all the sensors you listed online. Although they will not necessarily be BLYNK compatible. That is where your reading and tinkering will come in. If you are familiar with the BLYNK structure of code, you will be able to spot what is needed to make it BLYNK compatible (usually just removing code from the loop() and putting it into a BlynkTimer routine).

Also, make sure you have ALL the proper libraries installed for BLYNK and your components.

3 Likes

Thank you @Toro_Blanco for the great comments

Can you help me delete this article? It is occupying resources that do not help anyone.

  • Maybe in the future, I will need your help

No need to delete this topic… every reference will have some purpose for someone and there is plenty of room in the digital closet :wink:

1 Like