Temperature sensor power supply

Hi Folks,

I have an off-brand (RedQualis) Arduino Uno that I am using to power one string of 50 addressable LED's using Fast_LED. I am using the 5v pin + Gnd for the lights and digital pin 6 for the I/O. To be safe, I encased this board in a small enclosure to run this string of lights for a Christmas decoration. However, I noticed that the enclosure is getting a little bit warm. Not super hot, but a little warm. I suppose this is because I am driving the LED's directly from the Arduino.

My question is this: I have a temperature/humidity sensor for the Arduino. I was going to use this in combination with an if(statement) to allow the LED's to come on only if the temperature remains below a certain value. However, this sensor needs its own 5v supply, which I've used for the LED's.

Can I use digitalWrite(7, High) as a 5 volt supply on pin-7 for this sensor? Would that be 5 volts or 3.3 volts? (side question, how do I know which pins are 5v and which are 3.3v?)

Thanks. I think I can guess the direction this thread will go, but I figured I might as well ask anyway.

Mac

You have guessed correctly, we are going to ask you to provide links to datasheets for all your hardware devices, namely temperature sensor, power supply, LED string....

side question, how do I know which pins are 5v and which are 3.3v?

On the UNO all pins except 3V3 are 5V.

MacLaddy: Can I use digitalWrite(7, High) as a 5 volt supply on pin-7 for this sensor? Would that be 5 volts or 3.3 volts?

Yes you can use it as a power supply, you have to keep it HIGH and it will provide 5 volts and can be used for powering up simple sensors.

Yes you can use it as a power supply, you have to keep it HIGH and it will provide 5 volts and can be used for powering up simple sensors.

This is only correct if the sensor has a low power consumption. As the OP didn't tell us yet what exact type of sensor we're talking about, above setup might fry your Arduino and is generally not a good idea. Use at least a transistor to switch the higher currents.

LED's are typical WS2811 RGBs that draw ~20mA each. 50 total gives a max bright-white current at a MAX of ~3A (likely a bit less). Probably not too smart, considering the limitations of the UNO, but I've had a couple of displays with it and haven't had a problem so far.

The DHT11 temperature sensor datasheet is only in Chinese, but similar ones have a draw of approximately ~3mA. Not very significant.

Regarding the use of a pin as a voltage supply, I appreciate the responses saying that it is at least 'possible', even if not wise. However, I grew a brain and remembered that breadboards were created for a reason, and I should use the one I have and not just stare at it blindly.

So, everything is wired up and a program is in the controller. The LED program by itself works. The Temperature program by itself works. When I combine them, the LEDS no longer go blinky blinky like they are supposed to. They are behaving...oddly.

I am guessing that there are some timing or clock issues going on here. Which, coincidentally, is my least understood aspect of programming.

Anyway, one thing at a time. Thanks everyone for the responses. Mac

If your board has the "IOREF" pin like a real UNO, connect your 5V sensor there.

pylon: This is only correct if the sensor has a low power consumption. As the OP didn't tell us yet what exact type of sensor we're talking about, above setup might fry your Arduino and is generally not a good idea. Use at least a transistor to switch the higher currents.

Yeah its not the best way but still its a way. It happened to me once, I was working on a project where I have to interface many sensors and there was some restrictions about the size so I have used digital Pin for powering up sensor. Normal 5V sensors can easily be powered up with any digital Pin although again not a best way. :P

I don't think there is much risk for the driving pin unless there is a large decoupling cap on the sensor module or it will be switched on/off often. But I guess there will be a lot of noise on Arduino's (nearly) overloaded power rails. Powering an analog sensor from a GPIO pin of a MCU powered from such poor supply may lead to poor results.

MacLaddy: My question is this: I have a temperature/humidity sensor for the Arduino. I was going to use this in combination with an if(statement) to allow the LED's to come on only if the temperature remains below a certain value. However, this sensor needs its own 5v supply, which I've used for the LED's.

This sounds terribly wrong.

When you have a 5V power supply you can simply connect multiple wires to that one supply. So no problem powering the Arduino, the sensor and the LEDs from the same power supply. That is: as long as the power supply can handle the current of the LEDs. The 5V output pins of the Arduino can NOT do this for that many LEDs. I've done it for strings of 5 such LEDs myself, up to 10 may be safe but that'd be it. You're overloading the board.

So for your 50 LEDs you have to connect the power directly to the power supply, not through the Arduino board.

The sensor you'll normally connect to the Arduino's 5V output. Again those can be used to connect many more sensors, just connect wires together, as long as the total current is not too high. A couple hundred mA if powered through USB or other 5V source, less if powered through the 7-12V jack/Vin.

A big capacitor (470uF or more) should be enough to keep the power lines clean enough, as long as your power supply can easily supply the maximum current the LEDs need.

wvmarle: When you have a 5V power supply you can simply connect multiple wires to that one supply. So no problem powering the Arduino, the sensor and the LEDs from the same power supply. That is: as long as the power supply can handle the current of the LEDs. The 5V output pins of the Arduino can NOT do this for that many LEDs. I've done it for strings of 5 such LEDs myself, up to 10 may be safe but that'd be it. You're overloading the board.

Well, technically it CAN do it, although it may not be terribly wise. In fact, I've done it many times. For hours on end. See my post above demonstrating that lighting can indeed strike my malfunctioning gray-matter.

MacLaddy:
Well, technically it CAN do it…

What do you mean. You have already powered 50 addressable LEDs through the Uno, so it’s ok?

The chain of parts between USB socket and 5volt pin is designed for 500mA.
The tiny p-channel backflow protection mosfet and the 500mA polyfuse being a good indicator for that.
50mA is used by the Arduino itself, so 450mA absolute max is available.
Not very wise to connect a load to the 5volt pin that can potentially draw 3Amp.

As wvmarle already stated, powering through the DC socket (or V-in) is usually worse.
Don’t believe the 800mA and 16 or 20volt absolute max statements you find in the Uno spec sheets.
Thermal limits are reached at far lower voltages and currents.
Leo…

Wawa: What do you mean. You have already powered 50 addressable LEDs through the Uno, so it's ok?

The chain of parts between USB socket and 5volt pin is designed for 500mA. The tiny p-channel backflow protection mosfet and the 500mA polyfuse being a good indicator for that. 50mA is used by the Arduino itself, so 450mA absolute max is available. Not very wise to connect a load to the 5volt pin that can potentially draw 3Amp.

As wvmarle already stated, powering through the DC socket (or V-in) is usually worse. Don't believe the 800mA and 16 or 20volt absolute max statements you find in the Uno spec sheets. Thermal limits are reached at far lower voltages and currents. Leo..

No sir/ma'am, don't misquote me. I never said it was okay. In fact, I believe I said repeatedly it was incredibly unwise. However, it did work. It actually surprises me that I didn't let the smoke out of it, especially now that I've seen the numbers. Either my LED calculations are incorrect, or that little UNO has a safety factor of 6+ on the 5v rail. I definitely wouldn't hook it up again. I'm daring, but not stupid. When I have some extra time I'll have to do an amp draw on the string (from a power supply, of course). See what those 50 LED's are actually pulling.

The actual amount those LEDs draw is less than 3A of course. It depends on both the colour displayed and the brightness. Short current peaks of over 500 mA will be handled just fine, it's long term that's a problem. Nonetheless, being able to do something doesn't necessarily make it a good idea, hence the need to string power lines bypassing the Arduino directly from the 5V power source to the LED strip.