All,
Having a problem with an new version of an old project. Here's the link, with pictures, code & schematic: http://www.picaxeforum.co.uk/showthread.php?19178-My-first-PICAXE-project-Chicken-lights-Greenhouse-watering&p=229434&viewfull=1#post229434
The problem is this: sometimes the lights are getting activated for no apparent reason. I can't detect a pattern to when it happens, so it could be noise. Given how the code works, there are two triggers to switch the lights on:
One is the voltage from the LDR, i.e. the light level. But I don't think that can be the problem, because the hardware and software are identical in this respect to the old version of the circuit, and there was no problem with that. There is some "hysteresis" built into the code to prevent re-triggering due to small changes in the light level.
The other is the push switch. This part of the circuit has changed compared to the previous version. It is now connected between pin C.3 on the 08m2 and 0V. The Pullup command replaces the series resistor on the old version of the circuit.
My suspicions centre around the switch: I have had trouble using pin C.3 before, which is the input-only pin on 08m2. It does seem to be more suceptible to noise. Also, the internal pullup resistors are sometimes described as "weak" pullups, not certain exactly what this means but suspect it means the equivalent external resistor could have a very high value - M-Ohms?
2 solutions I can though of, assuming my suspicions are correct:
1) set Pin c.3 to Schmitt Trigger. Am I correct, reading the manuals, this is not possible on 08M2, even though it can be done on other M2 series?
2) abandon internal pullup and attach 10K between pin C.3 and 5V.
Thoughts/advice please?
Paul
Having a problem with an new version of an old project. Here's the link, with pictures, code & schematic: http://www.picaxeforum.co.uk/showthread.php?19178-My-first-PICAXE-project-Chicken-lights-Greenhouse-watering&p=229434&viewfull=1#post229434
The problem is this: sometimes the lights are getting activated for no apparent reason. I can't detect a pattern to when it happens, so it could be noise. Given how the code works, there are two triggers to switch the lights on:
One is the voltage from the LDR, i.e. the light level. But I don't think that can be the problem, because the hardware and software are identical in this respect to the old version of the circuit, and there was no problem with that. There is some "hysteresis" built into the code to prevent re-triggering due to small changes in the light level.
The other is the push switch. This part of the circuit has changed compared to the previous version. It is now connected between pin C.3 on the 08m2 and 0V. The Pullup command replaces the series resistor on the old version of the circuit.
My suspicions centre around the switch: I have had trouble using pin C.3 before, which is the input-only pin on 08m2. It does seem to be more suceptible to noise. Also, the internal pullup resistors are sometimes described as "weak" pullups, not certain exactly what this means but suspect it means the equivalent external resistor could have a very high value - M-Ohms?
2 solutions I can though of, assuming my suspicions are correct:
1) set Pin c.3 to Schmitt Trigger. Am I correct, reading the manuals, this is not possible on 08M2, even though it can be done on other M2 series?
2) abandon internal pullup and attach 10K between pin C.3 and 5V.
Thoughts/advice please?
Paul