Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

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

Image of Photon 2Design with Photon 2 in Cirkit Designer

Introduction

The Photon 2 is a compact and powerful Wi-Fi development kit designed for creating connected projects and products. It features a microcontroller with built-in Wi-Fi capabilities, making it an ideal choice for Internet of Things (IoT) applications. With its small form factor and robust feature set, the Photon 2 is perfect for both hobbyists and professionals looking to develop smart, connected devices.

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 ESP32-Based Security System with RFID, PIR Sensor, and Laser Modules: 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.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Parameter Value
Microcontroller ARM Cortex-M4
Operating Voltage 3.3V
Input Voltage 3.6V - 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 - 5.5V)
2 GND Ground
3 3V3 3.3V output
4 D0 Digital I/O
5 D1 Digital I/O
6 D2 Digital I/O
7 D3 Digital I/O
8 D4 Digital I/O
9 D5 Digital I/O
10 D6 Digital I/O
11 D7 Digital I/O
12 A0 Analog Input
13 A1 Analog Input
14 A2 Analog Input
15 A3 Analog Input
16 A4 Analog Input
17 A5 Analog Input
18 A6 Analog Input
19 A7 Analog Input

Usage Instructions

How to Use the Photon 2 in a Circuit

  1. Powering the Photon 2:

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

    • Use the built-in Wi-Fi module to connect to a Wi-Fi network.
    • Configure the Wi-Fi settings using the Particle IDE or Particle CLI.
  3. Programming the Photon 2:

    • Use the Particle Web IDE, Particle Desktop IDE, or Particle CLI to write and upload code.
    • The Photon 2 supports programming in C/C++.
  4. Interfacing with Sensors and Actuators:

    • Use the digital I/O pins (D0-D7) to connect to sensors and actuators.
    • Use the analog input pins (A0-A7) to read analog signals from sensors.

Important Considerations and Best Practices

Example Code for Arduino UNO

// Example code to connect Photon 2 to an Arduino UNO and read an analog sensor

// Define the pin connected to the sensor
const int sensorPin = A0;

// Variable to store the sensor value
int sensorValue = 0;

void setup() {
  // Initialize serial communication at 9600 baud rate
  Serial.begin(9600);
}

void loop() {
  // Read the analog value from the sensor
  sensorValue = analogRead(sensorPin);

  // Print the sensor value to the serial monitor
  Serial.println(sensorValue);

  // Wait for 100 milliseconds before the next reading
  delay(100);
}

Troubleshooting and FAQs

Common Issues Users Might Face

  1. Wi-Fi Connection Problems:

    • Ensure the Wi-Fi credentials are correctly configured.
    • Check if the Wi-Fi network is within range and operational.
    • Restart the Photon 2 and the Wi-Fi router.
  2. Power Supply Issues:

    • Verify that the input voltage is within the specified range (3.6V - 5.5V).
    • Check for loose connections or faulty power sources.
  3. Programming Errors:

    • Ensure the correct board and port are selected in the Particle IDE.
    • Check for syntax errors or missing libraries in the code.

Solutions and Tips for Troubleshooting

By following this documentation, users can effectively utilize the Photon 2 for their IoT projects and overcome common challenges they may encounter.