Arduino Nano R3 Compatible Board with CH340 Chip Documentation
The Arduino Nano R3 Compatible Board with CH340 Chip is a compact and affordable microcontroller board based on the ATmega328P microcontroller. It is pin-compatible with the Arduino Nano R3 and features a CH340 chip for USB communication. This board is ideal for IoT projects, robotics, and prototyping.
Microcontroller: ATmega328P
Operating Frequency: 16 MHz
Flash Memory: 32 KB
SRAM: 2 KB
EEPROM: 1 KB
Digital I/O Pins: 14
Analog Input Pins: 8
Analog Output Pins: 2
USB Interface: CH340 Chip
Power Input: 7-12V DC
Operating Temperature: -20C to 70C
The Arduino Nano R3 Compatible Board with CH340 Chip has the following pinout:
| Pin | Function |
| --- | --- |
| 1-13 | Digital I/O Pins |
| 14-19 | Analog Input Pins |
| 20-21 | Analog Output Pins |
| VCC | Power Input (7-12V DC) |
| GND | Ground |
| VIN | Vin (5V) |
| 5V | 5V Regulated Output |
| 3V3 | 3.3V Regulated Output |
| RST | Reset Button |
| TX | UART Transmit ( Serial Communication) |
| RX | UART Receive (Serial Communication) |
### Example 1: Blinking LED
This example demonstrates how to use the Arduino Nano R3 Compatible Board with CH340 Chip to blink an LED connected to digital pin 13.
```c
void setup() {
pinMode(13, OUTPUT); // Set digital pin 13 as an output
}
void loop() {
digitalWrite(13, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(13, LOW); // Turn the LED off
delay(1000); // Wait for 1 second
}
```
### Example 2: Reading Analog Input
This example demonstrates how to use the Arduino Nano R3 Compatible Board with CH340 Chip to read an analog input from a potentiometer connected to analog pin A0.
```c
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
}
void loop() {
int sensorValue = analogRead(A0); // Read the analog input value
Serial.print("Sensor Value: ");
Serial.println(sensorValue); // Print the sensor value to the serial monitor
delay(500); // Wait for 500 milliseconds
}
```
### Example 3: Serial Communication
This example demonstrates how to use the Arduino Nano R3 Compatible Board with CH340 Chip to send and receive serial data between the board and a computer.
```c
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
}
void loop() {
if (Serial.available() > 0) {
char incomingByte = Serial.read(); // Read incoming serial data
Serial.print("Received: ");
Serial.println(incomingByte); // Print the received data to the serial monitor
}
}
```
In this example, the board sends the received serial data back to the computer, and the serial monitor can be used to view the received data.
These examples demonstrate the basic functionality of the Arduino Nano R3 Compatible Board with CH340 Chip. By using the provided code examples and technical specifications, users can develop a wide range of IoT projects and applications.