I’m playing with this sensor for a few weeks now, but I can’t get it to work properly. I’ve checked the connections and tried various configurations. The best I could achieve is some measurements interspersed with timeouts.
The configuration is in mode 1, powered at 5 volts with an ESP8266 OLED. I’m attaching :
Photo of the schematic
Logs
Configuration
Sensor datasheet in mode
- platform: ultrasonic
trigger_pin: GPIO15
echo_pin: GPIO13
name: "Livello Tanica"
id: livello_tanica
# pulse_time: 15 us
# update_interval: 5s
unit_of_measurement: "cm"
accuracy_decimals: 1
timeout: 30m # Aumenta il timeout a 20 metri
filters:
- filter_out: nan
LOG:
[12:04:45][D][ultrasonic.sensor:040]: 'Livello Tanica' - Got distance: 8.153 m
[12:04:45][D][sensor:093]: 'Livello Tanica': Sending state 8.15294 cm with 1 decimals of accuracy
…..
[12:05:45][D][ultrasonic.sensor:036]: 'Livello Tanica' - Distance measurement timed out!
[12:05:45][W][component:237]: Component ultrasonic.sensor took a long time for an operation (179 ms).
Also, don’t use GPIO15 if you have others available, it has pulldown resistor and it’s strapping pin.
And finally, if you power that sensor at 5V, you need level shifters for esp trigger and echo pins.
[12:26:09][D][dht:048]: Got Temperature=28.0°C Humidity=31.0%
[12:26:09][D][sensor:093]: 'Temperatura': Sending state 28.00000 °C with 1 decimals of accuracy
[12:26:09][D][sensor:093]: 'Umidità': Sending state 31.00000 % with 0 decimals of accuracy
[12:26:11][D][ultrasonic.sensor:040]: 'Livello Tanica' - Got distance: 3.772 m
[12:26:11][D][sensor:093]: 'Livello Tanica': Sending state 3.77231 m with 2 decimals of accuracy
[12:26:12][D][hx711:031]: 'Peso GPL': Got value 987
captive_portal:
uart: #per sensore ultrasuoni
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600
i2c:
sda: D6
scl: D5
scan: true
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
address: 0x3C
update_interval: 5s # Riduce la frequenza di aggiornamento
lambda: |-
// it.fill(0); // Pulisce il display prima di ogni aggiornamento
it.print(0, 0, id(font1), "GPL Zanzare");
it.printf(0, 12, id(font1), "Temp: %.1f C", id(temperatura).state);
it.printf(0, 24, id(font1), "Umidita: %.1f %%", id(umidita).state);
it.printf(0, 36, id(font1), "Livello: %.1f cm", id(livello_tanica).state);
it.printf(0, 48, id(font1), "Peso GPL: %.2f kg", id(peso_gpl).state);
font:
- file: 'fonts/arial-black.ttf'
id: font1
size: 10
sensor:
- platform: dht
pin: GPIO16
temperature:
name: "Temperatura"
id: temperatura
humidity:
name: "Umidità"
id: umidita
update_interval: 10s
model: DHT11
# - platform: ultrasonic
# trigger_pin: GPIO15
# echo_pin: GPIO13
# name: "Livello Tanica"
# id: livello_tanica
# pulse_time: 10us # Impulso più breve per migliorare la precisione
# update_interval: 5s # Aumenta l'intervallo di aggiornamento per ridurre l'impatto sulle prestazioni
# unit_of_measurement: "m" # Assicurati che l'unità sia correttamente impostata su "cm"
# accuracy_decimals: 2
# timeout: 1m # Riduci il timeout a 4 metri
# filters:
# - filter_out: nan # Filtra le letture non valide
# on_value: # anche se unita è messa in cm il sensore mi da in metri quindi aggiusto con questo codice
# then:
# - lambda: |-
# id(livello_tanica).publish_state(x * 100);
- platform: "jsn_sr04t"
name: "Livello Tanica"
id: livello_tanica
update_interval: 1s
unit_of_measurement: "cm"
accuracy_decimals: 2
- platform: hx711
name: "Peso GPL"
id: peso_gpl
dout_pin: D2
clk_pin: D1
# gain: 128
update_interval: 5s
filters:
- calibrate_linear: # Aggiusta il moltiplicatore in base alla calibrazione
- -212990 -> 0 # massa nota 0kg mi da xxx
- -166431 -> 2 # massa nota 2kg mi da xxx
#binary_sensor:
# - platform: gpio
# pin:
# number: GPIO9
# mode: INPUT_PULLUP
# name: "Pioggia Rilevata"
# device_class: moisture
switch:
- platform: gpio
pin: GPIO0
name: "Pompa Antizanzare"
id: relay_pompa
# - platform: gpio
# pin: GPIO11
# name: "Scorta"
# id: relay_scorta
measure true:
accuracy
[16:15:54][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:54][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:55][D][sensor:093]: 'Livello Tanica': Sending state 0.31200 cm with 2 decimals of accuracy
[16:15:55][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:55][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:55][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:55][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:55][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:55][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:55][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:55][D][sensor:093]: 'Livello Tanica': Sending state 0.31200 cm with 2 decimals of accuracy
[16:15:56][D][hx711:031]: 'Peso GPL': Got value 969
[16:15:56][D][sensor:093]: 'Peso GPL': Sending state 9.19088 with 0 decimals of accuracy
[16:15:56][D][sensor:093]: 'Livello Tanica': Sending state 0.31200 cm with 2 decimals of accuracy
[16:15:56][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:56][D][sensor:093]: 'Livello Tanica': Sending state 0.31200 cm with 2 decimals of accuracy
[16:15:56][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:56][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:56][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:56][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:56][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:56][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:57][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:57][W][component:237]: Component display took a long time for an operation (317 ms).
[16:15:57][W][component:238]: Components should block for at most 30 ms.
[16:15:57][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:57][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:57][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
[16:15:57][D][sensor:093]: 'Livello Tanica': Sending state 0.32700 cm with 2 decimals of accuracy
NOW I HAVE OTHER ISSUE, In the tank 10 lt i have this error, i think wave go arround wall of tank :
[16:14:48][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:50][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:48][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:49][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
[16:14:50][W][jsn_sr04t.sensor:051]: Invalid data read from sensor: FF.00.DF.DE
Complete Summary of the Mosquito Misting Project with Temperature, Humidity Logic, and Alternative Natural Recipes
This project involves creating an automated misting system for mosquito control, combining monthly chemical treatments with daily natural repellent solutions. The system uses a 12V pump, 12 misting nozzles, and is optimized to maximize effectiveness by considering environmental temperature and humidity variables.
Main Components
12V Diaphragm Pump (5 L/min):
Capacity of 5 liters per minute, controlled via a relay connected to an ESP8266 for automatic activation. Ensures adequate pressure for 12 nozzles along a 30-meter pipe.
Brass Misting Nozzles (0.3 mm):
12 nozzles distributed along the pipe to ensure uniform misting of the solution throughout the area.
ESP8266 with ESPHome:
Manages the automated scheduling of the system, monitors sensors for tank level, temperature, and humidity, and controls the pump activation.
Integrated Sensors:
Ultrasonic Level Sensor (JSN-SR04T): Monitors the liquid level in the tank.
DHT11 Sensor: Monitors ambient temperature and humidity.
Weight Sensor (HX711): Checks the weight of the LPG cylinder or tank.
Mosquito Treatment Solutions:
Monthly Treatment with DEADYNA (Pyrethroid Insecticide).
Daily Treatment with Natural Repellent Solution.
Preparation of the Solutions
Monthly Treatment with DEADYNA
Recommended Dilution: 10 ml of DEADYNA per liter of water.
Solution Preparation:
Measure 100 ml of DEADYNA.
Mix with 10 liters of water in a tank.
Ensure thorough mixing for a uniform solution.
Application Quantity: The prepared solution (10 liters) is sufficient to cover an area of 150 m² (10 liters x 15 m² per liter).
Daily Treatment with Natural Solution
Ingredients for 10 Liters:
10 drops of bergamot essential oil.
120 ml (1/2 cup) of apple cider vinegar.
10 liters of water.
Preparation:
Mix the ingredients in a container, ensuring they are well blended.
Pour the mixture into the tank of the misting system.
Alternative Natural Recipes
Solution Based on Citronella Essential Oil and Apple Cider Vinegar
Ingredients:
10 drops of citronella essential oil.
120 ml (1/2 cup) of apple cider vinegar.
10 liters of water.
Preparation:
Mix citronella oil with apple cider vinegar.
Add 10 liters of water and mix well.
Pour the solution into the misting system’s tank.
Benefits: Citronella is a very effective natural mosquito repellent.
Solution Based on Eucalyptus Oil and Neem Oil
Ingredients:
10 drops of eucalyptus essential oil.
5 ml (1 teaspoon) of neem oil.
120 ml (1/2 cup) of apple cider vinegar.
10 liters of water.
Preparation:
Mix the essential oils with apple cider vinegar.
Add 10 liters of water and mix well.
Pour the solution into the misting system’s tank.
Benefits: Eucalyptus and neem offer a dual repellent and insecticidal action.
Solution Based on Lavender Oil and Peppermint Oil
Ingredients:
10 drops of lavender essential oil.
10 drops of peppermint essential oil.
120 ml (1/2 cup) of apple cider vinegar.
10 liters of water.
Preparation:
Combine the essential oils with apple cider vinegar.
Add 10 liters of water and mix well.
Pour the solution into the misting system’s tank.
Benefits: Pleasant for the human environment but repellent to mosquitoes.
Usage Calendars
Monthly Treatment Calendar with DEADYNA
Frequency: Once a month.
Recommended Time:Night, around 11 PM.
Misting Duration:1-2 minutes.
With 10 liters of solution and a flow rate of 5 liters/min, mist for up to 2 minutes to cover the 30 m² area.
Precautions: Ensure the area is clear of people and animals and follow the manufacturer’s safety instructions regarding re-entry time.
Daily Treatment Calendar with Natural Solution
Frequency: Twice a day.
Recommended Times:
Early Morning: Mist at 6-7 AM for 2 minutes.
Late Afternoon/Evening: Mist at 6-7 PM for 2 minutes.
Misting Duration: Each misting cycle should last 2 minutes, using about 10 liters of solution to cover the area.
Control Logic Based on Temperature and Humidity
Temperature:
Activate Misting Between 20°C and 30°C: Mosquitoes are most active within this temperature range. Avoid misting below 15°C or above 35°C, when mosquitoes are less active or absent.
Humidity:
Keep Humidity at a Moderate Range: If humidity is too low (below 40%), evaporation is rapid, and misting effectiveness decreases. If humidity is too high (above 70-80%), the dispersion of mist particles is less effective.
Combined Automation:
Set up automations in Home Assistant to activate misting only when the temperature is between 20°C and 30°C and humidity is between 40% and 70%, during daytime hours (6 AM - 9 PM).
Additional Tips
Maintenance: Regularly clean the nozzles and tank to avoid clogging.
Safety: Wear protective gear when preparing and using DEADYNA.
Monitoring: Periodically assess the effectiveness of the strategies and adjust misting parameters based on environmental conditions and mosquito density.
Conclusion
This summary integrates both chemical and natural misting strategies, optimized for effectiveness based on temperature and humidity. The use of different natural recipes offers alternatives for mosquito control, while automation based on environmental conditions ensures a sustainable and targeted approach to pest control.