mirror of
https://github.com/rodneyosodo/automating-home-lights.git
synced 2026-06-23 04:10:15 +00:00
@@ -12,30 +12,33 @@ A demonstration of using nodemcu connected to a solid state relay to switch on a
|
||||
## Prerequistes
|
||||
|
||||
#### Software
|
||||
* Docker
|
||||
* Ngrok
|
||||
* LocalXpose
|
||||
* Make
|
||||
* Python3
|
||||
* Putty
|
||||
* esptool
|
||||
* ampy
|
||||
* [Docker](https://www.docker.com/)
|
||||
* [Ngrok](https://ngrok.com/)
|
||||
* [LocalXpose](https://localxpose.io/)
|
||||
* [Make](https://www.gnu.org/software/make/)
|
||||
* [Python3](https://www.python.org/)
|
||||
* [Putty](https://putty.org/)
|
||||
* [esptool](https://github.com/espressif/esptool)
|
||||
* [ampy](https://github.com/scientifichackers/ampy)
|
||||
|
||||
#### Hardware
|
||||
* Nodemcu
|
||||
* Jumper wires
|
||||
* Solid state relay
|
||||
* Extension cable
|
||||
* Lamp
|
||||
* [Nodemcu](https://store.nerokas.co.ke/index.php?route=product/product&product_id=1764&search=nodemcu&description=true)
|
||||
* [Jumper wires](https://store.nerokas.co.ke/index.php?route=product/product&product_id=120&search=jumper+wires&description=true)
|
||||
* [Solid state relay](https://store.nerokas.co.ke/index.php?route=product/product&product_id=1679&search=relay&description=true)
|
||||
* [Power strip](https://www.amazon.com/GE-Outlet-Protector-Extension-14092/dp/B00DOMYL24/ref=sxin_9_ac_d_rm?ac_md=1-1-c3VyZ2UgcHJvdGVjdG9yIHBvd2VyIHN0cmlw-ac_d_rm&cv_ct_cx=extension+cable&dchild=1&keywords=extension+cable&pd_rd_i=B00DOMYL24&pd_rd_r=13edf795-4726-4731-b57b-f7a50b5aa0ee&pd_rd_w=clOKK&pd_rd_wg=I8lmf&pf_rd_p=7140382f-2020-43a7-a2a8-20d62e199d2c&pf_rd_r=9V2S23H0ZJX2B5C3QJ3Y&psc=1&qid=1593528577&sr=1-2-12d4272d-8adb-4121-8624-135149aa9081)
|
||||
* [Lamp](https://www.amazon.com/Limelights-LT2024-GRY-Brushed-Charging-Outlet/dp/B075Z643G4/ref=sxin_9_ac_d_rm?ac_md=0-0-bGFtcA%3D%3D-ac_d_rm&cv_ct_cx=lamp&dchild=1&keywords=lamp&pd_rd_i=B075Z643G4&pd_rd_r=7f4912db-809b-48fc-abbd-8a21e0827c56&pd_rd_w=zc3Lo&pd_rd_wg=mTBoM&pf_rd_p=dc697a3c-c4bf-4bf1-bf88-86b22dd0aad3&pf_rd_r=4AQD4QVQE9VAX33T1Z0F&psc=1&qid=1593528538&sr=1-1-12d4272d-8adb-4121-8624-135149aa9081)
|
||||
|
||||
## Getting started
|
||||
To get this project up and running on your machine, follow the following instructions.
|
||||
|
||||
#### Dialogflow
|
||||
Check out the documentation to get yourself up and running with the dialogflow agent
|
||||
Check out the wiki to get yourself up and running with the dialogflow agent
|
||||
|
||||
#### Hardware
|
||||
Check out the documentation to setup the hardware
|
||||
Check out the wiki to setup the hardware
|
||||
|
||||
#### Micropython
|
||||
Check out the wiki to setup micropython
|
||||
|
||||
#### Programming
|
||||
This instructions will be different for windows users.
|
||||
@@ -50,64 +53,12 @@ cd automating-home-lights
|
||||
pip3 install -r requirements.txt
|
||||
```
|
||||
|
||||
#### Getting started with micropython
|
||||
## Contributing
|
||||
Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
|
||||
|
||||
## License
|
||||
This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/0x6f736f646f/automating-home-lights/blob/master/LICENSE) file for details
|
||||
|
||||
#### Getting started with dialogflow
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
- Git flow:
|
||||
|
||||
- https://github.com/petervanderdoes/gitflow-avh
|
||||
- https://github.com/bobthecow/git-flow-completion
|
||||
- https://github.com/pytest-dev/pytest-cov
|
||||
|
||||
- legit: https://github.com/kennethreitz/legit
|
||||
- SemVer: http://semver.org/
|
||||
- pytest: https://github.com/pytest-dev/pytest
|
||||
- tox: https://tox.readthedocs.io/en/latest/
|
||||
- sphinx: http://www.sphinx-doc.org/en/stable/
|
||||
|
||||
Todo
|
||||
----
|
||||
|
||||
- [x] Test todo list
|
||||
- [ ] Test todo list
|
||||
## Acknowledgments
|
||||
- [PythonKe](https://www.meetup.com/Python-Nairobi/)
|
||||
- [AI Saturday Kenya](https://www.meetup.com/AI-Saturdays-Nairobi/)
|
||||
+11
-15
@@ -59,25 +59,21 @@ You’ll also need to place the relay module in line with the AC powered device
|
||||
|
||||
If your AC device is going to be off for most of the time, and you occasionally want to turn it on, you should connect the other to NO. Connect to NC if the device will be on for most of the time.
|
||||
|
||||
|
||||
|
||||
### Programming
|
||||
|
||||
```cpp
|
||||
int RelayPin = PA6;//declaring the pin to which input pin of relay module is connected.
|
||||
```python
|
||||
from machine import Pin
|
||||
from time import sleep
|
||||
|
||||
void setup() {
|
||||
// Set RelayPin as an output pin
|
||||
pinMode(RelayPin, OUTPUT);
|
||||
}
|
||||
# declaring the pin to which input pin of relay module is connected and Set RelayPin as an output pin
|
||||
relayPin = Pin(5, Pin.OUT)
|
||||
|
||||
void loop() {
|
||||
// Let's turn on the relay...
|
||||
digitalWrite(RelayPin, LOW);//pulls the pin LOW
|
||||
delay(3000);
|
||||
|
||||
// Let's turn off the relay...
|
||||
digitalWrite(RelayPin, HIGH);//pulls the pin HIGH.
|
||||
delay(3000);
|
||||
}
|
||||
while True:
|
||||
# Turns on and off the relaypin at intervals of 3 seconds
|
||||
relayPin.value(not relayPin.value())
|
||||
sleep(3000)
|
||||
```
|
||||
|
||||
## APPLICATIONS
|
||||
|
||||
Reference in New Issue
Block a user