Sensor value jumps about, or stays at 0 or 1023
- LDR
- Soil sensor
- Gas sensor
- Potentiometer
- LM35
Why it happens
- The wire is on another analog pin, or loose.
- An LDR has no second resistor to make a divider.
- The sensor isn't powered, or VCC and GND are swapped.
How to fix it
- Check the pin: A0 in the code, A0 on the board.
- LDR: one leg to 5V, the other to A0 and to a 10 kΩ resistor to GND.
- Print the value with
Serial.println(analogRead(A0));and change only the sensor. - Average ten readings if it only flickers a little.
It worked if: Cover, wet or turn the sensor: the number moves smoothly one way.
Related errors
Tutorials where it can happen
- Reading Analog Input with Arduino
- 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
- Aquarium Water Quality Monitor with Arduino
- Arduino Breathalyzer with MQ-3 Alcohol Sensor and LCD
50 more
- Automated Plant Watering System with LCD Feedback
- Automatic Blinds Control Based On Light Intensity
- Automatic LED Light with Arduino and LDR
- Automatic Plant Grow Light with Arduino and Relay
- Building a Knock Sensor-Based Doorbell with LCD Display Using Arduino
- 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 a Vibration Sensor with LCD Feedback
- Building an Automated Plant Watering System using ESP32
- Building Electronics Dice with LCD Display
- CO Sensor-Based Ventilation Control System with LCD Output
- DIY Heart Rate Monitor with Pulse Sensor and LCD Display
- 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
- Gesture-Controlled Light with Arduino and Ultrasonic Sensor
- Hall Effect Sensor with Arduino: Measure Magnetic Field
- Heart Rate-Based Fitness Tracker with LCD Feedback
- Home Energy Monitor with Arduino
- Home Hydroponics System with Arduino
- How to Make a Smart Energy Meter with Arduino and LCD
- How to Read Analog Signals with the ESP32?
- LDR Light Meter with Arduino and LCD
- LED Bar Graph with Arduino
- Light Sensitive Blinds Control System with LCD Output
- Light-Sensitive Motorized Blinds with Arduino and LCD
- Light-Sensitive Plant Growth System with LCD Display
- Line Following Robot with LCD Display
- LM35 Temperature Sensor with Arduino
- Object Detection and Sorting System Using IR Sensors with LCD Feedback
- pH Level Monitoring and LCD Output with Arduino
- Plant Monitoring System with Arduino: Soil Moisture and DHT22
- Raindrop Detection and Automatic Wiper Control with LCD Output
- Real-Time Power Usage Monitor with Arduino
- Smart Blinds Control Based on Weather Conditions with LCD Feedback
- Smart Plant Pot with ESP32 (IoT)
- 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
- Soil pH Level Monitoring and LCD Output
- Solar Power Monitor with Arduino and LCD
- Sound Level Meter with Arduino and LCD
- Sound-Activated LED Light Control with LCD Display
- Task Automation with Simple Timer using the ESP32
- Temperature-Controlled Fan with Arduino and LM35
- UV Light Intensity Measurement and LCD Output
- Water Turbidity Measurement and LCD Output
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.

