

The Photon P2 Microcontroller, manufactured by Particle, is a powerful Wi-Fi microcontroller module designed specifically for IoT (Internet of Things) applications. Featuring a dual-core ARM Cortex-M4 processor, ample memory, and extensive connectivity options, the P2 is ideal for a wide range of applications, from home automation to industrial monitoring.








| Specification | Value |
|---|---|
| Processor | Dual-core ARM Cortex-M4 |
| Clock Speed | 120 MHz |
| Flash Memory | 4 MB |
| RAM | 512 KB |
| Wi-Fi | 802.11 b/g/n (2.4 GHz) |
| Operating Voltage | 3.3V |
| Input Voltage Range | 3.0V to 3.6V |
| Digital I/O Pins | 24 |
| Analog Input Pins | 8 |
| UART | 2 |
| SPI | 2 |
| I2C | 2 |
| Power Consumption | 80 mA (typical) |
| Dimensions | 20 mm x 30 mm |
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | GND | Ground |
| 2 | 3V3 | 3.3V Power Supply |
| 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 | TX | UART Transmit |
| 18 | RX | UART Receive |
| 19 | SCL | I2C Clock |
| 20 | SDA | I2C Data |
| 21 | SPI_CLK | SPI Clock |
| 22 | SPI_MISO | SPI Master In Slave Out |
| 23 | SPI_MOSI | SPI Master Out Slave In |
| 24 | RST | Reset |
#include <Wire.h>
void setup() {
// Initialize serial communication at 9600 baud rate
Serial.begin(9600);
// Initialize I2C communication
Wire.begin();
// Set pin modes for digital I/O
pinMode(D0, OUTPUT);
pinMode(D1, INPUT);
}
void loop() {
// Read digital input from pin D1
int sensorValue = digitalRead(D1);
// Print the sensor value to the serial monitor
Serial.println(sensorValue);
// Write a HIGH signal to pin D0
digitalWrite(D0, HIGH);
// Wait for 1 second
delay(1000);
// Write a LOW signal to pin D0
digitalWrite(D0, LOW);
// Wait for 1 second
delay(1000);
}
Wi-Fi Connectivity Issues:
Power Supply Problems:
Incorrect Pin Connections:
Serial Communication Errors:
By following this documentation, users can effectively integrate and utilize the Photon P2 Microcontroller in their IoT projects, ensuring reliable performance and connectivity.