Component question...what kind of switch would work in a wearable hat?

Component question…what kind of switch would work in a wearable hat? I saw an effect at a Cirque du Soleille performance that I want to emulate. The performer removed the hat and lights inside the hat came on and ran an animation. So, the switch would need to be flat enough to be comfortable while wearing the hat, and spring loaded so it would close when the hat is removed. All suggestions much appreciated.

Off the top of my head… I’d say using a proximity sensor would probably be the most effective and least invasive.

I wouldn’t want a push button against the side of my head for extended periods of time! It’s also probably going to be less prone to going off accidentally while moving.

a photocell pointed away from the the hats lights might work… when you take the hat off, presumably the stage lighting or whatever would trip the photocell.

If you want an actual switch you might try something like this that you could sew into the hat somewhere where you naturally grab/hold the hat when taking it on/off. Then secretly give it a squeeze as you take the hat off to start your lights.

Also, here’s a flat button (not a switch) that could be sewn into a hat that could trigger something on the sly.

(edit- it would help if I actually included the links!)

MCU and accelerometer would give any number of possibilities. The hat would then be smart enough to know it is upside down and the MCU could control the LEDs. (The irony in my reply is that I’m attempting to skip a second microprocessor in my post just now. LOL)

A tilt switch set to close when the hat is upside-down. A small push switch you operate by hand when you take it off.

Thanks for the ideas. Since I am planning to use a Flora for the lights and I happen to have an accelerometer lying around, I might go that way as the first experiment. That would also let me make the lights respond to different hat orientations, which I had not thought about.
Thanks again.

Ooooh. A stationary point while rotating the hat would be a cool animation; have it change hues and size depending on the speed of rotation…

Must. Find. A. Reasonable. Project. To. Put. This. In!

That’s the one complaint I have about this community, too many ideas!