Hi, when checking the schematic with the image of the original PCB, it seems to me that the PIR connections are not correct, having to be changed 1 by 2, 2 by 3, 3 by 4 and 4 by 1, besides the resistor R8 does not connect to the pin 5 of U2, should be connected to Q1 base.
Can you please tell me if what I indicate is correct?.
Are you referring to the pinout in the datasheet PDF for the PIR sensor I posted earlier? If so, I can see how you might think that - but, no, for two reasons. Firstly, the pinout in the datasheet - despite not being labelled so - is bottom view. So when viewed from the top, it's mirrored, with ONTIME on the left and REL on the right. In addition to that, when laying out my PCB I was lazy and used an existing pattern/footprint for a TO-39-4, which had pin 1 marked at the 9-o'clock position, not the 12-o'clock position, and assigned the pins correctly according to the locating tab, not the numbers.
So, what I have is correct (it works) but doesn't match the datasheet by numbers.
I see I did get the order of R8 and R7 mixed up. The R8 pull-down does indeed come after the R7 series resistor. No matter, it's functionally the same either way.
Do you have the code for the PIC?
No. I wasn't concerned with getting the code off the existing chip. And it was only an educated guess that it's a PIC. I don't really know for sure.