Demonstration
Different from general camera, Grove - Mini Camera can be controlled by Arduino/Seeeduino.
Now let's use the Grove - Mini camera to achieve this function: shoot a picture every time when someone
approaches.
To do it, we need a
Grove - PIR Motion sensor
which can spot any motion within a certain scope.
Let's start to make it:
Plug SD card into SD card socket, SD card is not included in this Grove and its size can't be larger than 32G.
Connect Grove - Mini Camera to D2 port of
Grove - Base Shield
, and Grove - PIR Montion Sensor to D5 port.
Plug Grove - Base Shield into Arduino/Seeeduino, then connect Arduino/Seeeduino to PC using a USB cable.
Open Arduino IDE, copy and paste the code below to a new sketch:
/*Using digital 2 to control Camera*/
/*Using digital 5 to receive sensor signal*/
#define KEY 2
#define PIR_MOTION_SENSOR 5
void setup()
{
Serial.begin(9600);
pinMode(KEY,OUTPUT);
pinMode(PIR_MOTION_SENSOR,INPUT);
delay(100);
enterStandbyMode();
makeVideo(5000);
}
void loop()
{
int sensorValue = digitalRead(PIR_MOTION_SENSOR);
if(sensorValue == HIGH) //when the sensor value is HIGH, someone is in here
{
takePicture();
delay(5000);