07
Lesson 2 – Vibration detector
Introduction
Crowduino UNO-SD/Arduino UNO x1
Crowtail – Vibration Sensor x1
Crowtail – LED x1
Crowtail – Base shield x1
Crowtail – Cable x2
USB Cable x1
Required Parts
STEP1:
Plug the Crowtail-Base Shield
onto the Arduino or Crowduino Board.
Hardware Connection
STEP2:
Connect Crowtail-Vibration
sensor to Crowtail-Base Shield D4 port
and Crowtail-LED to D2 port. The
complete connection is as follows:
Open the
P02_Vibration_Detector
with
Arduino IDE and upload it.
The Crowtail-Vibration Sensor is a high sensitivity non-directional
vibration sensor. When the module is stable, the circuit is turned
on and the output is low. When the movement or vibration occurs,
the circuit will be briefly disconnected and output high. At the
same time, you can also adjust the sensitivity according to your
own needs. It is widely used to report the theft alarm, intelligent
car, earthquake alarm, motorcycle alarm, etc.
In this lesson, we will use vibration sensor and LED to make a
vibration detector that you can use to detect earthquakes and
theft.
Put the Vibration sensor on the table or hold it in your hand and shake it. You will see the LED light
on as you shake. When you stop shaking, the LED will turn off.
What will you see
1. Declare the variables for vibration sensor and LED and assign values to them.
Code overview
Содержание Crowtail
Страница 48: ......