Electrical – Doorbell transformer wiring to an electrical outlet

doorbellelectricaltransformerwiring

I just bought a new doorbell transformer (24V 40VA), to replace for current one (10V 5VA) because I bought a video doorbell.

I'm don't have any experience with electricity but I'm willing to learn (please bear with me). So I was hoping it was going to be an easy swap old for new.

Unfortunately what I see is a transformer going through an electrical outlet and no wire colors.
Picture of wiring through transformer

Other side of outlet

My concern is the wiring the new transformer properly.
The new transformer new transformer has the Hot(black), Neutral(White), Ground(Green) wiring.
When I disconnect the disconnect the old transformer from the sides of the outlet, how can I tell where to connect the Black and White wires? In the picture of the old transformer, they are both black!

Any advice would be appreciated!

-M

=====================================

UPDATE:
Thanks all for your prompt feedback!
Just so I am being clear… I was just hoping to replace the old one with this new one.
I hope this new diagram better illustrates what I'm thinking:
I was thinking of running the the White wire from the new transformer to the silver screw on the outlet.
Running the the Black wire from the new transformer to the brass screw on the outlet.
Lastly running the Green wire from the new transformer to the ground screw on the outlet (pigtail it?).
enter image description here

Do you see any issue(s) with my setup?
Thanks again!

Best Answer

The ac going to the transformer doesn’t matter because the low voltage on the other side is isolated.

However there are several issues as I see it The high voltage between the transformer and metal box the wires are not in flex or rated for being in the open not a big deal but a code violation. Next with the transformer not mounted to the metal it is not grounded so a fault could end up on the low voltage side and not tripping the circuit breaker.

Most door bell transformers are made to mount on a box and the 120v connections are made inside the box, this is the case with your new one You will have knock out one of the slugs on the side of the box )make sure it will fit first) you may have to add a spacer behind the box so the transformer can mount on the side but the mounting creates the ground path I mentioned as the fitting on the side of the box makes it very tight in a single gang box I would wrap electrical tape around the terminals after you connect the wires again the high side the colors don’t matter if they are the same color.

If the receptacle doesn’t look like it will fit you may need to change to a single receptacle and use one of the knockouts on the top side or bottom side (not the ends as the cover usually caused problems on the ends)

The good news is you now have the correct type of transformer to be mounted on the box.