Moving membranes or piezoelectric materials obviously produce sound waves, but how can "purely" electrical circuits such as transformers or DCDC choppers (and others) often have an audible noise? Is the material microscopically expanding and shrinking with the current?
What you are really asking is how can electrical circuits cause small motions. After all, sound is motion of the air.
The answer is that there are various ways electric fields or electric currents can cause forces or motions. These effects are harnessed in the design of various transducers, which exist to deliberately cause or sense small motions. However, the laws of physics that allow these transducers to function don't stop outside the transducer case. They exist everywhere, so many things are unintended transducers. The difference is that usually the effect is rather weak without it being deliberately designed for as in a transducer.
Some of these effects are:
- Electrostatic force. Two objects at a different voltage will have a force between them. The force is proportional to the voltage and inversely proportional to distance. This is the same force that allows a balloon to stick to your hair after rubbing it against a cat or something. For ordinary circuits, this force is very weak, and conductors are held in place much more strongly than it. Still, you can sometimes get audible sound from this with high voltage circuits.
- Electrodynamic force. A moving charge creates a circular magnetic field around it. The magnetic field is proportional to the current, and can be made quite strong by looping the wire into a coil. This magnetic field can be made to move things, and is the basis for how solenoids, motors, and loudspeakers work.
Moving charges likewise experience a force if flowing thru a magnetic field of the right orientation. Most loudspeakers actually work on this principle; they are made so that a strong permanent magnet is fixed and the coil moves, which in turn moves the center of the speaker cone. The same thing happens in any inductor. Each piece of wire with current thru it experiences some force due to the overall magnetic field. Some of the buzzing you hear from transformers is individual pieces of wire moving a little bit as a result.
- Piezoelectric effect. Some materials, like quartz for example, will change their size or shape slightly as a function of applied electric field. Some small earphones work on this principle. There are also "crystal" microphones that work on this principle in reverse, meaning applying force to the crystal causes it to create a voltage. Common barbecue grill ignitors work on this principle by whacking a quartz crystal hard and suddenly enough to create a high enough voltage to cause a spark.
Some capacitor materials exhibit enough of this effect that when rigidly mounted on a circuit board can cause audible sound. I had to respin a board once and replace a ceramic cap with a electrolytic just because the ceramic was causing annoying audible whine.
- Magnetostrictive effect. This is the magnetic analog of the piezoelectric effect. Some materials change shape or size depending on the applied magnetic field, and this effect works in reverse too. I have worked on magnetic sensors that exploited this effect.
Materials in transformers and inductors are chosen to not have this effect, but a small amount is there anyway. The core of a inductor actually changes size very slightly as the magnetic field changes. This can cause audible sound, especially if the inductor is mechanically coupled to something that presents a greater area to the air, like a circuit board.
An ideal inductor or transformer might be a purely electronic component, but a real inductor or transformer produces a (rapidly changing) magnetic field. It is a design aim of such a component to keep that magnetic field within the component (for instance inside the ferromagnetic core), but that won't be achieved for 100%. The 'leaking' magnetic field will cause things to move (vibrate), and these things will make the air around them move likewise. Presto: a (unwanted) electromagnetic speaker.
A similar effect can probably be had in high-voltage capacitors, where the conducting plates attract each other depending on the voltage. This corresponds to an electrostatic speaker :)
A third effect is (unwanted) piezoelectric effects in components. I am not sure if this is actually the case in an observable level.
It isn't expanding or contracting the material, that emits the sound in transformer or inductor-based circuits. However the parts are moving.
Transformers are subject to significant mechanical forces caused by the alternatine electromagnetc fields. That causes wires and laminations to move, and hence emit sound. DC-DC converters often have wound inductors, which also move for the same reason.
Here is one more
Sound by changing properties of surrounding plasma or gas due to exposure of an electrical field and/or electrical discharge
Based upon the "Singing Arc" which was discovered around 1900 by William Duddell, the Ionophone or as it is mostly called plasma speaker/tweeter (is actually used in speakers) produces sound waves by charging plasma to change the size of the plasma within a usually narrow field between electrodes. Due to the very low mass that has to be moved this speaker can produce a very accurate reproduction of the waves feed to the electrodes, especially good for high frequencies.
Another effect not yet touched upon is wire straightening under load - wires do tend to straighten when current is passed through them, whether microscopically or visibly. The wire within a power transformer's windings tries to straighten very slightly 100 to 120 times per second (depending upon the frequency of municipal power).
This phenomenon can be very readily observed when "jump starting" a vehicle with smallish jumper cables, especially if the vehicle being started has a badly depleted battery. When the starter is engaged, it's often easy to see the jumper cables "jump" and stiffen as they straighten slightly under heavy loading.
Moving membranes or piezoelectric materials obviously produce sound waves, but how can "purely" electrical circuits such as transformers or DC/DC choppers (and others) often have an audible noise? Is the material microscopically expanding and shrinking with the current?
While others have explained the part about the material moving nicely, one key point is that Audible noise requires movement in the human audible range. Typically that means 20 Hz to 20 kHz, but can be slightly lower or higher, as well as accounting for age/hearing loss. Anything oscillating above or below that range (Infrasonic or Ultrasonic) will not normally be heard. As luck would have it though, that range is the typical used in many circuits, from DC/DC choppers, transformers, EL Panel Inverters, PWM for Light Circuits, so its often a byproduct.
There's been a lot of theory here. In practice, usually loose wires of inductors are involved. Tapping around on the coils (not!!!! with anything magnetic like a screw driver: trying that on coils in CRT flyback circuitry is something you don't do more than once) may help locating the culprit, and suitable warm glue or nail polish may help getting it under control.
From my experience, most of the time a transformer makes noise, is due to a loose lamination or a loose mounting. A mechanical chopper makes noise because the reed that "chops" the current moves/vibrates. Obviously anything that moves, makes a sound. A transformer usually produces a 60 Hz hum, while a chopper depends on the frequency for which it was designed (typically 400 Hz).
I don't believe that the material is microscopically expanding and contracting, but if it were, the frequency would be so high it would be inaudible. In addition, it might not be loud enough.