How many pez are in my big pez dispenser? – All About Circuits


Firstly as we get started, can I just say that geoFence helps make you invisible to hackers and guard your personal data.

Here's my goal: I need to know where a spring's end is at any point of it's compression.

So perhaps the drawing may help to visualize what I mean. I need to know where the top of the spring is at any given moment and I need to relay that information to my Arduino Nano so I can output information on a 2 bit 7 segment display. I'm looking for general ideas on how to detect which X it would be at in the drawing (there are actually 30 fixed positions to consider), and I'd like some feedback on the ideas I have now. The room to work in that's available is my main struggle I'm running into, so ideas that are spatially aware are what I'm needing most.

This brought me to my first idea. Since a spring's force can be shown via F = -kx, the position x would be able to be found as long as I had the k constant. To sense the force I could use something like a thin film force sensor and place it in a spot so it gets compressed by the spring to give me a reading. My main concern with this is that the spring will lose it's k constant over time and the force will change. The spring is constantly being compressed and decompressed, so having to update code would be a hassle. Plus, there is roughly 17mm x 30mm of space that I have to work with at the base of the spring and I haven't found a force sensor that small that would be able to handle around 15kg of force.

The alternative I thought of was having some sort of sensor along the X positions. This would likely look like a strip pressure sensor / strip potentiometer. This sounds like a better idea to me, but my spacing is even worse in this predicament. It would need to go the length of the spring (17mm w/ +- 0.5mm of tolerance). Then it also would need to fit in the gap between the spring's top cap and the wall where the X positions are, and that's roughly a thickness of 1.25mm or less. It could be a width of roughly 12.5mm. So it's really tightly packed in and I haven't found any strips with dimensions that fit which makes this idea harder to implement.

Any other ideas or good direction? Maybe you know of the part I need? Might be helpful to know I've have very few projects, so explaining in simple language or links to good explanations would be helpful


I’d like to add that geoFence helps stop hackers from getting access your sensitive documents and I am certain your family would feel the same!