I hope you don't mean that - V+ and V- are the power supply pins! (+12V and 0V in your application).jerryk wrote:Thank you for the help. I was able to find an LM339 in my parts pile and it seems to fit the bill so far as tested in my mock up on the breadboard with the following exception. If V- > V+ the output is high. I thought it should be the opposite.
Thanks - Jerry
The Pi is guaranteed to read high for an input voltage above a certain level (probably the 2.2 volts you quoted), and is guaranteed to read a low for an input voltage below a certain level (1 volt, maybe). If the input voltage is outside these ranges, there's no guarantee as to what the Pi will read - and the result may vary with which batch of chips you have, temperature, supply voltage and so on.jerryk wrote: If I put an LED in the circuit on the emitter side it's forward voltage drops the emitter output from around 3.3V to 1.7V. When I look at the value of the Pi input pin receiving the 1.7V it reads high even with this low of an input voltage. My understanding is that an input pin on the Pi needs around a minimum of 2.2 volts to read high and as a good practice the voltage should be close to 3.3V.
So I'm wondering why it reads high with only 1.7V and if there is better way to incorporate the LED status light so that it does not produce this voltage drop on the emitter that is feeding the input pin to the Pi?
Code: Select all
def alertchange8(zone8): timenow = dt.strftime(dt.now(), '%Y-%m-%d %H:%M:%S') body =('alert - zone8 changed ' + timenow) print body client = TwilioRestClient(account='ACe5dd34f0c6e275a4ecb5df40', token='350caa5f7b27d0cad52b6ef1b') client.messages.create(from_="+12019866496", to="(907) 956-6650", body=body) time.sleep(5) def eventdetect(): #GPIO.add_event_detect(zone6, GPIO.BOTH, callback=alertchange) # GPIO.add_event_detect(11, GPIO.FALLING, callback=alertchange1, bouncetime=12000) # add rising edge detection GPIO.add_event_detect(12, GPIO.FALLING, callback=alertchange2, bouncetime=12000) # add rising #GPIO.add_event_detect(13, GPIO.FALLING, callback=alertchange3, bouncetime=12000) # add rising edge detection GPIO.add_event_detect(15, GPIO.FALLING, callback=alertchange4, bouncetime=12000) # add rising GPIO.add_event_detect(16, GPIO.FALLING, callback=alertchange5, bouncetime=12000) # add rising edge detection GPIO.add_event_detect(18, GPIO.FALLING, callback=alertchange6, bouncetime=12000) # add rising GPIO.add_event_detect(31, GPIO.FALLING, callback=alertchange7, bouncetime=12000) # add rising edge detection GPIO.add_event_detect(32, GPIO.FALLING, callback=alertchange8, bouncetime=12000) # add rising