Hello, I made a project that can detect temperature and smoke using LM35 and MQ2 gas sensor . But after uploading the code my LM35 didn't function properly and continuously giving wrong value but my MQ-2 gave correct values. Here is my code-
Well, today I have tried this again and you know what I have got all correct values. I don't know what just happened- I have used same connection and same code. Thank you all
The 161mA current drawn by the 31Ω heater in the MQ2 gas sensor is dragging the AREF voltage down and causing the LM35 error. After the sensor warms up to operating temperature and the heater cuts off, the LM35 reading goes back to normal.