Plant_monitor project

How the pin of AO analog was automatically changed into 0 digital, after few seconds.
In mine it doesn’t changed so am I getting analog results.

No, it won’t change .The pin used is A0,we do not use digital 0 pin for LDR as it only produces 1 or 0. The output of LDR is analog as you get it.There might be some error in the video. The output of LDR is analog so if you get the analog values you’re code is correct.

1 Like

Hi @aaaaachinu ,

Please refer to for detailed info regarding your query.
Let me know if this helps.

We use the A0 pin instead of the digital-0 one since it’ll produce 0 or 1 only. The LDR’s output is analog so the results would be analog too. It shouldn’t change. I think there’s some error in the video, I had the same confusion.

Plant monitoring in IoT typically involves using sensors to collect data on various environmental parameters like soil moisture, temperature, humidity, and light levels to ensure optimal growth conditions for plants. Here are some key points to address common problems:

  1. Sensor Calibration: Ensure sensors are calibrated correctly to provide accurate data.
  2. Data Transmission: Use a reliable communication protocol (e.g., MQTT) and ensure a stable internet connection for data transmission.
  3. Power Management: Implement efficient power management solutions to extend sensor and device battery life.
  4. Data Analytics: Employ data analytics to interpret sensor data for decision-making and timely actions.
  5. Alerts and Notifications: Set up alerts to notify users when environmental conditions require attention.

Analog pins typically remain in analog mode unless explicitly changed to digital mode in the code. If your analog pin isn’t automatically changing to digital mode, it’s behaving as expected. To obtain analog readings, you should continue using it as an analog input in your code.

The pin assignment for the LDR will stay unchanged; we are using pin A0 rather than opting for digital pin 0, which is limited to producing binary values of 1 or 0. It’s important to note that the LDR’s output is inherently analog in nature. Therefore, if you are successfully capturing analog values.