O'Reilly logo

Arduino: Building exciting LED based projects and espionage devices by Marco Schwartz, Utsav Shah, Samarth Shah, Adith Jagdish Boloor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting the pieces together

Go ahead and create this circuit for Arduino:

Putting the pieces together

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required