Hi to y'all,
I'm planning to finish my project. This is the main view over what I'm using:
Arduino Uno;
Rtc Ds3231;
four buttons;
two leds;
an active buzzer;
water level sensor;
2004a v1.1 20x4 i2c Lcd;
Dht11 temp&humid sensor;
Hc-05 Bt module.
The parts listed above are being powered from the Arduino board via a 5V 2A USB wall adapter (to simplify the whole thing).
To this point, everything is fine. Now comes the tricky thing: I wanna add a Mq-5 gas sensor. I obviously cannot power the module from the same power supply as the rest of the components, so I though maybe I can attach the sensor to an external power supply. I have two external ones, one YwRobot something, and another one similar to the first, both capable of supplying less than 500 mA, but enough to get the sensor to work without an issue (I suppose, since I know the Mq-5 might eat something like 160ish mA, because of the heater). The external supply will be connected to a DC jack 12V 2A wall adapter.
Now... I wanna check with the experts some things before actually doing this: the gas sensor's Vcc will be connected to the power supply's Vcc, the ground of it to the external source but at the same time, the Arduino ground should also be connected to the external supply's ground rail, right?
I know there are some other methods of doing this whole thing without having to use two different wall adapters, but since I'm not that good at doing such complex power supply circuits, I wanna stick with the simpler method if it gets me where I wanna go. The system should be able to run 24/24 without a break.
Any advice/thoughts? Any idea is welcomed.
Thank you!
Any external power supply that powers peripheral devices connected to the Arduino must also have their ground connected to the device ground and Arduino ground.
I obviously cannot power the module from the same power supply as the rest of the components, so I though maybe I can attach the sensor to an external power supply.
Why can't you use the same power supply? Maybe I'm missing something, but a quick calculation of total current consumption gives me less than 650 mA in worst case scenario:
Active Buzzer -> 30 mA max.?
Water Level Sensor -> 20 mA max.?
LCD -> 250 mA ?
DHT11 -> 2.5 mA max.
HC-05 -> 40 mA max.?
2 LEDs -> 40 mA max.
DS3231 -> 0.3 mA
Arduino Uno -> 20..80 mA ?
MQ-5 -> 161 mA
Yeah, you're right about the calculation. But isn't the USB port supposed to be limited at 500 mA? I thought I cannot draw more than 500 mA from the USB port. Maybe I'm the one who's missing it. I would frankly love to be so, 'cause powering the whole system only from the USB Wall adapter will spare me a lot of other complications.
groundFungus:
Any external power supply that powers peripheral devices connected to the Arduino must also have their ground connected to the device ground and Arduino ground.
denis662:
Yeah, you're right about the calculation. But isn't the USB port supposed to be limited at 500 mA? I thought I cannot draw more than 500 mA from the USB port. Maybe I'm the one who's missing it. I would frankly love to be so, 'cause powering the whole system only from the USB Wall adapter will spare me a lot of other complications.
You are right. I'm sorry, I forgot about the 500 mA PTC Resettable Fuse in the Arduino Uno USB port. If it weren't this fuse, I was thinking about using a transistor as a switch to turn on the MQ-5 power only when using the USB wall adapter... But even so it wouldn't be easy to determine if the board was being powered by the PC (when programming) or the wall adapter...
One way to use just one power supply could be by cutting the USB connector from the USB external power adapter and connect it directly to Vin+5V pin and GND terminals. In this case, you should make sure the power adapter outputs a regulated 5V voltage and it would be a good idea to place a fuse before Vin+5V pin (for example, an inline 1A fast or very fast acting fuse). When programming the Arduino you would need to make super sure this external power supply would be ON before connecting the USB cable.
By the way, using an external USB power adapter you always must make sure the it is a properly regulated 5V supply, since the 5V Arduino voltage regulator is bypassed.
Edit: After reading Paul__B answer I've corrected my answer by replacing "Vin" with "+5V pin".
You do not use "Vin". It is virtually useless in general.
Have a 5 V supply? Connect it to the "5V" pin (and ground of course) on the UNO - that's what it is for - as well as all other devices requiring 5 V. You may need to adapt a USB plug to connect to the "charger". They are available and you want to use more substantial wire than many USB cables.
Aliexpress item
Just disconnect the "5V" pin while you plug the USB port into your PC for programming.
The USB "phone charger" rated at least one Amp is a very convenient power supply for Arduino projects, probably the most practical single approach.