Putting the pieces together
Go ahead and create this circuit for Arduino:
The connections are as follows:
- PIR → Arduino
- GND → GND
- OUT → D02
- VCC → 5V
- HC-06 → Arduino
- VCC → 3.3V
- GND → GND
- TXD → D10
- RXD → D11
Don't get mad, but there is one last library that you need to install in order to allow Arduino to communicate with Python: pySerial
. Go to https://pypi.python.org/pypi/pyserial, download pyserial-2.7.win32.exe
, and install it just like you install any other software. Then, we are ready.
Open Arduino and load the alarm_bluetooth.ino
file that came with this chapter. It is recommended that you have the most up-to-date Arduino software before proceeding:
#include ...
Get Arduino: Building exciting LED based projects and espionage devices now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.