User avatar
Imperf3kt
Posts: 1386
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Using my Pi with an AC mains connected preamp.

Wed Oct 17, 2018 10:49 pm

This question doesn't directly relate to a a Raspberry Pi, but I do intend to use a Pi with things, and need some assurance.

Recently I built a 6J1 Tube preamp which I intend to use to filter the audio output from my Pi. It runs off 12v AC.
The preamp is not grounded, it runs from Live and Neutral only. Now the Neutral is connected directly to the ground plane of the amplifier, meaning any connected device (such as my Pi) will also be connected to AC.

Should I be isolating this somehow, or is it okay to run in this set-up?
Stop plugging your fan directly into the GPIO 5v
https://www.electronics-tutorials.ws/power/transient-suppression.html

User avatar
Joel_Mckay
Posts: 150
Joined: Mon Nov 12, 2012 10:22 pm
Contact: Website

Re: Using my Pi with an AC mains connected preamp.

Thu Oct 18, 2018 6:49 am

In general, you want to isolate your equipment if possible:
https://en.wikipedia.org/wiki/Ground_lo ... tricity%29

"Neutral is connected directly to the ground plane of the amplifier"
sounds a bit like a widow maker.... ;-)

Maybe two small Toroidal audio isolation-transformers could be a feasible $4 solution instead...
YMMV ;-)

hippy
Posts: 3924
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Using my Pi with an AC mains connected preamp.

Thu Oct 18, 2018 7:28 am

Imperf3kt wrote:
Wed Oct 17, 2018 10:49 pm
The preamp is not grounded, it runs from Live and Neutral only. Now the Neutral is connected directly to the ground plane of the amplifier, meaning any connected device (such as my Pi) will also be connected to AC.
With Australian wiring regs so restrictive and huge fines for people who install equipment which break them I am surprised anyone's allowed to sell such a thing or would use it.

I would guess you should run it through a mains isolation transformer but, other than recommending not to use it, I am going to offer no advice because I'm not qualified and don't want to be responsible when it all goes very bad. It appears to me that you're walking in very dangerous territory.

User avatar
Joel_Mckay
Posts: 150
Joined: Mon Nov 12, 2012 10:22 pm
Contact: Website

Re: Using my Pi with an AC mains connected preamp.

Thu Oct 18, 2018 8:43 am

@hippy
It does sound rather dodgy, but legal guidelines are usually made by people with zero engineering background. Rules like RoHS actually made equipment more unreliable, and even NASA had to spend a few million $ to figure out why.

@Imperf3kt
Even if the chassis enclosure is grounded to earth, I'd still personally add an impedance-matched low-THD audio isolation transformer to your design.
https://www.edcorusa.com/pc_series

Remember... as hippy has correctly alluded, in the past it was common to see stage performers electrocuted from faulty equipment by plugging into a "hot" amp.

Best of luck, and stay safe. :-)

User avatar
Burngate
Posts: 5481
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
Contact: Website

Re: Using my Pi with an AC mains connected preamp.

Thu Oct 18, 2018 9:14 am

Imperf3kt wrote:
Wed Oct 17, 2018 10:49 pm
... It runs off 12v AC.
The preamp is not grounded, it runs from Live and Neutral only. Now the Neutral is connected directly to the ground plane of the amplifier, meaning any connected device (such as my Pi) will also be connected to AC.
Where does the 12v AC come from?
If it's a mains transformer - 240v AC in, 12v AC out - then that provides the isolation you require.

In fact, on the 12v side, there's no "live" or "neutral", they're just the two ends of the secondary winding.
Somehow, that AC is being converted to DC, and some part of the DC is connected to the metal-work and is labelled "Ground" for convenience.
Whether one end of the secondary winding is connected directly to that or not isn't important. If, for example, there's a bridge-rectifier in the way, then half the time one end will be connected through a diode to "Ground" with the other end at a varying voltage above it, and the rest of the time they'll swap round.

Ground, or Earth, is a somewhat misunderstood concept.

Mains gets generated at some large facility out in the wilds, and goes through several transformers before it gets to your house. At each stage, some part is connected to a stake shoved into the soil close by.
Mostly, they're three-phase, meaning three thick wires carrying the power, with a thin one connected such that its voltage is about average compared to the others, and called "Ground". It doesn't need to be thick, because the loads should be balanced so that almost no current should pass through it.

It's probable that only two wires arrive at your house from the substation - a transformer feeding several houses - with one of them coloured black or blue.
That one will be connected to the "Neutral" feeding your house wiring, and also to the green one (or green/yellow) for "Earth", and to the stuff you stand on when you're gardening.
Hopefully, the same one was chosen for all the houses round you, and since the substation possibly provides three phases, that one is the centre-tap of the three-phase transformer.

Hopefully, also, the loads on the three phases will be approximately balanced, so that there won't be too much current in the centre-tap. But if enough people on one phase go on holiday while enough of the rest on another phase run their aircon at full tilt, that centre-tap can carry the full output of the system. Then the ground point at your house could be at a wildly different voltage to the centre-tap of the substation.

drgeoff
Posts: 8633
Joined: Wed Jan 25, 2012 6:39 pm

Re: Using my Pi with an AC mains connected preamp.

Thu Oct 18, 2018 10:51 am

