0

First question so hoping I have done it right.

I have a simple script I found online that sends a pushover notification when it detects upto about 3v on one of the GPIO pins. I have used it to connect to the LED on my doorbell so when its pressed it flashes the LED and the notification is sent, it worked fine for 15 minutes while testing until I had wired it all up and then it stopped.

Initially when there was 3v passed between GRND and GPIO23 it would work, but now it works even when I touch a 15cm jumper cable too it and continually runs the script. I have tried on two separate Raspberry Pi Model B's

Does anyone know why it would do this?

Thank you very much for your time.

! /bin/bash

app="Doorbell" 
message= 
title=Doorbell
url= 
url_title= 
priority=1
device= 
sound=magic 
userkey=
apikey=

while true

do

gpio wfi 4 rising

curl https://api.pushover.net/1/messages.json -F token=$apikey -F user=$userkey -F message="There is someone at the door!" -F title=$title -F sound=$sound

done

1 Answer 1

1

Your question is vague - you don't describe what you have connected.

It looks like you have left the GPIO input floating, so it would pick up any interference.

You need to connect a pullup (or pulldown) resistor to the GPIO pin. From what I guess you have I suggest 4.7k resistor between the Pi and ground. You should also put a resistor in series to protect the Pi from damage.

There is plenty of good material on interfacing to the Pi. MagPi has many introductory articles. https://www.raspberrypi.org/magpi/issues/

1
  • Thank you very much, I will add this to my circuit and see. :)
    – S Webb
    Commented Jan 30, 2014 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.