Remix.run Logo
kelnos 7 days ago

Why though? That seems unnecessarily complex? It seems fine to me to just use a reed switch and sleep when it's closed or very close to closed.

missinglugnut 7 days ago | parent | next [-]

It's one sensor in both cases, and in the latter case you can do so much more: change the thresholds in an update, detect when the lid is in the process of closing, apply hysteresis (on a simple switch, there's an angle where vibration could cause it to bounce between reading open and closed, but with an angle sensor you can use different thresholds for detecting and open and closing state change).

But most of all...you don't have to commit to a behavior early in the design process by molding the switch in exactly the right spot. If the threshold you initially pick isn't perfect, it's much easier to change a line of code than the tooling at the manufacturing plant.

Reason077 7 days ago | parent | prev [-]

Why use two sensors when one will do? If you already have an angle sensor, it makes sense to get rid of the reed switch and reduce your production costs.