This commit is contained in:
Serge NOEL
2026-02-10 11:27:18 +01:00
parent 549c9f388e
commit 4423bb2de1
175 changed files with 238087 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
name: Build Examples
on:
push:
paths:
- ./firmware
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
example:
- ./firmware/esp32c3-blink
- ./firmware/esp32c3-wifi-scan
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Build examples
run: |
pio run -d ${{ matrix.example }}

28
esp32c3-dev-board/LICENSE Normal file
View File

@@ -0,0 +1,28 @@
BSD 3-Clause License
Copyright (c) 2023, sonocotta
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

110
esp32c3-dev-board/README.md Normal file
View File

@@ -0,0 +1,110 @@
# ESP32-C3 Development Board
![Open Source Hardware](/images/open-source-hardware-logo.png)
![Open Source Software](/images/open-source-software-logo.png)
<a href="https://www.tindie.com/stores/sonocotta/?ref=offsite_badges&utm_source=sellers_andrey-malyshenko&utm_medium=badges&utm_campaign=badge_medium"><img src="https://d2ss6ovg47m0r5.cloudfront.net/badges/tindie-mediums.png" alt="I sell on Tindie" width="150" height="78"></a>
<br />
[![Dev Chat](https://img.shields.io/discord/1233306441469657140?logo=discord&label=discord&style=flat-square)](https://discord.gg/PtnaAaQMpS)
The ESP32 C3 Nano is an Arduino Nano compatible development board, designed to provide enhanced computing power, wireless connectivity, addressable LED capabilities, and a built-in programming and debugging interface.
It is based on the ESP32 C3 chip, which provides improved processing capabilities, increased memory, and wireless connectivity compared to traditional Atmega variant.
The board maintains compatibility with the Arduino Nano form factor, ensuring easy integration into existing projects and making it a drop-in replacement for the traditional Arduino Nano board.
![image](https://github.com/sonocotta/esp32c3-dev-board/assets/5459747/137f19a5-630f-4d3a-b6d1-4a238644e2a2)
## Features
- [ESP32-C3](https://www.espressif.com/en/products/socs/esp32-c3) 32-bit RISC-V MCU in a 32-pin package
- Up to 160 MHz CPU clock
- 4 MB Flash
- 400 KB SRAM
- WiFi and BLE
- Native USB for flashing and debugging
- Onboard 3V3 LDO (disconnected for low power applications)
- Flash using Arduino IDE, Platformio, or the IDE of your choice
- One RGB LED (WS2812B)
- RESET button
## ESP32-C3
ESP32-C3 is an entry-level 32-bit MCU in the ESP32 line. Generally they offer similar feature set compared to other ESP32 chips, but designed to be low-cost from the start, including popular communication interfaces, low power consumption in sleep mode (down to few micro-amps) and ease of use.
| | ESP8266 | ESP32 | ESP32-C3 | ESP32-S2 | ESP32-S3 |
|---------------|----------|------------|------------|------------|------------|
| Cores | 1x L106 | 2x LX6 | 1x RISC-V | 1x LX7 | 2x LX7
| Max Frequency | 160 Mhz | 240 Mhz | 160 Mhz | 240 Mhz | 240 Mhz
| Flash | External 1 MB (Typical)| External Up to 16 MB | Internal 4 MB or External | Internal 4 MB or External | Internal 8 MB or External
| SRAM Total | 160 KB | 320 KB | 400 KB | 320 KB | 520 KB
| SRAM Usable | 80 KB | 160 KB | 160 KB | 180 KB | 225 KB
| PSRAM | NA | External 4 MB | NA | Internal 2 MB or Ext | Internal 2 MB or 8 MB or Ext
| GPIO count | 11 Usable| 34 Total | 22 Total | 43 Total | 45 Total
| Connectivity | WiFi | WiFi + BT | WiFi + BLE | WiFi | WiFi + BLE
| USB | No | No | Yes + JTAG | Yes | Yes + JTAG
| UART | 1+ | 3 | 2 | 2 | 3
| I2C | 1 | 2 | 1 | 2 | 2
| SPI | 1 | 4 | 3 | 4 | 4
| I2S | 1 | 2 | 1 | 1 | 2
| LCD | No | No | No | No | Yes
## Board Pinout
![image](https://github.com/sonocotta/esp32c3-dev-board/assets/5459747/693cd15a-b362-47dd-b92d-4d156b9ac29a)
## MCU Pinout
![image](https://github.com/sonocotta/esp32c3-dev-board/assets/5459747/79d1982d-ebd9-4a1e-ae32-996773e489e0)
## How to programm
To program the ESP32-C3 microcontroller, you may use either Serial upload method or USB Upload. ESP32-C3 Development Board uses USB Upload method.
You need to connect USB-C cable, it will be used to power the board, flash over USB, serial over USB and JTAG over USB
### Arduino IDE
Add [https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json](https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json) to the board manager
![image](https://github.com/sonocotta/esp32c3-dev-board/assets/5459747/14b8795a-7d09-4255-8e0f-dfc38b9a7a9d)
After that you should install **ESP32 by Espressif Systems** from Board Manager
![image](https://github.com/sonocotta/esp32c3-dev-board/assets/5459747/7e7b5d2a-020d-4dc7-a330-35ae730d93fa)
Select **ESP32 C3 Dev Board** as target and other necessary settings in the board settings after
![image](https://github.com/sonocotta/esp32c3-dev-board/assets/5459747/14e6aeaf-17e5-4a87-b135-3225f3246d96)
Next press Build or Upload button, it should just work (RGB LED will blik white with blinky example)
![image](https://github.com/sonocotta/esp32c3-dev-board/assets/5459747/72bd1465-141c-43a0-8da1-1ea7acb50d7e)
### Platformio IDE
After installing [Plarformio IDE](https://platformio.org/platformio-ide), open sample [arduino project](/firmware/esp32c3-blink). Run `Build` command to install necessary tools and libraries.
Next run `Upload: esp32-dev-board` task to start upload over USB. `Monitor` task should give you Serial monitor, as long as you have your board connected via USB (Serial port appears right after board boots up).
## Hardware
Board schematic can be found in the [hardware](/hardware) section
| Front | Back |
|---|---|
| ![image](https://github.com/sonocotta/esp32c3-dev-board/assets/5459747/f0c2dec9-9b7e-4834-bbaf-680aeff2f3c5) | ![image](https://github.com/sonocotta/esp32c3-dev-board/assets/5459747/c8e27f8e-63ee-4f54-946f-323163768142)
- ![image](https://user-images.githubusercontent.com/5459747/206929567-5a68f822-1172-459c-bb34-64ab1ee2019c.png) ESP32-C3 MCU
- ![image](https://user-images.githubusercontent.com/5459747/206929650-72bfa8ba-716a-4830-ae14-a2c6ddff8830.png) WS2812B RGB LED
- ![image](https://user-images.githubusercontent.com/5459747/206929704-bb9a66ee-7e48-4c81-87f7-1f0c60d1a02f.png) Programming and Debug port (USB-C)
- ![image](https://user-images.githubusercontent.com/5459747/206929744-5f7abffb-341e-49c9-8988-01835a2045a8.png) Hardware Reset button
- ![image](https://user-images.githubusercontent.com/5459747/206929801-e55e502e-bdce-4d85-a376-3268b96dc5e2.png) VIN disconnect - cut this line to disconnect LDO chip and power-on LED, recommended for low-power applications
## Where to buy
Available at [Tindie](https://www.tindie.com/products/sonocotta/esp32-c3-development-board)
## Links
- [ESP32-C3 Product Page](https://www.espressif.com/en/products/socs/esp32-c3)

View File

@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch

View File

@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

View File

@@ -0,0 +1,14 @@
[env]
platform = espressif32
framework = arduino
monitor_speed = 115200
monitor_filters = colorize, esp32_exception_decoder
upload_speed = 460800
build_type = debug
lib_deps =
adafruit/Adafruit NeoPixel @ ^1.11.0
[env:esp32-dev-board]
board = lolin_c3_mini
build_flags =
-D SERIAL_BAUD=115200

View File

@@ -0,0 +1,32 @@
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
#include <Ticker.h>
#define PIN_LED 8
#define LED_COUNT 1
Adafruit_NeoPixel pixels(LED_COUNT, PIN_LED, NEO_GRB + NEO_KHZ800);
Ticker tOn, tOff;
void setup()
{
Serial.begin(SERIAL_BAUD);
Serial.println(F("Hello,"));
Serial.println(F("I'm"));
Serial.println(F("ESP32-C3!"));
tOn.attach_ms(500, [](){
pixels.setPixelColor(0, pixels.Color(0, 150, 0));
pixels.show();
});
delay(250);
tOff.attach_ms(500, [](){
pixels.setPixelColor(0, pixels.Color(0, 0, 0));
pixels.show();
Serial.printf("[%ld] %#08lx\n", millis(), random());
});
}
void loop(){}

View File

@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch

View File

@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

View File

@@ -0,0 +1,12 @@
[env]
platform = espressif32
framework = arduino
monitor_speed = 115200
monitor_filters = colorize, esp32_exception_decoder
upload_speed = 460800
build_type = debug
[env:esp32-dev-board]
board = lolin_c3_mini
build_flags =
-D SERIAL_BAUD=115200

View File

@@ -0,0 +1,89 @@
#include <Arduino.h>
#include "WiFi.h"
void setup()
{
Serial.begin(SERIAL_BAUD);
Serial.println(F("Hello,"));
Serial.println(F("I'm"));
Serial.println(F("ESP32-C3!"));
// Set WiFi to station mode and disconnect from an AP if it was previously connected.
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.println("Setup done");
}
void loop()
{
Serial.println("Scan start");
// WiFi.scanNetworks will return the number of networks found.
int n = WiFi.scanNetworks();
Serial.println("Scan done");
if (n == 0)
{
Serial.println("no networks found");
}
else
{
Serial.print(n);
Serial.println(" networks found");
Serial.println("Nr | SSID | RSSI | CH | Encryption");
for (int i = 0; i < n; ++i)
{
// Print SSID and RSSI for each network found
Serial.printf("%2d", i + 1);
Serial.print(" | ");
Serial.printf("%-32.32s", WiFi.SSID(i).c_str());
Serial.print(" | ");
Serial.printf("%4d", WiFi.RSSI(i));
Serial.print(" | ");
Serial.printf("%2d", WiFi.channel(i));
Serial.print(" | ");
switch (WiFi.encryptionType(i))
{
case WIFI_AUTH_OPEN:
Serial.print("open");
break;
case WIFI_AUTH_WEP:
Serial.print("WEP");
break;
case WIFI_AUTH_WPA_PSK:
Serial.print("WPA");
break;
case WIFI_AUTH_WPA2_PSK:
Serial.print("WPA2");
break;
case WIFI_AUTH_WPA_WPA2_PSK:
Serial.print("WPA+WPA2");
break;
case WIFI_AUTH_WPA2_ENTERPRISE:
Serial.print("WPA2-EAP");
break;
case WIFI_AUTH_WPA3_PSK:
Serial.print("WPA3");
break;
case WIFI_AUTH_WPA2_WPA3_PSK:
Serial.print("WPA2+WPA3");
break;
case WIFI_AUTH_WAPI_PSK:
Serial.print("WAPI");
break;
default:
Serial.print("unknown");
}
Serial.println();
delay(10);
}
}
Serial.println("");
// Delete the scan result to free memory for code below.
WiFi.scanDelete();
// Wait a bit before scanning again.
delay(5000);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB