https://github.com/xboxone08/bbbulb
Big Brain Bulb allows you to control LEDs using BlueDot and GPIOZero for Raspberry Pi GPIO
https://github.com/xboxone08/bbbulb
Last synced: 2 months ago
JSON representation
Big Brain Bulb allows you to control LEDs using BlueDot and GPIOZero for Raspberry Pi GPIO
- Host: GitHub
- URL: https://github.com/xboxone08/bbbulb
- Owner: xboxone08
- Created: 2022-07-30T02:15:12.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-18T02:37:09.000Z (about 1 year ago)
- Last Synced: 2024-03-18T07:20:03.588Z (about 1 year ago)
- Language: Python
- Size: 5.89 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Big Brain Bulb
Big Brain Bulb allows you to remotely control an LED with your phone and Raspberry Pi equipped with a motion sensor by using the BlueDot and GPIOZero modules.
You can set it to "Always On" or "Motion-Activated" mode.
"Motion-Activated" mode will automatically turn the light on when motion is detected between 7:30 PM and 6 AM.# Usage
## Setup
### Hardware
#### Supplies
- Raspberry Pi with GPIO header
- Female-to-female jumper wires
- A 3-pin PIR Motion Sensor module
- An LED
- A resistor
#### Steps
- Orient the PIR module with the pins facing down and toward you
- For the following steps, refer to [this reference](pinout.xyz) if you need to
- Connect the leftmost pin to a 3v3 on your Pi with a jumper wire
- Connect the middle one to GPIO10 on your Pi likewise
- Connect the rightmost to ground (GND) in the same way
- Connect the LED cathode (shorter leg) in series with the resistor to GPIO 14
- Connect the LED anode (longer leg) to ground (GND)
### Software
- If not already done, pair your phone and Raspberry Pi (put one in discoverable mode and send a pairing request from the other)
- If not already installed, install the [BlueDot app](http://play.google.com/store/apps/details?id=com.stuffaboutcode.bluedot) on your phone
- Open a terminal window on your Raspberry Pi
- Clone this repository to your Raspberry Pi using `git clone https://github.com/xboxone08/bbbulb.git`
- Change directory into the newly cloned directory using `cd bbbulb`
- Create a virtual environment using `python3 -m venv --system-site-packages venv`
- Activate the virtual environment using `source venv/bin/activate`
- Install the dependencies (BlueDot and GPIOZero) to your Raspberry Pi using `pip3 install ` for each
## Running
- Run `main.py` with Python3 on your Raspberry Pi (`python3 main.py`)
- Once the program prints, "Waiting for connection", connect to your Raspberry Pi from the BlueDot app on your phone
## Using
The button in the BlueDot app on your phone displays the light's status:
- The shape, square or circle, denotes the "Always On" or "Motion-Activated" mode, respectively.
- The color, white or black, denotes the light being on or off, respectively.
Tapping the button which toggle the mode.