This simple circuit uses an Arduino Uno clone to turn five LEDs on and off in sequence with intervals of 2 seconds - much easier than using a 4020 IC. The five LEDs are connected to the digital I/O pins (2,4,6,8, and10). The 330 ohm resistor that connects to the ground pin limits current. On the left is the code for the test program.
Knock Sensor Circuit
In the circuit above, the board is connected to a piezo sensor and a 7 segment. When the sensor detects a knock or vibration, it sends a signal to analog pin 0 of the microcontroller. Counts are displayed on the 7 segment display. When the count reaches 10, it will go back to zero. The variable hitscount in the code below stores the value. Sensitivity is set by the variable threshold.
No comments:
Post a Comment