[solved] Another earthing issue

Hi, I'm having some issue with earthing my project.
I'm using a voltage finder sensor to find when the fan of a hood is on, to open the vent or close it, for insulation purposes. the whole thing is working perfectly when using the usb from a computer or laptop plugged into the wall (didn't try unplugged but I suspect it won't work).

I'm using a 3amp 5v adapter that doesn't have a ground (since I assume it's a transformer inside) and I think that's where the problem lies but I don't know how to fix it.
basically, the system works fine when plugged in to the usb, or when the common is connected to the ground of the probe of an oscilloscope, or when replacing this power adapter with a proper power supply for electronics (which is grounded).

It doesn't work when using this adapter, even if I connect the common to the ground of the hood. (it has some green and yellow wires screwed on to the hood frame.

I also tried by using a voltage regulator, tapping the 16vdc from the hood after the voltage rectifier bridge and capacitor, but that doesn't work either.

any idea?
thanks

Let’s see the wiring.

Thanks for trying to supply schematics! This happens too seldom.
What You tell is confusing and there are things You didn't tell that are keys to this. Something is missing. Can You try to be more precise in the schematics? The picture of the adapter and its size, only occupies useful drawing space.

What's wrong with the schematic in the top post?

OP- What sensor are you using? (Schematic tip: label all of the pins used.

A quick with an Ohmmeter across the mains pins will tell you yes or no. There is no reason for a transformer. Capacitors isolate the circuitry from ground and easily pass the AC for the switching circuit necessary for the 5 volt DC power. I just checked one and on connection between the mains pins and the module works just fine.

Hey, thanks for trying to help me. sorry, I put all the info I thought were relevant.
Not too sure about what you're asking regarding the wiring. Do you mean photos of the actual thing?

They are all connected as shown here, all + soldered together and all - soldered together.
I cut off the connector of the adaptor and soldered the black to the other blacks and the red to a diode (I forgot that one in the drawing) then to the other reds to bring down the 5.8v for the nano.
What other info are you guys missing?

The voltage sensor is this, minus the last transistor and led. And it works fine when plugged in the computer. I get a signal that I can use fine.

https://i.ytimg.com/vi/5B1TELmqsH4/maxresdefault.jpg

Hey, not too sure what pins you're talking about to check. Do you mean testing the resistance between the + and - of the adaptor? That will tell me if it's grounded? I'm properly confused by your answer! 0_o

Did I say it was wrong ?

Maybe it’s not wired like that :thinking:

Check the resistance between the two pins that plug into the wall socket. If there is a transformer, there will be a continuity between those two pins.

Today small wall warts can contain anything, and the transformer is not usually the first part.
To maalrron
Your ground is the minus of your power supply. You dont need any ground from mains.

Oh, continuity, not resistance, yeah makes sense.

But why is there still an earthing issue when I connect the common to the ground of the hood then?

The wiring is the same, except that I soldered the red that goes to the + of the relay from before the diode, and the rest of the components get the 5v after the diode. It's wiring correctly since it works fine when the ground of the oscilloscope is connected to the common.

Your ground is the minus of your power supply. You dont need any ground from mains.

Is that because the common gets connected to earth at the breaker?

I'm gonna add an oled display to see the graph of the sensor values to try to understand what's going on when it's not grounded to the oscilloscope.

Now, I must confess I don't understand you. I would have to see your system to understand what is wrong, perhaps measuring something too. But I would forget mains and its ground. How about a new drawing with your power supply now included.
Edit: If you only Arduino with Blink sketch, does it work with your PS?

This is wrong. The ground (usually called 'earth' in the UK) from the mains is primarily a safety connection, it doesn't generally affect the operation of the circuit or carry any current during normal operation. The ground in the circuit is a designer designated point also generally used as 0V and can be the positive or negative pole of the power supply, or in the case of a split supply the mid point between the positive and negative power supply voltages. It is only the negative of the power supply if the circuit designer has made it so.

alright, I'll redo something more accurate.
thanks guys.

Hi guys, here's a new drawing. I removed the relay and servo for debugging purposes and replaced them with an oled display to visualize the graph of the sensor value when it's plugged in the wall and not.

also there's no continuity at the power supply pins, the multimeter shows 100, no beep.

Problem solved. It was indeed an earthing issue. I don't know why it didn't work the first time I tried but now connecting the common to the ground of the hood (or a power outlet) makes the sensor work like it should

What's all the nonsense in this discussion about? :roll_eyes:

A two pin power adaptor by definition has no connection between primary and secondary - it is designed - must be designed - to be "double insulated". Whether there is continuity between the mains pins is completely irrelevant - a plain transformer supply will have continuity but a switchmode supply (as illustrated) will indicate only a brief flicker when tested as the input capacitor after the bridge charges.

The OP is using a particularly crude "voltage sensor" to "sniff" some operating voltage somewhere inside a mains operated fan something-or-other. Clearly not the best way to do it, but probably fairly safe.

So they need to detect a voltage relative to mains ground, which the fan housing should be, but clearly is not. This can be checked by testing continuity between that housing and another mains ground. That it is not connected is extremely suspicious if it actually has green/ yellow stripe grounding wires.

If you do not connect the common negative of the circuit to a mains ground, it will be floating at a similar AC potential (due to the capacitances in the power adapter) to the one you wish to "sniff", so no potential difference to detect. While the mains ground is a protective ground, it is also connected to the mains neutral and is a perfect reference point to use when there is no need for any significant current to be passed.