Reworked to add PIR input and LED output