Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Photon 2: Examples, Pinouts, and Specs

Image of Photon 2
Cirkit Designer LogoDesign with Photon 2 in Cirkit Designer

Introduction

The Photon 2 is a small, powerful Wi-Fi development kit designed for creating connected projects and products. It is an ideal choice for developers looking to integrate Wi-Fi connectivity into their applications with ease. The Photon 2 is equipped with a robust microcontroller and a reliable Wi-Fi module, making it suitable for a wide range of IoT (Internet of Things) projects.

Explore Projects Built with Photon 2

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Photon 2 Motion Detector Alarm with PIR Sensor and Wi-Fi Control
Image of final project: A project utilizing Photon 2 in a practical application
This circuit is a motion-activated alarm system using a Photon microcontroller, a PIR sensor, a piezo buzzer, a red LED, and a pushbutton. When motion is detected by the PIR sensor, the red LED lights up and the buzzer sounds an alarm, which can be deactivated manually via the pushbutton or remotely through the Particle Cloud.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Wi-Fi Controlled Laser Shooting Game with OLED Display
Image of 123: A project utilizing Photon 2 in a practical application
This circuit is a laser shooting game controlled by a PS3 controller, featuring an ESP32 microcontroller, two photosensitive sensors for light detection, and a motor driver to control two DC motors. The game includes an OLED display for score visualization, and a MOSFET to control an LED bulb, with power supplied by a 12V battery and regulated by a DC-DC step-down converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Security System with RFID and Laser Intrusion Detection
Image of CPE doorlock system upgrade: A project utilizing Photon 2 in a practical application
This circuit is a security and access control system featuring motion detection, laser beam-break sensing, and RFID scanning, interfaced with a keypad and visual/audible indicators, powered by a solar-charged battery, and capable of controlling an electric lock via a relay.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Security System with RFID, PIR Sensor, and Laser Modules
Image of CPE doorlock system upgrade: A project utilizing Photon 2 in a practical application
This circuit is designed for a security and access control system with motion detection, beam-break detection, RFID-based access, and user input via a keypad. It is managed by an ESP32 microcontroller, which also controls an OLED display and an electric lock through a relay. The system is powered by a solar panel with a charge controller and UPS battery, with buck converters for voltage regulation.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Photon 2

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of final project: A project utilizing Photon 2 in a practical application
Photon 2 Motion Detector Alarm with PIR Sensor and Wi-Fi Control
This circuit is a motion-activated alarm system using a Photon microcontroller, a PIR sensor, a piezo buzzer, a red LED, and a pushbutton. When motion is detected by the PIR sensor, the red LED lights up and the buzzer sounds an alarm, which can be deactivated manually via the pushbutton or remotely through the Particle Cloud.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 123: A project utilizing Photon 2 in a practical application
ESP32-Based Wi-Fi Controlled Laser Shooting Game with OLED Display
This circuit is a laser shooting game controlled by a PS3 controller, featuring an ESP32 microcontroller, two photosensitive sensors for light detection, and a motor driver to control two DC motors. The game includes an OLED display for score visualization, and a MOSFET to control an LED bulb, with power supplied by a 12V battery and regulated by a DC-DC step-down converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of CPE doorlock system upgrade: A project utilizing Photon 2 in a practical application
ESP32-Based Security System with RFID and Laser Intrusion Detection
This circuit is a security and access control system featuring motion detection, laser beam-break sensing, and RFID scanning, interfaced with a keypad and visual/audible indicators, powered by a solar-charged battery, and capable of controlling an electric lock via a relay.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of CPE doorlock system upgrade: A project utilizing Photon 2 in a practical application
ESP32-Based Security System with RFID, PIR Sensor, and Laser Modules
This circuit is designed for a security and access control system with motion detection, beam-break detection, RFID-based access, and user input via a keypad. It is managed by an ESP32 microcontroller, which also controls an OLED display and an electric lock through a relay. The system is powered by a solar panel with a charge controller and UPS battery, with buck converters for voltage regulation.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Home automation systems
  • Remote monitoring and control
  • Smart appliances
  • Industrial automation
  • Wearable technology
  • Prototyping and development of IoT devices

Technical Specifications

Key Technical Details

Specification Value
Microcontroller ARM Cortex-M4
Operating Voltage 3.3V
Input Voltage 3.6V to 5.5V
Digital I/O Pins 18
Analog Input Pins 8
Flash Memory 1MB
RAM 256KB
Wi-Fi 802.11 b/g/n
Clock Speed 120 MHz
Dimensions 36.58mm x 20.32mm

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 VIN Input voltage (3.6V to 5.5V)
2 GND Ground
3 D0 Digital I/O
4 D1 Digital I/O
5 D2 Digital I/O
6 D3 Digital I/O
7 D4 Digital I/O
8 D5 Digital I/O
9 D6 Digital I/O
10 D7 Digital I/O
11 A0 Analog Input
12 A1 Analog Input
13 A2 Analog Input
14 A3 Analog Input
15 A4 Analog Input
16 A5 Analog Input
17 A6 Analog Input
18 A7 Analog Input

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the Photon 2:

    • Connect the VIN pin to a power source (3.6V to 5.5V).
    • Connect the GND pin to the ground of the power source.
  2. Connecting to Wi-Fi:

    • Use the Particle mobile app or Particle CLI to set up Wi-Fi credentials.
  3. Programming the Photon 2:

    • Use the Particle Web IDE, Particle Dev, or Particle CLI to write and upload code.
  4. Connecting Sensors and Actuators:

    • Use the digital I/O pins (D0-D7) for digital sensors and actuators.
    • Use the analog input pins (A0-A7) for analog sensors.

Important Considerations and Best Practices

  • Ensure the input voltage does not exceed the specified range (3.6V to 5.5V).
  • Use appropriate pull-up or pull-down resistors for digital inputs if necessary.
  • Avoid placing the Photon 2 in environments with excessive electromagnetic interference.
  • Regularly update the firmware to the latest version for improved performance and security.

Example Code

Here is an example code to blink an LED connected to pin D0 using the Photon 2:

// Define the pin for the LED
int ledPin = D0;

void setup() {
  // Initialize the LED pin as an output
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // Turn the LED on
  digitalWrite(ledPin, HIGH);
  delay(1000); // Wait for 1 second

  // Turn the LED off
  digitalWrite(ledPin, LOW);
  delay(1000); // Wait for 1 second
}

Troubleshooting and FAQs

Common Issues Users Might Face

  1. Photon 2 Not Connecting to Wi-Fi:

    • Ensure the Wi-Fi credentials are correct.
    • Check if the Wi-Fi network is within range.
    • Restart the Photon 2 and try reconnecting.
  2. Code Not Uploading:

    • Verify that the Photon 2 is in DFU mode (blinking yellow).
    • Ensure the USB cable is properly connected.
    • Check for any errors in the Particle CLI or Web IDE.
  3. Sensor/Actuator Not Responding:

    • Check the wiring connections.
    • Ensure the correct pins are being used in the code.
    • Verify the sensor/actuator is functioning properly.

Solutions and Tips for Troubleshooting

  • Wi-Fi Connection Issues:

    • Use the Particle mobile app to reconfigure Wi-Fi settings.
    • Move the Photon 2 closer to the Wi-Fi router.
  • Code Upload Issues:

    • Use a different USB cable or port.
    • Update the Particle CLI to the latest version.
  • Sensor/Actuator Issues:

    • Test the sensor/actuator with a multimeter.
    • Use serial debugging to print sensor values and check for anomalies.

By following this documentation, users can effectively utilize the Photon 2 in their projects, troubleshoot common issues, and implement best practices for optimal performance.