No resistors... why is this wrong?

I'm new so I try to keep things simple. I use 2, 3, & 4 cell LIPO batteries to power a 5 volt LED. Using the switch, I identify the 2, 3, or 4 cell battery. When the battery depletes to 3.2 volts per cell, the Arduino Nano powers down allowing me to recharge the battery.

I'm not using any resistors for the LED or debounce code for the switch. At the moment, things appear to work well. What should I expect to go wrong?

I've uploaded a crude schematic that I hope is fairly clear. I've also uploaded the sketch.


Christmas_Houses.ino (3.9 KB)

Blockquote

The port pin will eventually burn out and possibly take the rest of the processor with it.

You should always have a resistor or other current limiting/controlling circuit. (1)

Are you familiar with Ohm's Law? i.e. Resistance is "the resistance to current flow."

LEDs (like all diodes) are non-linear. As voltage goes-up, resistance goes down and current increases dramatically.

The I/O pins on a regular Arduiono are rated for 40mA "absolute maximum", and the LED also has a maximum rating, probably less than that. Without a resistor it might "work" but you'll probably get more than 40mA, and the voltage will drop as you over-stress the Arduino and the LED. They both may survive but it's a bad design!

With the correct resistor the current is limited. The 5V is divided between the LED & resistor. With series components the same current flows through all series components. And with the correct current flowing through the LED, the voltage "magically" falls into place.

...If you put the LED directly across the battery, you'll probably get enough current to burn-out the LED.

(1) High power LEDs (1W or more) are normally driven from a switchmode constant-current power supply/driver. If you use a resistor, it wastes energy and it get's hot because it usually uses as much power as the LED so you need a high-power resistor. And the wasted power means you are loosing some if the energy-efficiency advantage of using an LED.

1 Like

What’s the voltage divider ? (typically has only 3 legs).
If you have data let us know.

Where it’s placed, you’re measuring the regulator output, rather than the battery voltage.

Resistor for the LED please.

The switch is drawn oddly.
You only need one side of the switch in use, it’s either on, or not on in this application. You don’t need to test the second pole of the contacts.

The LEDs you linked to claim to be 1W and has an on board 6R8 resistor included. 1W means they will draw 200mA , which is 10 times the maximum current you can usually safely draw from an Arduino pin (maximum varies depending on processor and can be lower than 20mA). If you want to use those LEDs at their rated current then you need a MOSFET to drive them. Otherwise use a resistor to limit the current to 20mA and accept the reduction in brightness.

I thank you all for your responses. You are all a great and willing resource.

This is the voltage divider I'm using.

This was my first attempt at a schematic. Although I have the actual connection attached to the positive of the battery, I had it wrong in the schematic.

I'm using a toggle switch that has the center pin as ground and the two outside pins as positive(?). In this way, I can tell the code (attached) which of the 3 batteries I am using: 2, 3 or 4 cell.

Again, thanks for the help. I'll wrestle with Ohms law to figure out which resistor to use. Because of the 3 different battery voltages, there will need to be some sort of compromise in choosing the resistor.

No you are not.
You are powering the Nano with the batteries and a Nano output pin is connected to the LED.
You are not powering the LED with a battery voltage. The Nano will limit the current to the LED until the nano eventually burns out.
Exactly what is the intent of the design?

IMG_0333
This is a voltage divider - but the resistors are chosen for the voltage being monitored,mand the terminology used in the pins is straight out of ‘instructables.’. (incorrect)!

Boy... This is a tough crowd. True. I am not powering the LED with battery voltage. I'm powering the Nano with the 5 volt output from the voltage regulator. Then, as you suggest, the Nano is powering the LED.

Well, you want to know what could go wrong. Your text describes one thing but your schematic shows another, how can I know which one you actually intended.
In any case you need a resistor for the LED
You did not answer my question about the purpose of the cricuit.
Maybe, powering the LED with the battery would make more sense.

In the interest of keeping things simple. A LED is a current driven device so it is about current not voltage. LEDs typically have a low working forward voltage. The current needs to be limited. Less a resistor to limit the forward current your LED will have a short life and possibly whatever is driving it. This is basic electricity 101.

Ron


It's getting to be too much work each year storing this board until the next Christmas. My goal is to light the houses in multiple small settings. On the board they are powered by 110v. That won't work in the future.

I'm lighting the individual houses with the LED and when the battery reaches its low voltage point, 3.2 volts p/cell, the Nano should go into low power shutdown (see previously attached sketch).

1 Like

Well you need to figure out the current limiting resistor needed to limit the current to 20mA for each LED.
If the voltage to Vin is 6.6V then you should be able to connect about 10 LEDs to the Nano before the Nano regulator gets to hot.

If the voltage to Vin drops below 6.5V the Nano regulator will drop out of regulation and you may have problems.

1 Like

If the voltage divider is connected like your drawing shows, you are putting the same voltage as VIN on the 5V pin. You may have killed the Nano. Check the voltage on the 5V pin with your DMM.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.