Go ahead and create this circuit for Arduino:
The connections are as follows:
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: