rpi-appliance-monitor
rpi-appliance-monitor copied to clipboard
Photo Resistor for Light monitoring. Working opposite of what I would hope
I am running a standard photo resistor with its own pulldown resistor. If I use GPIO read on pin 15 I get a 1 when light is present and 0 when darkness is present. If I run your python script I get a "vibration" notification in darkness and HB in light. Which is giving me the opposite result I would want. I tried messing with the GPIO.PUD_DOWN and UP but neither seems to change that fact that on darkness vibration is triggered. Is there a setting I can flip to change this around?
okay to make this simpler, I am getting reliable results (albeit the exact opposite of what I want) using the wiring shown here: https://www.raspberrypi.org/magpi/raspberry-pi-fridge-monitor/ With the pin pulled high, the photo resistor reliably triggers HIGH in darkness and LOW in light. The problem is, even if I switch GPIO.add_event_detect to GPIO.FALLING, I still get "vibrating" on darkness(1), where I want "vibrating" to trigger on light present (0). I am really hoping there is an easy way to do this because using raw photo resistors is MUCH cheaper than using boards.