High pitch sound from electronics...

The other day I noticed my Xmas tree makes a high pitched whistling sound when it's turned on.

I've noticed this in other gadgets, too, but never in something so simple (two chips a ceramic capacitor and a couple of resistors). Does anybody know what causes them? Surely a sound requires a mechanical vibration....

Many systems are driven by a "black box" which contains a switched-mode power supply. This uses a ferrite transformer (they tend to emit "mechanical" noise) and you are probably hearing either the frequency of oscillation or a sub-harmonic of it. Line transformers on early TV sets were notorious for the circa 20kHz whistle they produced, but only kids, cats and dogs were bothered by it.

In your case it could be the ceramic resonators that you are hearing (resonator being the key word)

jackrae:
In your case it could be the ceramic resonators that you are hearing (resonator being the key word)

The Tiny85 is using its internal clock. Could it be the decoupling capacitor?

Edit: It could be... google turned up some references to audible noise from ceramic capacitors.

It's actually amazingly simply to create sound from electrical "voltage" oscillations. As a youngster I "discovered" that by using a neon type screwdriver with the 'live" end stuck into a 240v live socket, and the "finger" end place into the ear using a steel knitting needle as a bridge-piece, one could actually hear the 50hz hum. Of course that was in the days when you were able to experiment without the safety elves ensuring that we all ended up frightened to live. I lived to tell the tale.

If it's the capacitor then Mike's circuits must sound like a symphony from hell...

Most common-or-garden ceramic capacitors are barium-titanate formulations, which is a perfectly decent piezo electric material
and ferro-electric - ferro electrics are automatically microphonic and have high dielectric constants -
hence their use in high value ceramic capacitors and piezo elements.

Such capacitors are used where the precise value and linearity is not important - ie decoupling. Not a
good choice for an audio amplifier though.

Lower value ceramics can be non-ferro-electric and much more temperature-stable - there are many ceramic dielectric materials to
choose from

Speaking of a screwdriver, you might try actually localizing the source of the sound by
holding a flat screwdriver tip against the various components, and then placing your
ear against the handle, as a sort of mechanical-to-ear transducer. This works on auto
engines for listening to the sound of valve tappets, for example.

Just a thought. Get the data, then, form a hypothesis.