Imperf3kt wrote:
Wed Oct 17, 2018 10:49 pm

Recently I built a 6J1 Tube preamp which I intend to use to filter the audio output from my Pi. It runs off 12v AC.
12v AC is not what I would expect a tube/valve anything to run from.

User avatar
Burngate
Posts: 5481
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
Contact: Website

Re: Using my Pi with an AC mains connected preamp.

Thu Oct 18, 2018 11:50 am

For example, http://www.epanorama.net/newepa/2016/08 ... -6j1-2-0b/ uses a couple of voltage-doublers to provide 56v DC to the valves.
tubepre.png
tubepre.png (53.17 KiB) Viewed 535 times

User avatar
Imperf3kt
Posts: 1386
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Using my Pi with an AC mains connected preamp.

Thu Oct 18, 2018 7:44 pm

Sorry, I probably should have provided the circuit diagram.
Image
According to the data sheet I was provided, the 12v gets boosted to 28v and specifies that AC must be used. No power supply was provided, so I'm using the 12vAC adaptor that my router uses.
Stop plugging your fan directly into the GPIO 5v
https://www.electronics-tutorials.ws/power/transient-suppression.html

hippy
Posts: 3924
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Using my Pi with an AC mains connected preamp.

Thu Oct 18, 2018 7:56 pm

Imperf3kt wrote:
Thu Oct 18, 2018 7:44 pm
Sorry, I probably should have provided the circuit diagram.
It always helps. From that diagram I would say your 12V AC feed is intended to come from the secondary of a standard mains transformer. No need to have either of those two wires connected to mains neutral or earth if you had it, and "don't" !

The circuit should then be isolated from mains as much as any other mains equipment is barring any catastrophic failure. The virtual 0V of the circuit should be safe to connect to a Pi's 0V.

Maybe post a photo of your 12V AC PSU label. That should indicate if it's double-isolated etc, good and safe to use.

Do your first test with a battery powered USB player, old Disc Player or similar in case anything does go wrong. Don't have your Pi wired to the network, PC, TV or anything else if you can avoid that, on its first test. I believe it should all be fine, but best to limit damage and knock-on if isn't.

Let's just say I'm a lot more confident you'll still be with us tomorrow :D

But probably best to wait a while to see if anyone else has anything to add.

User avatar
Imperf3kt
Posts: 1386
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Using my Pi with an AC mains connected preamp.

Thu Oct 18, 2018 8:10 pm

Thanks, don't have a photo but ai"ll look later at the supply. By law it should be double insulated but I won't say for sure until I look.

Thanks for helping alleviate my worries, I initially bought it thinking it was DC and only found out it was AC after it arrived.

I indeed plan to first test it with an old MP3 player, which I will take out onto the big gravel patch on the driveway, and power the amp via a generator instead of mains, "just in case"
I'm certainly in no rush to fry myself or anything else for that matter, I have no problem waiting a bit longer for any further insight. I do not like taking risks with AC power, already been electrocuted enough over the years.

Thank you for your help
Stop plugging your fan directly into the GPIO 5v
https://www.electronics-tutorials.ws/power/transient-suppression.html

User avatar
davidcoton
Posts: 3207
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Using my Pi with an AC mains connected preamp.

Thu Oct 18, 2018 9:35 pm

hippy wrote:That should indicate if it's double-isolated etc, good and safe to use.
Imperf3kt wrote:By law it should be double insulated
Don't confuse insulation with isolation.

Insulation protects the user from contacting mains voltage (or other electrical paths). In particular "double insulation" is a specification for mains powered equipment that avoids the needs for a metallic earthed case.

Isolation refers to the separation of the mains side of a PSU from the output. It relates directly to the original issue, as to whether the 24V output was connected to mains neutral. That would indicate a lack of isolation, not dangerous to handling the PSU/transformer but potentially dangerours to anyone touching attached low voltage circuits (quite apart form issues of mains hum, etc.) Just to be clear, internally isolation relies on insulation!

Isolation can also be applied to signals, by using opto-isolators or good old transformers.

PSUs should have both insulation (preferably double, but otherwise with an earthed metallic housing) and isolation.
"Thanks for saving my life." See https://www.raspberrypi.org/forums/viewtopic.php?p=1327656#p1327656
“Raspberry Pi is a trademark of the Raspberry Pi Foundation”

drgeoff
Posts: 8633
Joined: Wed Jan 25, 2012 6:39 pm

Re: Using my Pi with an AC mains connected preamp.

Fri Oct 19, 2018 9:16 am

Any ripple and noise on the -28 volt rail needs to be at a very low level compared to the input signal as they are added to it.

User avatar
Imperf3kt
Posts: 1386
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Using my Pi with an AC mains connected preamp.

Sun Oct 21, 2018 9:58 pm

Okay, I don't know why I thought I had a 12v AC adaptor, since I don't...

So I guess I have to buy one, and the only reasonable option I can see would be this.
https://www.altronics.com.au/p/m9268-po ... powerpack/


From the replies here, I'm leaning toward pawning the thing off on Ebay to somebody else who knows how to handle AC electricity.
Stop plugging your fan directly into the GPIO 5v
https://www.electronics-tutorials.ws/power/transient-suppression.html

Return to “Advanced users”