Switching a Circuit on-and-off In-step with the Rotation of a Drive-shaft (Mechanically)

I'm working on a project. The Salient part here is a drive-shaft connected to a bearing, onto which a simple circuit is mounted. I want to switch the circuit on every $$π$$ and off for the other $$π$$ of a full $$2π$$. In other words, I want it on for every half rotation. I want to do this mechanically because non-mechanical solution seem like they might be hard to sync. Also, the solution needs to interfere with the machine's operation as little as possible. It is a complex machine that will be subjected to high moisture and so forth, so ideally, the switching system would entirely co-rotate with the shaft.

I don't know if there are any 'ready made solutions,' or not, but i'd be thankful to be pointed in the right direction (towards something plausible), or told I should wing it and create something from scratch (presumably because there isn't any solution that can simply be bought at a hardware shop).

thanks.

• Does your simple circuit have have a micro-controller. A micro-controller will solve your problem. Jul 17 '20 at 1:20
• @MahendraGunawardena Thanks for the answer, but I would think that would have issues because the thing involves variable RPM. Jul 17 '20 at 1:41
• @MahendraGunawardena In addition, I'd rather not complicate things too much with sensors, ETC... Jul 17 '20 at 1:43
• 2 magnets, a sensor and a relay that stays on until the next pulse. Jul 17 '20 at 7:15
• How fast is it spinning? Jul 17 '20 at 7:20