24mm x 16.5mm
24mm x 16.5mm
2g
-20C to 85C
FCC, CE, and RoHS compliant
Applications
The M5 Stack ATOM Lite is suitable for a wide range of IoT applications, including |
Conclusion
The M5 Stack ATOM Lite is a powerful, compact, and cost-effective IoT module that offers a rich set of features and peripherals, making it an ideal choice for a wide range of IoT applications. Its low power consumption, wireless connectivity, and versatility make it an attractive option for developers, designers, and engineers working on IoT projects.
M5 Stack ATOM Lite Documentation
Overview
The M5 Stack ATOM Lite is a mini IoT development board based on the ESP32-Pico-D4 system-on-chip (SoC). It features a compact design, built-in Wi-Fi and Bluetooth capabilities, and a range of interfaces for connecting sensors and peripherals.
Technical Specifications
Microcontroller: ESP32-Pico-D4
Wi-Fi: 802.11 b/g/n
Bluetooth: 4.2
Memory: 4MB Flash, 520KB SRAM
Interfaces: USB-C, UART, I2C, I2S, SPI, GPIO
Power: USB-C, 3.3V input
Dimensions: 24.5mm x 15.5mm x 3.5mm
Getting Started
To get started with the M5 Stack ATOM Lite, you'll need to:
1. Install the M5 Stack Arduino Core library for ESP32.
2. Connect the board to your computer using a USB-C cable.
3. Open the Arduino IDE and select the M5 Stack ATOM Lite board from the Boards menu.
Code Examples
### Example 1: Wi-Fi Connectivity and LED Blinking
This example demonstrates how to connect to a Wi-Fi network and blink the built-in LED on the M5 Stack ATOM Lite.
```c
#include <WiFi.h>
const char ssid = "your_wifi_ssid";
const char password = "your_wifi_password";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}
```
### Example 2: I2C Communication with a Sensor
This example demonstrates how to connect a BME280 temperature and humidity sensor to the M5 Stack ATOM Lite using I2C and read sensor data.
```c
#include <Wire.h>
#include <BME280.h>
BME280 bme;
void setup() {
Serial.begin(115200);
Wire.begin();
if (!bme.begin()) {
Serial.println("Failed to initialize BME280 sensor");
while (1);
}
}
void loop() {
int temperature = bme.readTemperature();
int humidity = bme.readHumidity();
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %");
delay(1000);
}
```
### Example 3: Web Server with HTTP Requests
This example demonstrates how to create a simple web server on the M5 Stack ATOM Lite that responds to HTTP requests.
```c
#include <WiFi.h>
#include <WiFiClient.h>
#include <ESPmDNS.h>
const char ssid = "your_wifi_ssid";
const char password = "your_wifi_password";
WiFiServer server(80);
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
if (MDNS.begin("m5stack-atom-lite")) {
Serial.println("MDNS responder started");
}
server.begin();
}
void loop() {
WiFiClient client = server.available();
if (client) {
String request = client.readStringUntil('
');
if (request.indexOf("/ledon") != -1) {
digitalWrite(LED_BUILTIN, HIGH);
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("<h1>LED is on</h1>");
} else if (request.indexOf("/ledoff") != -1) {
digitalWrite(LED_BUILTIN, LOW);
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("<h1>LED is off</h1>");
} else {
client.println("HTTP/1.1 404 Not Found");
client.println("Content-Type: text/html");
client.println();
client.println("<h1>Not Found</h1>");
}
client.stop();
}
delay(10);
}
```
These examples demonstrate the basic functionality of the M5 Stack ATOM Lite and provide a starting point for more advanced projects.