Question about from pos to neg on an led

Thread Starter

gorf27

Joined Oct 24, 2017
6
Was wondering if anyone had an easy simple way to switch from the + to the - lead on an led..
I can do it with push switches but in my design i would need around 40 0r 44 switches, and that will
talk up a lot of space on the pcb.

I have 8 optic sensor switches i can connect, what i am trying to do is be able to use different kind of sensors,
the 2 i have been testing work the opposite of each other.

1 sensor i can run the sensor trigger to a resistor then to + of the led and the - of led to pos
the other i run the sensor trigger to a resistor then to - end of the led and the + of the led to pos

so the only way i can figure out to do this is with smd switches but like i said takes up alot of space

wired in this fashion when the sensor is triggered the led's light..

thanks
 

dl324

Joined Mar 30, 2015
18,402
Welcome to AAC!

Don't understand the requirements. Post a diagram of how you would do the lead reversal with switches and specify how much space you have available.
 

Thread Starter

gorf27

Joined Oct 24, 2017
6
You could use a diode bridge so that the LED would light with either polarity.
Would that help?
doesn't the diode bridge pos and neg need to be swapped on the input side for the output to change direction so i would still need 4 switches right?

here is am image of the test bread board hope its clear enough to view

The sensors are going to trip limit switches for motors. i have 8 switches... they are working fine as long as i wire it for the same type,

the lm-24 sensor is the one the picture is setup for i can get them both to work but the lm-24 sensor will have the led on till triggered then it gos off my other sensor positive logic and the led is off till triggered.
I would like to have them both off till triggered.

Thanks gary
 

Attachments

Thread Starter

gorf27

Joined Oct 24, 2017
6
What you're trying to do is as clear as mud in that picture...

Post a diagram of how you're connecting switches to accomplish this reversal.
here is two pic's of the breadboard the first on has the led lit and when the sensor is triggered the led go's out

The second i switched the led wires and and went from pos to neg on led...

IMG_0197.JPG
 

Attachments

Reloadron

Joined Jan 15, 2015
7,893
What exactly is a LM24? A link to a data sheet would really help. Did you mean LM24 or LM 124, LM 224 or LM 324 which are all operational amplifier packages. I see a what looks to be 14 or 16 pin chip in your picture.
Nobody is going to look at a picture of a bread board and try to figure out what you have. People need a schematic to understand what you have and are trying to do. A schematic is not a picture of a bread board but rather a schematic drawing of your circuit.

Ron
 

crutschow

Joined Mar 14, 2008
38,571
doesn't the diode bridge pos and neg need to be swapped on the input side for the output to change direction so i would still need 4 switches right?
But I thought the problem was the the input to the LED was changing polarity.
The purpose of the bridge is to direct the current the same way through the LED independent of the input polarity.
Below is the LTspice simulation of the such a bridge circuit.
You can see that the LED [I(Led)] current is always positive even though the input goes from positive to negative.

upload_2017-10-25_9-40-37.png
 

philba

Joined Aug 17, 2017
959
On it's face the question makes no sense to me so I'm guessing here. I think what the TS is asking for is how to deal with positive or negative logic from his sensors. At least that's why I think he wants to switch the + and - leads which is very much the wrong way to go about it.

In addition, it appears he wants to be able to switch between pos or neg logic sensors on his PCB on a per sensor basis. Switches are one way to do it. Another way would be connectors - have one for each logic sense. Frankly, using a DIP switch would be the smallest way to go about it - I would use XOR gates and a dip switch. The XOR gate inputs would be a pulled high SPST switch and the sensor output. Flipping the switch would invert the logic sense output from the XOR gate. Using HC logic could drive LEDs at 5 mA or so. 74HC86 looks like a possible part.
 

Alec_t

Joined Sep 17, 2013
15,127
I'm unclear what the TS is trying to do, but would point out that applying reverse polarity to a LED beyond its rated value will cause breakdown.
 

Thread Starter

gorf27

Joined Oct 24, 2017
6
I'm unclear what the TS is trying to do, but would point out that applying reverse polarity to a LED beyond its rated value will cause breakdown.
Don't think it's reversing polarity, i just need to switch the + and - from the resistor to the pos and neg on the led when i use the different sensor.

i think the sensor when triggered is sending a + to the resistor
and the other sensor is sending a - to the sensor..

make sense?

thanks gary
 

LesJones

Joined Jan 8, 2017
4,509
The only situation that I can see that it makes any sense to reverse the polarity to an LED is if it is a dual colour led were one polarity makes it light in one colour (Say red.) and the reverse polarity makes it light in another colour (Say green.) This type of LED is realy two LEDs on the same package.

Les.
 

philba

Joined Aug 17, 2017
959
Don't think it's reversing polarity, i just need to switch the + and - from the resistor to the pos and neg on the led when i use the different sensor.

i think the sensor when triggered is sending a + to the resistor
and the other sensor is sending a - to the sensor..

make sense?

thanks gary
Not completely. Sensors don't "send things". The sensor you linked to has either a PNP or NPN open collector output. They are interfaced to differently (NPN - use a pullup resistor to +V, PNP - use a pulldown to GND). The NPN will signal low when active, the PNP will signal high.

You can directly drive an LED up to 50 mA from the sensors but building a board the accommodates both sensor types by switching the inputs is messy as you have figured out because you need to switch both legs of the LED (plus it's current limiting resistor). Why do you feel the need to support both types? That's what I don't understand. Most designers just pick one type and go with that. Flexibility has it's cost and, in this case, I think unnecessary.
 

Thread Starter

gorf27

Joined Oct 24, 2017
6
Not completely. Sensors don't "send things". The sensor you linked to has either a PNP or NPN open collector output. They are interfaced to differently (NPN - use a pullup resistor to +V, PNP - use a pulldown to GND). The NPN will signal low when active, the PNP will signal high.

You can directly drive an LED up to 50 mA from the sensors but building a board the accommodates both sensor types by switching the inputs is messy as you have figured out because you need to switch both legs of the LED (plus it's current limiting resistor). Why do you feel the need to support both types? That's what I don't understand. Most designers just pick one type and go with that. Flexibility has it's cost and, in this case, I think unnecessary.
I am starting to think you are right i may abort the thought of using both type of sensors and stick to one i was trying to make it a little more flexible but starting to look like not worth all the effort...

Thanks gary
 

Reloadron

Joined Jan 15, 2015
7,893
yes sorry is's a pm-l24 heres a link to data
There is no PM-I24 do you mean a PM-L24? If you have the L-24 it has NPN open-collector transistor outputs for Light and Dark. According to the data sheet a supply voltage of 5 to 24 V DC 10 % Ripple P-P 10 % or less and NPN open-collector transistor • Maximum sink current: 50 mA • Applied voltage: 30 V DC or less (between output and 0 V) • Residual voltage: 0.7 V or less (at 50 mA sink current) 0.4 V or less (at 16 mA sink current). So it is capable of driving a LED. What you have should approximate the below drawing:

Light Dark LED.png

One output is On with light and the other is On with dark. This is a typical open collector NPN output. Now what exactly do you want to do? The drawing just reflects two LEDs, one for light and one for dark. You can configure this however you want it to work. Also the series resistance values will depend on your LEDs and your Vcc.

Ron
 
Last edited:
Top