The project switches at the wrong time, or never
- LDR
- Soil sensor
- Gas sensor
- Sound sensor
- IR
Why it happens
- Each sensor and room gives different numbers.
- Some modules give a low number when wet or dark, others a high one.
How to fix it
- Print the sensor's number in the Serial Monitor.
- Write down the number for dry and for wet (or dark and bright).
- Use a number halfway between in the code.
- If it works backwards, swap
<and>. - On modules with a blue screw, the screw sets only the digital (D0) output.
It worked if: It switches at the right moment three times in a row.
Related errors
Tutorials where it can happen
- Air Quality and HVAC Control with Arduino, DHT11 and MQ-135
- Air Quality Monitor with Arduino, MQ-135 and LCD
- Alcohol Sensor MQ-3 with Arduino and LCD
- Arduino Breathalyzer with MQ-3 Alcohol Sensor and LCD
- Automated Plant Watering System with LCD Feedback
- Automatic Blinds Control Based On Light Intensity
29 more
- Automatic LED Light with Arduino and LDR
- Automatic Pet Feeder with Arduino and Servo
- Automatic Plant Grow Light with Arduino and Relay
- Building a Smart Plant Watering System with Soil Moisture Sensor
- Building a Sound-Activated Alarm System with LCD Display
- Building a Sound-Activated Music Player with LCD Display
- Building an Automated Plant Watering System using ESP32
- CO Sensor-Based Ventilation Control System with LCD Output
- Creating a Touchless Hand Sanitizer Dispenser with LCD Display
- Gas Leakage Detection and Solenoid Valve Control with Arduino
- Gas Sensor-Based Air Freshener System with LCD Display
- Gas Sensor-Based Garage Ventilation Control with LCD Display
- Gas Sensor-Based Smart Gas Meter with LCD Display
- LDR Light Meter with Arduino and LCD
- Light Sensitive Blinds Control System with LCD Output
- Light-Sensitive Motorized Blinds with Arduino and LCD
- Light-Sensitive Plant Growth System with LCD Display
- Object Detection and Sorting System Using IR Sensors with LCD Feedback
- Plant Monitoring System with Arduino: Soil Moisture and DHT22
- Smart Blinds Control Based on Weather Conditions with LCD Feedback
- Smart Plant Pot with ESP32 (IoT)
- Smart Traffic Light System with Arduino
- Smoke Detection and Exhaust Fan Control with LCD Display
- Smoke Detection and Fire Sprinkler Control with LCD Display
- Soil Moisture Monitoring and Irrigation System with Arduino Uno
- Soil Moisture Sensor for Farming with Arduino
- Soil Moisture-Based Plant Watering System with LCD Feedback
- Sound Level Meter with Arduino and LCD
- Sound-Activated LED Light Control with LCD Display
From how the part works. Explained from how the part works; not tried on a real circuit for this page.
Didn't help? Search another error or ask us.

