Vibrator with Arduino
Materials:
- Arduino board
- Vibrator motor
- Jumper wires
Circuit:
- Connect the positive wire of the vibrator motor to digital pin 3 of the Arduino board.
- Connect the negative wire of the vibrator motor to the ground (GND) pin of the Arduino board.
Explanation: The code sets up digital pin 3 as an output pin and then uses the digitalWrite() function to turn the vibrator motor on for 1 second and then turn it off for 1 second. This process repeats forever, creating a vibrating pattern that is on for 1 second and off for 1 second.
Instructions:
- Connect the circuit as described above.
- Upload the code to the Arduino board using the Arduino IDE.
- Turn on the power to the Arduino board.
- Observe the vibrator motor vibrating for 1 second and then stopping for 1 second. This process will repeat indefinitely as long as the Arduino board is powered on.
Note: Ensure that the vibrator motor is compatible with the voltage of the Arduino board’s digital pin output. If the motor requires a higher voltage, a motor driver circuit may be necessary to prevent damage to the Arduino board.