I'm a beginner with Arduino. I'm using MQ135, MQ2, and DHT11 together and trying to save the data in an SD card.
when I upload the code using a USB cable with my laptop it works fine,It collects data and writes to the SD card.
But the problem happens when I disconnect the USB cable from the laptop and connect the setup with a 12V connection it's powering up but it can't read the data and write to the SD card.
How can I solve this problem?
I read a lot of old posts here.
But not getting help anyhow.
I
12volt is the absolute maximum I would power an Uno R3 (assuming) with,
and at that voltage you can't draw more than 100mA total from any/all pins.
The MQ135 alone draws already more than that (150mA), so it's likely that your Arduino ends up in an endless reset loop because of an overheating 5volt regulator.
An easy solution is to power the Uno with a 5volt cellphone charger, through the USB socket.
But if you must use that 12volt supply, then drop it to 5volt with a buck converter, and connect that 5volt to the 5volt pin (and the sensors).
I assume you are using an SD card reader with built-in regulator, connected to 5volt.
Please read the " how to post" guide, so we don't have to guess what you have.
Leo..