Tilt Sensor Experiments
After completing the Tilt Sensor project, test yourself by trying these experiments.
| 1 | The tilt sensor connections are exactly the same as the push button connections. |
| |||||||||||||||
| To simplify the connections (just like with the push button) we can use the internal pull-down resistor instead of the external resistor. |
| ||||||||||||||||
|
To use the internal pull-down resistor, change the tiltSensor |
| Remove the external 22K ohm resistor and the wire that connects the resistor to GND on the breadboard and then run your modified program.
| You should get the same result. 2
| In addition to the internal pull-down resistor, each digital pin on the Arduino also has an interal pull-up resistor,
i.e. the resistor is connected to +5V instead of to GND.
| In order for this to work, the other end of the tilt sensor is connected to GND instead of to +5V.
|
| To use the internal pull-up resistor, set the
| Run your modified program.
| You should get the opposit result, i.e., the LED turns off when the tilt sensor is not tilted (upright). 3
| Create a device that will sound an audible alarm and flash a red warning light when an object has fallen over.
Hint: Combine a tilt sensor, buzzer, and a red LED.
| | ||||||