I am working on an off-grid surveillence project.
At heart is an ATMEGA328P controlling 20watt solar panels, a 10watt LED floodlight and a 1amp mobile phone charger.
The system interfaces to the mobile phone via a JY-MCU Bluetooth module.
The system detects motion with a PIR module.
This all works but interference causes false motion triggers, and these triggering photo taking and uploading, so it has to be fixed.
When the high-current devices are switched, the current transient seems to trigger motion detection in the PIR.
The Bluetooth module also triggers motion in the PIR - but only sometimes - more often when the BT module is not actively connected with somethihng.
Shielding the BT module or the PIR in a metal foil, earthed covering doesn't help, neither doe moving the BT module a foot or so away.
Adding 5,000uF capacitance across the power lines also doesn't fix it, though it reduces it a bit.
Shielding the motion wire doesn't help.
I programmed in some "dead spots" around the power switching events - ignoring motion triggers (false or otherwise) for 3 seconds around them. This works, but is a miserable fudge and a (small) security hole, and it doesn't help with the BT module interference.
At this point, I'm out of ideas and hoping you have some for me. Any help appreciated.
Fungus, thanks but I can't afford the power overhead of two separate power supplies as this is a small solar project.
Thomas, thanks. The switching circuits are all similar. On the two low-side switches, an ATMEGA IO pin goes through a 10k resistor to the gate of a power MOSFET which controls current through the LED or the phone charger. On the high-side switch the IO pin goes to the base of a small general purpose transistor which holds off the power MOSFET. Physically, all components are in a project box on the front of which is the PIR sensor. So all components are within 4 inches of the PIR sensor.
I have tried putting the BT module on an extension ribbon cable, and moving it 10 inches away, also shielding it inside grounded foil - no effect.
When the high-current devices are switched, the current transient seems to trigger motion detection in the PIR.
The Bluetooth module also triggers motion in the PIR - but only sometimes - more often when the BT module is not actively connected with something.
Don't forget ground noise and ground loops as being potential issues. Try using separate and properly sized (gauge) ground wires, where each wire is connected to a common point.
Thanks Dloyd. The whole system is on a breadboard which won't help, I guess, but I don't want to commit it to something more permanent until everything works. Catch 22 maybe.. I tried running the PIR straight from the 12V lead acid battery, hopefully isolating it from any interference downstream of the 5v voltage regulator running the uC and everything else, but it got worse rather than better. I've ordered another PIR of a different manufacturer - perhaps that'll help.