can i detect if the hot and neutral lines reversed?

Thread Starter

Layan_AK

Joined Mar 28, 2017
78
Hi All,

i build a system to turn the lamp on for a certain time selected by keypad.

20180730_120114.jpg

the lamp already connected to neutral line .

is there any way to detect if the line and neutral reversed ??

regards ^^
 

AlbertHall

Joined Jun 4, 2014
10,889
Only if you have an earth connection, then you should find line voltage between line and earth and a low voltage (say <10V) between neutral and earth.
 

Thread Starter

Layan_AK

Joined Mar 28, 2017
78
Only if you have an earth connection, then you should find line voltage between line and earth and a low voltage (say <10V) between neutral and earth.
thank you ..

there is no earth line :(


can i use the lamp to guess if the line an neutral reversed ,as the lamp already connected to neutral so just one terminal available for me to use which should connected to hot line to turn lamp on..

so if i use for example current sensor in series with the lamp and at the beginning of program i will turn the lamp on if the lines not reversed the lamp will turn on since the hot line connected to it so there is a current .. if the lines reversed the relay will connect the neutral line to lamp so the lamp is off and no current ..

the second approach if the neon lamp has no effect if i connect it in series with lamp i will use it instead of using current sensor in first approach and use ldr to detect if there is a light or not ..

regards
 

ebp

Joined Feb 8, 2018
2,332
If you were to put a current sensor in series with the lamp, it absolutely must be galvanically isolated from the MCU and associated circuitry. You could use a current sense transformer or a Hall-efffect device. It doesn't matter where it is in the AC circuit. For safety purposes all parts of a circuit connected to AC mains should be considered to be directly connected to "hot" - except an earth ground connection.

If you want to experiment with Hall-effect AC current sensors, there are boards based on the Allegro ACS712 and other Allegro parts. WARNING! I've looked a photos of many such boards sold on the hobby market and every one I've seen has been badly laid out in a way that defeats the safety isolation "creepage and clearance" distances that can be achieved with the parts.

Here is one such board :
https://www.banggood.com/1PC-30A-Ne...Ch2taw2oEAYYAyABEgISAvD_BwE&cur_warehouse=USA

That board is incredibly stupidly laid out and is grossly unsafe for AC mains use. There isn't a safety agency in the world that would pass it as being safe. I've seen some that are less bad, but still bad.
 

MrAl

Joined Jun 17, 2014
7,952
Hello,

Sometimes you can use a metal cold water pipe as an earth ground. Measure each side of the 'line' to that pipe and see what you get.
A metal radiator might work also.
If not, run a wire outside and put a long metal stake in the ground and try that.

What always mixes me up is which 'prong' is the hot, the wider one or the more narrow one.
 

Vytas Klyvis

Joined Dec 5, 2016
70
Is it neccesary for the lamp to already be connected to neutral?

If it is, then I think probing for a current is probably one of your only options.

You could also connect a low power relay (ssr) between the neutral and the lamp connection. This way you can signal galvanically.
 
Last edited:

WBahn

Joined Mar 31, 2012
26,398
Is it neccesary for the lamp to already be connected to neutral?

If it is, then I think probing for a current is probably one of your only options.
If the circuit shown works when L is the "line" voltage and N is the "neutral", then it will work IDENTICALLY if they are reversed. Probe for currents all day long -- they will yield exactly the same results.

Replace L and N in that diagram with X and Y and then ask if there is any way to detect which, if either, of X or Y is the neutral. There ISN'T. To see that this is the case, imagine that X and Y are the outputs of an isolation transformer -- the circuit will still work just fine even though NEITHER is a neutral and there is absolutely nothing to distinguish one line from the other.

The ONLY way to tell if one of them is a neutral is to have access to the reference that MAKES it a neutral, namely the earth ground (or something, at least, that is referred to it).
 

MaxHeadRoom

Joined Jul 18, 2013
22,321
Is your service itself grounded at the supply or panel?
You may be able to set or adapt a simple leakage indicator, in the same manner as the power indication testors that use a simple neon, no ground conductor/connection is needed.
Max.
 
If the circuit shown works when L is the "line" voltage and N is the "neutral", then it will work IDENTICALLY if they are reversed. Probe for currents all day long -- they will yield exactly the same results.

Replace L and N in that diagram with X and Y and then ask if there is any way to detect which, if either, of X or Y is the neutral. There ISN'T. To see that this is the case, imagine that X and Y are the outputs of an isolation transformer -- the circuit will still work just fine even though NEITHER is a neutral and there is absolutely nothing to distinguish one line from the other.

The ONLY way to tell if one of them is a neutral is to have access to the reference that MAKES it a neutral, namely the earth ground (or something, at least, that is referred to it).
I agree with you to some extent. But the diagram does not match his words. In the diagram, I agree that it does not matter how Phase and Neutral are connected. But if the lamp is connected to either Phase or Neutral then you need to know which to switch. That is his problem. So he does need to probe for a current.

That is also why I ask if the lamp needs to be connected to neutral beforehand. He could make it a four terminal device instread of three. Using two terminals for the light instead of one.
 
Last edited:

WBahn

Joined Mar 31, 2012
26,398
I agree with you to some extent. But the diagram does not match his words. In the diagram, I agree that it does not matter how Phase and Neutral are connected. But if the lamp is connected to either Phase or Neutral then you need to know which to switch. That is his problem. So he does need to probe for a current.

That is also why I ask if the lamp needs to be connected to neutral beforehand. He could make it a four terminal device instread of three. Using two terminals for the light instead of one.
His relay ALWAYS connects the lamp between one line and the other -- it does not matter which is which. If the line and neutral are connected as labeled, then the relay connects the floating side of the lamp to the line while the other side is hard tied to the neutral. If you swap the connections, then the relay connects the floating side of the lamp to the neutral while the other side is hard tied to the line. In both cases, the lamp will turn on with exactly the same current flowing. Regardless of how they are connected, the lamp is hard tied to one while the relay is connecting the other side to the other.

He doesn't provide the details of the AC/DC converter or of the relay driver that he is using, but that doesn't matter because if it will work with the input power connected as labeled, it will work the identically same way if the input power leads are reversed.
 
demo.png

Maybe the above image will make things a bit more clear. I have used the logic that you have provided regarding the X and Y. If the power leads are reversible you could get the situation as seen in the above picture. Let's assume that the X represents the neutral connection, then it the above scenario we are switching the neutral to the lamp which already has neutral. We have only created a loop. Only with the power leads reversed as opposed to the image will this circuit be able to function.
I don't mean to disrespect your judgement, but I think you are wrong in this case.

Regards,

Vytas
 

AlbertHall

Joined Jun 4, 2014
10,889
Are you trying to detect this situation at installation and correct the wiring?
Or are you trying to detect this situation and have the circuitry itself correct things without changing the wiring?
 

WBahn

Joined Mar 31, 2012
26,398
View attachment 157212

Maybe the above image will make things a bit more clear. I have used the logic that you have provided regarding the X and Y. If the power leads are reversible you could get the situation as seen in the above picture. Let's assume that the X represents the neutral connection, then it the above scenario we are switching the neutral to the lamp which already has neutral. We have only created a loop. Only with the power leads reversed as opposed to the image will this circuit be able to function.
I don't mean to disrespect your judgement, but I think you are wrong in this case.

Regards,

Vytas
The bottom of the lamp is HARD WIRED to the bottom power lead and the relay is HARD WIRED to the top power lead.
 

WBahn

Joined Mar 31, 2012
26,398
I'm trying to figure out how you are interpreting his description and I think I may be seeing it.

It all depends on what he means by the lamp being "already" connected to the neutral.

How is this prior connection being accomplished?

How is that then interacting with the line and neutral connection coming into his circuit?

Depending on exactly what he has, if it is different than what he shows, it might be trivial to tell if they are reversed because the breaker will trip as the line gets shorted to the neutral. Otherwise you might have guessed correctly.

We really need the TS to be more explicit and provide a diagram that accurately reflects what he has.
 
Why would the line be shorted to the neutral?

He could have the situation that the power leads are coming from an outlet (polarity independant) and the lamp is prewired in the existing wiring.

We've both read the problem a different way but I think that I that the actual problem is the one mentioned by me.

Regards
 

ebp

Joined Feb 8, 2018
2,332
TS states "i build a system to turn the lamp on for a certain time selected by keypad."

The circuit matches the stated intent and will function perfectly well regardless of which power line connection is hot and which is neutral.

If you make a different circuit it won't be the same. Tautology.
 

WBahn

Joined Mar 31, 2012
26,398
TS states "i build a system to turn the lamp on for a certain time selected by keypad."

The circuit matches the stated intent and will function perfectly well regardless of which power line connection is hot and which is neutral.

If you make a different circuit it won't be the same. Tautology.
The ambiguity comes in when he states that the lamp is ALREADY connected to the neutral and whether or not that connection is separate and independent of the line and neutral connections that he is concerned about being reversed at some point.
 
The circuit as shown will work.
The problem lies in the actual wiring of this circuit.

It would be easier to wire if the circuit was a four terminal device.
 
Top