

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.








| 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 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 |
Powering the Board:
Connecting Sensors and Actuators:
Programming the Board:
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
}
Wi-Fi Connection Problems:
Analog Readings Are Inaccurate:
Board Not Recognized by Computer:
By following this documentation, you should be able to effectively utilize the Photon2 microcontroller development board in your IoT projects. Happy prototyping!