I have a LHI 968 PIR sensor. I have tried to connect it to Arduino as the following configuration.
G- GND
S- digital pin 3
D- +5v
but it is not giving any value. whenever i tried to print it's value using serial.println it was always 0. I have used this code. PinMode(3,INPUT) and digitalRead(3).
Please help me.
Hello ![]()
I Think that you must use an analog pin with this kind of sensor ! try to google "LHI968 arduino", i found this example in which they use this sensor to drive a PWM output in order to drive a LED:
Hope that it will helps you ![]()
Thanks man. I think that's gonna help. I will replay the result soon . XD
i see that your profile indicate that you are coming from india, where exactly from India (if you want to tell me this ;)) ?
I ask you that because i have a trip in India in November 2011 and it is a marvelous country ![]()
Waiting for the results of your experiments !
Hey man! ya I am from India ,West Bengal. Thanks for the help. I will post the result soon. I can't continue my exp. at this time coz my exams r running. But i have tried to understand the circuit. It was too complicated. Can u plz simplify the circuit ? Man I need some more help from u. coz I am taking part at a local robotics contest.
Hello !
Really sorry for this late answer (a lot of work and activities this last weeks) ! The scheme given in the link is not complicated but the fact that the author add the internal scheme of the sensor is disturbing ! so i will try to make it simple:
G- GND
S- Analog Pin (you have the choice ^^)
D- +5v
Add a 10 kOhms resistor between "S" and GND. Then make a simple sketch like this:
#define PIN_ANALOG_IN 0 //The analog pin number you choose
#define BAUD_RATE 9600 //Serial baud rate
// voltage at the FET source pin
int sourceVoltage;
void setup() {
Serial.begin(BAUD_RATE);
}
void loop () {
sourceVoltage = analogRead(PIN_ANALOG_IN); //read the result of the ADC conversion
Serial.print("Source voltage: ");
Serial.println(sourceVoltage); //Print the value
delay(250); //Delay between two readings
}