I wanted to use a spring with a pole down the center of it for collision detection. When the car hits something it'll press the spring into the pole completing a circuit that the arduino would detect, however I'm not sure how the arduino could detect this?
If I set a digital pin to input and put +5v to the spring will the digital pin return high when the circuit is complete?
I just wanted to make sure before I try it and break something
steamos:
Sounds like a plan I'll give it a go tomorrow, thanks for the help!
You might also do two other things:
Put a small mass on the end of the spring (depending on the stiffness of the spring)
Use pin interrupts
I suggest the first because if the spring isn't massive enough (or is too stiff), it may only make contact when there is a large jolt, when you want it to contact on smaller collisions.
The second is important because unless your polling loop is very quick, you might actually miss the contact of the spring with the center conductor; using an interrupt will help to prevent this, while allowing your code to do other things in the meantime.