February 15, 2018 10:42 pm Update

I changed one line of code from pinMode(pirSensor, INPUT) to pinMode(pirSensor, INPUT_PULLUP) activating the internal pull up resistor on AtMega328 chip, making the PIR sensor properly turn on and off. Well that was easy.

Spent a lot of time scratching my head over it. Sure beats having to solder another doggone pull up resistor. Now the lights shut off when I leave my bedroom saving energy.

Leave a Reply

Your email address will not be published. Required fields are marked *