I need help with a motion sensor and 2 LED strips connected to a 2 channel relay module

Yes! Thats exactly my problem... but at this point im curious why it just only works when is hocked up to my laptop... and the IDE reads up the input from the motion sensor and everything! but when I plug it to the wall, it just doesn't work.

The Arduino when it gets powered turns on the LED light (constant) and then relays are triggered with no input of the motion sensor and lights turns on even with the delay I put. If i change the time and delays and plug the Arduino to the wall relays get triggered with the new times... which is extremely annoying because it defeats the purpose of the motion sensor.

I already tried that too, it still has the same issues...

The first two digitalWrites in loop() should be moved to setup,
right after serialBegin(), so before pinMode.
Leo..

Hi, @Yarelix

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

How are you powering the UNO when the computer is disconnected?

Can you please post some pictures of your project?
So we can see your component layout.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

Happy mothers day, to your moms and/or if you are a mom, you all are amazing!

Ok, I uploaded a picture of the circuit made in Fritzing. Either way, I took a picture of the setup, its in a really uncomfortable place :sweat_smile: but I did my best.


But escentially its exactly the same thing I did at Fritzing...

But again, the big question is why it works when its hooked up in the computer and not when is plugged in with the Vin pin...

Im getting really frustrated at this, since its an extremely simple circuit/setup yet its given me so many problems...

@TomGeorge here is the message where I sent the Fritzing image

I recorded when I plug the Arduino and the relays gets triggered and when I have the laptop that it gets triggered by the motion sensor (as it should) hope that it helps

P.S. The video of the computer you can see the reflection on the screen of the lights switching on + the relay clicks

Hi, @Yarelix

Sorry it didn't attach.

When you unplug the computer, what do you have powering the UNO and to what pins?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

Hi, sorry I didn't reply earlier, this week I got sick. If you see the previous replies you will see the images and links I posted, but I can upload it again :grin: here it is!

LED lights are NOT addressable. Fritzing doesn't have any schematics for that, so I just used another one.

LEDs are 12V 2.0a
Arduino is connected through the Vin pin to another 12V 2.0a connector
PIR sensor is a hc-sr501
2 channel relay module is each with a maximum current rating of 10A at 250VAC or 30VDC (which is within spec)

This is what happens when I connect the Arduino to the wall connector vs the computer

I am really out of ideas... I just brought a multimeter from my job just to check the connector when is plugged to the computer vs the wall... I really need help :frowning:

Hi, @Yarelix

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, ALL power supplies, component names and pin labels.

With hand drawn diagrams you don't need a CAD library to draw components.

Do you have a DMM? Digital MultiMeter?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Just to follow up, I solved the issue, there was too much current going into the motion sensor, so I put a pull up resistor and that fixed the issue!

Where???

Tom... :smiley: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.