background preloader

Les capteurs

Facebook Twitter

Arduino Your Home & Environment: Light Sensing with a Cds (LDR) A Cadmium Sulfide (CdS) sensor is a Light Dependent Resistor (LDR).

Arduino Your Home & Environment: Light Sensing with a Cds (LDR)

It is a resistor that reduces resistance when hit with light. The more light, the lower the resistance. The Arduino is ideal for monitoring one of these sensors, and can be the heart of a streetlight or burglar alarm system, turning devices on or off in the presence of light. It could also be used in photography or solar applications, detecting the amount or direction of light. See the following sketch for ideas. /*Cds Connections:CdS Pin 1 to +5vCdS Pin 2 to Analog Pin 310k ohm resistor pin 1 to Analog Pin 310k ohm resistor pin 2 to Gnd*/ int analogPin = 3; // CdS (ldr) connected to analog pin 3int val = 0; // variable to store the read value void setup() { Serial.begin(9600); } void loop() { val = analogRead(analogPin); // read the input pin Serial.println(val); delay(100); }

Arduino Your Home & Environment: Motion Sensors & SSR's. A Motion Sensor is a good way to save energy, by turning lights on and off based on the presence of a warm body.

Arduino Your Home & Environment: Motion Sensors & SSR's

Walk into a room, the lights come on, walk out, and they go off. We can build in a delay on the off cycle, and a manual override with a switch giving us motion - off - on modes. Now also on Instructables! First we start with the PIR Motion Sensor. This connects to a digital input, which we monitor for the presence of a warm body. int ledPin = 13; int switchPin = 2; int value = 0; void setup() { pinMode(ledPin, OUTPUT); pinMode(switchPin, INPUT); digitalWrite(ledPin, LOW); } void loop() { value = digitalRead(switchPin); if (HIGH == value) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); } } This turns on the LED on the Arduino when motion is detected. Unplug from wall before doing this step! Strip the insulation from the two ends you have from the one line, and insert them under the SSR screws labeled 1 & 2. Now lets add a manual override switch. Void loop() { Arduino Motion Sensor. Make your own Arduino motion sensor / detector.

Arduino Motion Sensor

Maybe you want something to happen when you walk into a room, like have the lights turn on, or have your theme song play whenever you enter. This tutorial will show you how to get your to Arduino sense motion around it. Software used in this tutorial can be downloaded here: Arduino Motion Detector Software Example Hardware used in this tutorial: Motion Sensor for Arduino, with wire jumpers Arduino board (Uno, Mega, Duemilanove, etc.) Instructions: If this is your first Arduino project, first go through our “Arduino: Getting Started” tutorial. Connections: Use the supplied male to female jumpers to make these connections: Like this: Arduino Controlled Motion Sensor. Materials needed: 1.

Arduino Controlled Motion Sensor

Any Arduino or a deviation of it should work perfectly fine for this. $30 for the standard Uno. As long as it can be programmed by the Arduino IDE you will be fine. 2. A PIR sensor. I am using the Parallax PIR sensor. You can get it for about $10. The Parallax PIR sensor I use requires a 10-60 second warm up time in order to calibrate itself. Here is how I have my PIR set up. My PIR module has the jumper on the back set on H - retrigger. During the warmup period, the red LED blinks two times per second. To use a buzzer, simply wire that up in place of the LED and remove the resistor. DIY Arduino PIR Motion Sensor Lighting & Security. From the minds at We wanted to save energy, and create convenience, by adding motion sensors to our lighting circuits.

DIY Arduino PIR Motion Sensor Lighting & Security

Maybe you want some notification of an intruder. Both can be done with a PIR Motion sensor. When I walk into a room, the lights come on automatically, and when I leave, shut off after a short period of time. You can choose how long that time delay is in the code. I also wanted a override switch for times I want the light to stay on, or off. So, I took an Arduino, added a PIR sensor, a SSR, a SPDT switch, two 10k ohm resistors and whipped up a small sketch to glue it all together.

Original article, and more at Multiple motion sensors, and multiple SSR's can be serviced by a single Arduino. A CdS light sensor can be added to prevent the lights from activating if light level's are considered sufficient (user programmable).