Pages: [1]   Go Down
Author Topic: Arduino Duemilanove + Mega Sensor Shield V4 + PIR Body Sensor Movement  (Read 1404 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,

I'm fairly new to arduino and I ran it some problems...I was trying to make an LED turn on and off but I'm not successful, I couldn't find any documentation on this shield and I don't know how to check if the sensor is working properly....can anyone help me!? Do I need a separate code to check the status of the sensors or I just need to open the serial monitor? I couldn't find if any of the sensors I tried were working...

Here are the pics of my setup:













Thank you for any help you can give me!

Btw, this is the code I tried:

Code:
int ledPin = 13;
int switchPin = 2;
int value = 0;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(switchPin, INPUT);
}
void loop() {
value = digitalRead(switchPin);
if (HIGH == value) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a resistor fitted in line with that LED? You need one.
Quote
I couldn't find any documentation on this shield
Then take it out for the moment. What does it do? and where did you get it? A link would be good.

Wire up the sensor directly to your mega. I think you have probably misidentified where pin 2 is on that shield.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

that would be here: http://www.ebay.com/itm/Arduino-Mega-Sensor-Shield-V4-digital-analog-module-/190581394447?pt=LH_DefaultDomain_0&hash=item2c5f894c0f

I will try to connect it directly to the duemilanove...to check if it's working, serial monitor should do it?

Thank you for your help!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I will try to connect it directly to the duemilanove
So do I take it you have a shield designed for a Mega attached to a duemilanove?
If so that is your problem. What is Pin 2 on a Mega is physically Pin 10 on a duemilanove.
Also the power and grounds are different on the two so that shield will not work on a duemilanove.
Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 24
Posts: 1763
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, That shield is only right for the Arduino MEGA...

Some general information about sensor shields here: http://arduino-info.wikispaces.com/SensorShield
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for letting me know ...it kind of makes sense that it wasn't working but this image made me believe this shield was for my arduino:



However, I'm trying to connect directly to the arduino but the outcome is the same....am I doing something wrong? i wanted to turn the led on/off by getting my hand in front of the sensor but do i need a separate code for that? is there any way to know if it's reading well?

Here´s my setup:



Thank you so much
Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 24
Posts: 1763
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, LOOKS like it's wired right...

When you plug in the Arduino, connected this way, does the LED come on right away??

You would need to move far away from the sensor and not move for it to stop "sensing"..

Look at: http://arduino-info.wikispaces.com/Brick-Pushbuttons%26OtherSwitches#Motion
and try adjusting that orange control...

Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yup it works, i guess it was just too sensitive!

thank you all for the help  smiley-cool
Logged

Pages: [1]   Go Up
Jump to: