Go Down

Topic: Arduino Duemilanove + Mega Sensor Shield V4 + PIR Body Sensor Movement (Read 1 time) previous topic - next topic

antopgomes

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: [Select]
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);
}
}

Grumpy_Mike

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.

antopgomes

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!

Grumpy_Mike

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.

terryking228

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

Some general information about sensor shields here: http://arduino-info.wikispaces.com/SensorShield
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

antopgomes

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

terryking228

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...

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

antopgomes

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

thank you all for the help  8)

Go Up