Help me understand this behavior

I have made a simple circuit that would take a 0-24V DC that could alternate in direction and voltage, and make sure that the output is always in the same direction. (ops, forgot to draw the output but its after the diode bridge)
This circuit also lights a led to indicate the direction of the input. To drive the leds i use a voltage regulator capable to deliver 100mA at 3.3V.
The voltage regulator also drives a hall effect sensor, who is connected to a arduino pro mini (5V version)
On the arduino i use the internal pull up resistor so this pin is HIGH on normal and will fall to LOW when a magnet is close.

What i don't understand is why this circuit works when the red led is lighten up but not when the green one is. But i cant see why it would work when the input is in one way and not the other.

Since there is a built in regulator in this hall sensor i could solve the problem by feeding it directly from the diode bridge and that way it works as expected. The hall sensor is supposed to draw 1.6mA

Voltage regulator - LP2950CZ-3.3 TO-92 - Datasheet
Hall Effect Sensor - TLV49645 SIP-3 - Datasheet

//Josef Fällman

First off you need capacitors on the input and output of that regulator.

Next it is not normal to connect the D.C. side of a bridge to the AC side.

If you trace the circuit when you think the green lights should light up I think you will see there is no return path for the current because the diodes are in the way.

A missing decoupling cap(s) or bad connection are likely cause of your problems. The LDO's datasheet says an output cap is required for stability.

Also "not working" is poor description of your problem. You should try to provide as much information as possible (experiment + expected result + obtained result). Gathering such data often shows you the solution without need for external help.

There is a return path for the current in fact -
green LEDs need higher voltage than red, try replacing it with a red or orange one. This circuit would
probably work with 5V regulator (3.3V is marginal for green/blue/white LEDs). Still need the capacitors
for the regulator though, you definitely want the regulator to be stable.

You get extra marks for the extra diodes that protect the LEDs from reverse voltage (most LEDs are only
rated for -5V reverse voltage). That regulator can handle 30V input so its good for the 24V max input.

Hi,
You need to modify your circuit like this, so that the RED and GREEN LEDs are ONLY being supplied by the 24V input then they will operate for each polarity of 24V input.

The caps you need to add are also added, read the data sheet on the regulator and it will have a circuit in it showing how to set it up.


reg22.jpg
The capacitor that is on the input side of the regulator may need to be 470uF to 1000uF so that you have filtered DC for the Hall Effect device and a good DC signal to feed the controller.

Your series resistor for the LEDs will need reworking.

Looking at the RED LED.
For 24V you will be dropping 24 - 1.6 = 22.4V across the 100R resistor.
That equates to.
22.4 /100 = 0.224A or 224mA, not the 20mA needed.
1K2 resistor should do it.

A similar situation occurs with the GREEN LED.
1K2 resistor should be okay here as well.

What is the 24V source?
What is the application?
Why not power the Hall Effect off the Arduino controller?
The datasheet says it will operate up to absolute max supply of 26V.

Tom... :slight_smile:

Tom, I think the device is to operate from DC, not AC, and the LEDs are to indicate the polarity of the
current connection, so need to be connected as drawn and only see 3.3V forward biased.

Hi,
We need to know what the source is and if it is gnd referenced, and to what gnd.

Tom.... :slight_smile: