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

How to Use Photon2: Examples, Pinouts, and Specs

Image of Photon2
Cirkit Designer LogoDesign with Photon2 in Cirkit Designer

Introduction

The Photon2 is a versatile microcontroller development board equipped with Wi-Fi and Bluetooth capabilities, making it an ideal choice for Internet of Things (IoT) applications. This powerful board is designed to facilitate rapid prototyping and development of connected devices, offering a robust platform for both beginners and experienced developers.

Explore Projects Built with Photon2

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 Photon2 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 Photon2 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
Arduino-Controlled Servo with Light Sensing
Image of Servo: A project utilizing Photon2 in a practical application
This circuit features an Arduino UNO microcontroller interfaced with two photocells (LDRs) and a servo motor. The photocells are connected to analog inputs A0 and A1, and their average light intensity reading is used to control the position of the servo motor connected to digital pin D9. The circuit is powered by a pair of 18650 Li-ion batteries, which are also connected to a TP4056 charging module that can be charged via a solar cell, providing a renewable energy source for the system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano-Based Light Intensity Data Logger with Op-Amp Signal Conditioning
Image of TEST: A project utilizing Photon2 in a practical application
This circuit is designed to detect light intensity using a photodiode and convert the signal into a readable voltage using a Transimpedance Amplifier (TIA) configuration with an LM358 Op-Amp. The resistor and capacitor form a feedback network for the TIA, which outputs a voltage proportional to the light intensity to the Arduino Nano's analog input (A0). The Arduino Nano is programmed to read this analog voltage, convert it to a digital value, and output the result over serial communication for monitoring or further processing.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Photon2

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 Photon2 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 Photon2 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 Servo: A project utilizing Photon2 in a practical application
Arduino-Controlled Servo with Light Sensing
This circuit features an Arduino UNO microcontroller interfaced with two photocells (LDRs) and a servo motor. The photocells are connected to analog inputs A0 and A1, and their average light intensity reading is used to control the position of the servo motor connected to digital pin D9. The circuit is powered by a pair of 18650 Li-ion batteries, which are also connected to a TP4056 charging module that can be charged via a solar cell, providing a renewable energy source for the system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of TEST: A project utilizing Photon2 in a practical application
Arduino Nano-Based Light Intensity Data Logger with Op-Amp Signal Conditioning
This circuit is designed to detect light intensity using a photodiode and convert the signal into a readable voltage using a Transimpedance Amplifier (TIA) configuration with an LM358 Op-Amp. The resistor and capacitor form a feedback network for the TIA, which outputs a voltage proportional to the light intensity to the Arduino Nano's analog input (A0). The Arduino Nano is programmed to read this analog voltage, convert it to a digital value, and output the result over serial communication for monitoring or further processing.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Home Automation: Control and monitor home appliances remotely.
  • Wearable Devices: Develop smart wearable gadgets with connectivity features.
  • Industrial Automation: Implement IoT solutions for industrial monitoring and control.
  • Environmental Monitoring: Collect and transmit environmental data such as temperature, humidity, and air quality.
  • Smart Agriculture: Monitor and manage agricultural conditions and equipment.

Technical Specifications

Key Technical Details

Specification Value
Microcontroller ARM Cortex-M4
Operating Voltage 3.3V
Input Voltage 5V (via USB)
Digital I/O Pins 18
Analog Input Pins 8
Flash Memory 1MB
SRAM 256KB
Clock Speed 120 MHz
Wi-Fi 802.11 b/g/n
Bluetooth 4.2 (BLE)
Dimensions 36mm x 24mm

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 VIN Input voltage (5V)
2 GND Ground
3 3V3 3.3V output
4 A0 Analog input 0
5 A1 Analog input 1
6 A2 Analog input 2
7 A3 Analog input 3
8 A4 Analog input 4
9 A5 Analog input 5
10 D0 Digital I/O 0
11 D1 Digital I/O 1
12 D2 Digital I/O 2
13 D3 Digital I/O 3
14 D4 Digital I/O 4
15 D5 Digital I/O 5
16 D6 Digital I/O 6
17 D7 Digital I/O 7
18 RX UART Receive
19 TX UART Transmit
20 RST Reset

Usage Instructions

How to Use the Photon2 in a Circuit

  1. Powering the Board:

    • Connect the VIN pin to a 5V power source or use the USB port for power.
    • Ensure the GND pin is connected to the ground of your power source.
  2. Connecting Sensors and Actuators:

    • Use the digital I/O pins (D0-D7) for connecting digital sensors and actuators.
    • Use the analog input pins (A0-A5) for connecting analog sensors.
  3. Programming the Board:

    • Connect the Photon2 to your computer via USB.
    • Use the Arduino IDE or other compatible development environments to write and upload code.

Important Considerations and Best Practices

  • Voltage Levels: Ensure that all connected components operate at 3.3V logic levels to avoid damaging the board.
  • Pin Usage: Avoid using the same pin for multiple functions simultaneously.
  • Wi-Fi and Bluetooth: Be mindful of the power consumption when using Wi-Fi and Bluetooth features.

Example Code

Here is an example code to read an analog sensor value and send it over Wi-Fi to a server:

#include <WiFi.h>

// Replace with your network credentials
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";

// Server details
const char* server = "your_server_address";
const int port = 80;

void setup() {
  Serial.begin(115200);
  pinMode(A0, INPUT);

  // Connect to Wi-Fi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }
  Serial.println("Connected to WiFi");
}

void loop() {
  int sensorValue = analogRead(A0);
  Serial.print("Sensor Value: ");
  Serial.println(sensorValue);

  // Connect to server
  WiFiClient client;
  if (client.connect(server, port)) {
    client.print("GET /update?value=");
    client.print(sensorValue);
    client.println(" HTTP/1.1");
    client.println("Host: your_server_address");
    client.println("Connection: close");
    client.println();
  }
  client.stop();

  delay(10000); // Send data every 10 seconds
}

Troubleshooting and FAQs

Common Issues Users Might Face

  1. Wi-Fi Connection Problems:

    • Ensure the SSID and password are correct.
    • Check if the Wi-Fi network is operational.
  2. Analog Readings Are Inaccurate:

    • Verify the sensor connections.
    • Ensure the sensor operates within the 3.3V range.
  3. Board Not Recognized by Computer:

    • Check the USB cable and port.
    • Install the necessary drivers for the Photon2.

Solutions and Tips for Troubleshooting

  • Reset the Board: Press the RST button to reset the board if it becomes unresponsive.
  • Check Power Supply: Ensure the board is receiving adequate power.
  • Update Firmware: Keep the board's firmware updated to the latest version for optimal performance.

By following this documentation, you should be able to effectively utilize the Photon2 microcontroller development board in your IoT projects. Happy prototyping!