Project: problem

Hello. I have an arduino project that comprises of (16*2) LCD display,MQ2 gas sensor and arduino. The project works well when i have the arduino powered from my PC but when i try power it using a 12v, 1A power supply ,yes every component is powered on but the project does not worl as expected .What could be wrong. Kindly help.

Thank you.

TOPIC SPLIT
DO NOT HIJACK / NECRO POST !

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

johnnie5:
What could be wrong. Kindly help.

You need to post your program.

When posting code please use the code button </>
codeButton.png

so your code 
looks like this

and is easy to copy to a text editor See How to use the forum

...R

(deleted)

No need to enquire further!

A very real danger is that the obsolete tutorials on the Arduino site and others misleadingly imply that the largely ornamental "barrel jack" and "Vin" connections to the on-board regulator allow a usable source of 5 V power. This is absolutely not the case. It is essentially only for demonstration use of the bare board back in the very beginning of the Arduino project when "9V" transformer-rectifier-capacitor power packs were common and this was a practical way to power a lone Arduino board for initial demonstration purposes. And even then it was limited because an unloaded 9 V transformer-rectifier-capacitor supply would generally provide over 12 V which the regulator could barely handle.

If you are asking this question, it is clear that you have connected something else to the Arduino "5V" pin - a MQ2 gas sensor which draws a lot of current. So you need a regulated 5 V supply.

The on-board regulator is essentially capable of powering only the microcontroller itself and no more than a couple of indicator LEDs. The on-board regulator might be able to power a few other things if it had a heatsink, but on the "stock" Arduinos, it does not.

Powering via the "barrel jack" or "Vin" connections is asking for trouble. The "5V" pin is not by any means an output pin, if anything a "reference" pin but most certainly the preferred pin to which to supply a regulated 5 V.

A practical power supply for the Nano (or UNO, Pro Mini, Leonardo etc.) is a "phone charger" with a USB output connector for 5 V, generally up to a couple of Amps though you can not feed more than 500 mA through the USB connection.