> ## Documentation Index
> Fetch the complete documentation index at: https://docs.protonverse.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Proton AI Core Example Projects and Starter Sketches

> Ready-to-use example sketches for Proton AI Core covering camera streaming, Wi-Fi image upload, BLE sensor nodes, and person detection.

This page collects example projects to help you start building with Proton AI Core as quickly as possible. Each example is self-contained and designed to demonstrate a key capability of the board — from live camera streaming to on-device AI inference. Pick the one closest to your use case and use it as a starting point.

<CardGroup cols={2}>
  <Card title="Camera Web Server" icon="server" href="/guides/examples#example-1-camera-web-server">
    Stream live camera footage from Proton AI Core over your local Wi-Fi network and view it in any browser.
  </Card>

  <Card title="Wi-Fi Image Upload" icon="wifi" href="/guides/examples#example-2-wi-fi-image-upload">
    Capture a JPEG frame from the camera and POST it directly to a remote HTTP server endpoint.
  </Card>

  <Card title="BLE Sensor Node" icon="bluetooth" href="/guides/examples#example-3-ble-sensor-node">
    Read sensor data and broadcast it to nearby BLE clients using notifications — no Wi-Fi required.
  </Card>

  <Card title="Person Detection" icon="eye" href="/guides/examples#example-4-person-detection">
    Run a TensorFlow Lite Micro person detection model on live camera frames and report confidence scores over Serial.
  </Card>
</CardGroup>

***

## Example 1: Camera Web Server

The Camera Web Server example streams a live MJPEG feed from the OV2640 or OV3660 camera over Wi-Fi. Any device on the same network can view the stream by navigating to the board's IP address in a web browser — no app installation required.

**Uses:** `esp32-camera`, `WiFi.h`

The Arduino IDE ships with a ready-made version of this sketch. You can find it at **File → Examples → ESP32 → Camera → CameraWebServer**.

<Steps>
  <Step title="Install the ESP32 board package">
    In Arduino IDE, open **Tools → Board → Boards Manager**, search for `esp32` by Espressif Systems, and install it. The `esp32-camera` driver is bundled automatically.
  </Step>

  <Step title="Open the CameraWebServer example">
    Navigate to **File → Examples → ESP32 → Camera → CameraWebServer** and open the sketch.
  </Step>

  <Step title="Configure your Wi-Fi credentials">
    In the sketch, replace the placeholder values for `ssid` and `password` with your network name and password.
  </Step>

  <Step title="Select the correct camera model">
    Near the top of the sketch, uncomment the `#define` that matches your camera module (OV2640 or OV3660). Comment out all other camera model defines.
  </Step>

  <Step title="Upload and connect">
    Select **ESP32S3 Dev Module** (or the equivalent Proton AI Core board entry) under **Tools → Board**, then click **Upload**. Open the **Serial Monitor** at 115200 baud and wait for the board to print its IP address. Navigate to that address in your browser to view the stream.
  </Step>
</Steps>

<Tip>
  Use `FRAMESIZE_SVGA` (800×600) in the web server sketch for a good balance of image quality and streaming frame rate over a local Wi-Fi network.
</Tip>

***

## Example 2: Wi-Fi Image Upload

This example captures a single JPEG frame from the camera and sends it to a remote HTTP server using an HTTP POST request. It is useful for remote monitoring pipelines, cloud-based AI processing, or any workflow where you need to move images off the device.

**Uses:** `esp32-camera`, `WiFi.h`, `HTTPClient.h`

Connect to Wi-Fi and initialise the camera first (see [Wi-Fi & Bluetooth](/guides/wifi-bluetooth) and [Camera](/guides/camera)), then call the function below:

```cpp wifi_image_upload.cpp theme={null}
#include <WiFi.h>
#include <HTTPClient.h>
#include "esp_camera.h"

// After Wi-Fi connected and camera initialized...
void uploadImage() {
  camera_fb_t *fb = esp_camera_fb_get();
  if (!fb) return;

  HTTPClient http;
  http.begin("http://your-server.com/upload");
  http.addHeader("Content-Type", "image/jpeg");
  int code = http.POST(fb->buf, fb->len);
  Serial.printf("Upload response: %d\n", code);
  http.end();
  esp_camera_fb_return(fb);
}
```

Replace `http://your-server.com/upload` with your actual server endpoint. Your server should accept a `POST` request with a `Content-Type: image/jpeg` body and respond with an HTTP 200 on success.

***

## Example 3: BLE Sensor Node

The BLE Sensor Node example turns Proton AI Core into a Bluetooth Low Energy peripheral that broadcasts sensor readings to any nearby BLE central device — a phone, tablet, or another microcontroller. No Wi-Fi infrastructure is needed, making it ideal for low-power or offline deployments.

**Uses:** `BLEDevice.h`, `BLEServer.h`

Start with the BLE Server sketch from the [Wi-Fi & Bluetooth](/guides/wifi-bluetooth) guide. To turn it into a sensor node, replace the static `"Hello BLE"` string in `pCharacteristic->setValue()` with your actual sensor reading. For example, if you are reading a temperature sensor connected over I2C, format the reading as a string or pack it as raw bytes before calling `setValue()`, then call `notify()` to push the update to subscribed clients.

Use a BLE scanner app such as **nRF Connect** to verify that your characteristic value updates correctly before integrating with a full client application.

***

## Example 4: Person Detection

The Person Detection example runs a pre-trained TensorFlow Lite Micro model on live camera frames and reports a confidence score for "person" and "no person" directly to the Serial Monitor. It demonstrates the full edge AI pipeline: camera capture → pre-processing → on-device inference → result output.

**Uses:** `esp32-camera`, TFLite Micro, `WiFi.h` (optional, for OTA updates)

Espressif maintains a reference implementation in their [tflite-micro-esp-examples](https://github.com/espressif/tflite-micro-esp-examples) repository, which includes a person detection demo optimised for the ESP32-S3.

<Steps>
  <Step title="Clone the repository">
    ```bash theme={null}
    git clone --recursive https://github.com/espressif/tflite-micro-esp-examples.git
    ```
  </Step>

  <Step title="Open the person detection example">
    Navigate to the `examples/person_detection` directory inside the cloned repository.
  </Step>

  <Step title="Configure PlatformIO">
    Open the project in VS Code with the PlatformIO extension installed. Update `platformio.ini` if needed to target the ESP32-S3 and set the correct upload port.
  </Step>

  <Step title="Flash and observe">
    Build and upload the firmware. Open the Serial Monitor at 115200 baud. Point the camera at a person or an empty scene and observe the "person" and "no person" confidence scores printed for each inference cycle.
  </Step>
</Steps>

<Note>
  Full Proton AI Core-specific example code is coming soon. In the meantime, the Espressif reference examples run on the ESP32-S3 and serve as an accurate starting point.
</Note>
