CxD Archive
Code: Internet of Things 2.0
Code: Internet of Things 2.0
  • Code Introduction
  • Prerequisite Knowledge
  • Tutorials
    • A. Meet Your IoT Kit
      • A-1 Circuit Board
      • A-2 Other Components
      • A-3 Electronic Circuits
    • B. Hello World Test
      • B-1 Start IoT Device
      • B-2 Login to Web IDE
      • B-3 New App Template
      • B-4 Global Variable
      • B-5 Setup Function
      • B-6 Loop Function
      • B-7 Flash App to Device
      • B-8 Modify App
    • C. Smart Light Device
      • C-1 Connect LED
      • C-2 Copy Hello World App
      • C-3 Connect Button
      • C-4 Add Button Code
      • C-5 Modify Button Code
      • C-6 Particle Cloud Code
      • C-7 Web App HTML
      • C-8 Web App CSS
      • C-9 Web App JS
    • D. Smart Security Device
      • D-1 Connect Motion Sensor
      • D-2 Connect Speaker
      • D-3 LED and Button Code
      • D-4 Motion Sensor Code
      • D-5 Speaker Code
      • D-6 Particle Cloud Code
      • D-7 Web App HTML
      • D-8 Web App CSS
      • D-9 Web App JS
  • References
    • Particle Build
    • Photon Device App
    • Web App - Single Screen
    • Web App - Multiple Screens
    • Particle Cloud
      • Web App Prep Steps
      • Get Device Variable
      • Call Device Function
      • Get Device Events
    • Physical Inputs
      • Push Buttons
      • Trimpot Dial
      • Motion Sensor
      • Magnetic Switch
      • Light Sensor
      • Temperature Sensor
      • Soil Moisture Sensor
      • Accelerometer
      • Ultrasonic Sensor *
    • Physical Outputs
      • LED Lights
      • Speaker
      • Servo Motor
      • Micro OLED Display
  • Links
    • IoT Project Guidebook
    • Particle Build (Web IDE)
    • Wiring Language
    • Photon Firmware
    • Particle API JS
    • W3Schools
    • Photon Kit Experiments
Powered by GitBook
On this page
Export as PDF
  1. Tutorials
  2. D. Smart Security Device

D-1 Connect Motion Sensor

PreviousD. Smart Security DeviceNextD-2 Connect Speaker

Last updated 2 years ago

NEED LED & BUTTON: Be sure the LED and button from your Smart Light device are still connected. If not, to the D0 pin and to the D2 pin.

Your Photon kit includes a motion sensor that uses passive infrared (PIR) light to detect movement in the surrounding environment up to 10 feet away.

In this step, your team will connect the motion sensor to your Photon circuit board using the breadboard.

You'll need these components:

  • Motion sensor (with 3-pin connector)

  • 3 jumper wires (use different colors to help identify them; it may help to match the sensor wires)

. The sensor can be connected to almost any I/O pin, but connect it to the D3 pin (which will be different from the wiring diagram).

5V REQUIRED: The motion sensor requires 5V of power to operate, so the sensor's red wire must be connected to the VIN pin or V-USB pin, depending on your Photon's power source.

  • If your Photon is being powered through the barrel jack, connect to the VIN pin.

  • If your Photon is being powered through the Micro-USB port, connect to the V-USB pin.

connect an LED
connect a push button
Follow these instructions explaining how to connect the motion sensor
Example Wiring Diagram for a Motion Sensor