My wood shed is at the bottom of the garden. Currently i have a motion sensitive light (LED flood light) so i can see down there in the dark, problem is every beastie or gust of wind sets the light off! What i want to achieve is have my pi hooked up to the light via the GPIO and a relay (for the larger power) and for the pi to connect to my phone via bluetooth. I have a small circuit which i have tested with 3.3vdc and it works for switching the larger power on the relay. Im now trying to get the code working on the pi. I need the code to:
1- auto connect via bluetooth
2- once connected;
a) stop bluetooth search
b) set one of the pins (say 14) on the GPIO to HIGH for switching the relay.
3- when i walk away and the RSSI drops to say -10 for the pi to;
a) disconnect the bluetooth and search again
b) set the GPIO pin to low
So now when i walk to the shed it should sense me and turn the light on and when i walk away it should turn the light off. if this works i might add a speaker that tells the spiders and rats to go away when the light comes onto
I have my pi, bluetooth dongle, and my simple tested relay circuit. i have used my pi for a portable bluetooth audio system before so it should have the right bluetooth installation on it but now i have no idea where to start coding it?
If someone could point me in the right direction i would be very grateful!