Stufin
Home Quick Cart Profile

Arduino MEGA 2560 CH340 R3 Compatible Board

Buy Now on Stufin

Serial communication protocols

UART, SPI, I2C, and I2S

16 programmable digital I/O pins

6 analog input pins with 10-bit ADC resolution

4 UARTs (serial communication channels)

2 SPI interfaces

1 I2C interface

1 I2S interface

### Power Management

Input voltage range

7-12 V

Output voltage

5 V, 3.3 V, and VIN (input voltage)

Onboard power regulator for stable voltage supply

Power consumption

approximately 20-50 mA depending on usage

### Additional Features

16 MHz quartz crystal oscillator for accurate timing

Reset button for easy board reset

Power-on indicator LED

TX and RX LEDs for serial communication indication

IOREF pin for voltage reference

### Board Dimensions

Length

10.2 cm (4 inches)

Width

5.3 cm (2.1 inches)

Thickness

2.2 cm (0.87 inches)

### Operating System

Compatible with Arduino Integrated Development Environment (IDE)

### Applications

Robotics and automation

IoT projects (e.g., home automation, environmental monitoring)

Wearable devices and gadgets

Prototyping and proof-of-concept development

Educational projects and hobbyist experiments

Package Includes

1 x Arduino MEGA 2560 CH340 R3 Compatible Board

1 x USB cable (A-B type)

Note

Please ensure to check the compatibility of the board with your desired projects and systems before making a purchase. Additionally, refer to the Arduino official documentation and tutorials for comprehensive guides on getting started with the board.

Pin Configuration

  • Arduino MEGA 2560 CH340 R3 Compatible Board Pinout
  • The Arduino MEGA 2560 CH340 R3 Compatible Board is a microcontroller board based on the ATmega2560 microchip. It has a total of 54 digital input/output pins, 16 analog input pins, and 4 UARTs (hardware serial ports). Here's a detailed explanation of each pin on the board:
  • Digital Pins
  • 1. Digital Pins 0-53:
  • These pins can be used as digital input/output pins.
  • They can be configured as inputs or outputs using the pinMode() function.
  • Each pin can provide up to 40mA of current.
  • 2. RX (Digital Pin 0):
  • This pin is the serial input for the built-in UART (Serial Port 0).
  • It is connected to the CH340G USB-UART converter chip.
  • 3. TX (Digital Pin 1):
  • This pin is the serial output for the built-in UART (Serial Port 0).
  • It is connected to the CH340G USB-UART converter chip.
  • 4. SDA (Digital Pin 20):
  • This pin is the I2C serial data line.
  • It is used for communication with I2C devices.
  • 5. SCL (Digital Pin 21):
  • This pin is the I2C serial clock line.
  • It is used for communication with I2C devices.
  • 6. SCK (Digital Pin 52):
  • This pin is the SPI clock line.
  • It is used for communication with SPI devices.
  • 7. MISO (Digital Pin 50):
  • This pin is the SPI Master In Slave Out line.
  • It is used for communication with SPI devices.
  • 8. MOSI (Digital Pin 51):
  • This pin is the SPI Master Out Slave In line.
  • It is used for communication with SPI devices.
  • 9. SS (Digital Pin 53):
  • This pin is the SPI slave select line.
  • It is used for communication with SPI devices.
  • Analog Pins
  • 1. Analog Input Pins A0-A15:
  • These pins can be used as analog input pins.
  • They can read analog values from sensors and other devices using the analogRead() function.
  • 2. AREF (Analog Reference Voltage):
  • This pin is used to set the reference voltage for the analog input pins.
  • It can be connected to an external voltage source or to the internal 5V or 3.3V voltage regulator.
  • Power Pins
  • 1. VIN (Voltage Input):
  • This pin is the input voltage pin for the board.
  • It can be connected to an external power source (e.g., a battery or a DC power supply).
  • 2. 3.3V:
  • This pin provides a regulated 3.3V output from the onboard voltage regulator.
  • It can be used to power external devices.
  • 3. 5V:
  • This pin provides a regulated 5V output from the onboard voltage regulator.
  • It can be used to power external devices.
  • 4. GND (Ground):
  • This pin is the ground pin for the board.
  • It should be connected to the ground of the external power source and any external devices.
  • Other Pins
  • 1. Reset:
  • This pin is the reset pin for the board.
  • It can be connected to a reset button or a voltage source to reset the board.
  • 2. ICSP (In-Circuit Serial Programming):
  • These pins are used for programming the ATmega2560 microchip using an external programmer.
  • They are connected to the SPI lines (MOSI, MISO, SCK, and SS).
  • Connecting the Pins
  • When connecting the pins, make sure to follow these guidelines:
  • Use a breadboard or a PCB to connect components to the Arduino board.
  • Use jumper wires or breadboard wires to connect the pins.
  • Make sure to connect the pins correctly, as incorrect connections can damage the board or the components.
  • Use a multimeter to measure the voltage and current of the pins before connecting components.
  • Always follow the datasheet and documentation of the components you are connecting to the Arduino board.
  • By following these guidelines, you can safely and effectively connect the pins of the Arduino MEGA 2560 CH340 R3 Compatible Board to your projects and devices.

Code Examples

Arduino MEGA 2560 CH340 R3Compatible Board Documentation
Overview
The Arduino MEGA 2560 CH340 R3 Compatible Board is a microcontroller board based on the ATmega2560 microcontroller. It is compatible with the Arduino MEGA 2560 R3 board and provides a cost-effective alternative for prototyping and development. The board features 54 digital input/output pins, 16 analog input pins, and 4 UARTs (hardware serial ports).
Technical Specifications
Microcontroller: ATmega2560
 Operating Voltage: 5V
 Input Voltage: 7-12V
 Digital I/O Pins: 54
 Analog Input Pins: 16
 UARTs: 4
 USB Interface: CH340 USB-to-TTL Serial Converter
 Clock Speed: 16 MHz
Pinout
The Arduino MEGA 2560 CH340 R3 Compatible Board has the following pinout:
Digital Pins: 0-53
 Analog Pins: A0-A15
 Power Pins: Vin, 5V, 3.3V, GND
 USB Interface: TX, RX, VCC, GND
Code Examples
### Example 1: Blinking LED
This example demonstrates how to use the Arduino MEGA 2560 CH340 R3 Compatible Board to blink an LED connected to digital pin 13.
```c++
const int ledPin = 13;      // the number of the LED pin
void setup() {
  pinMode(ledPin, OUTPUT); // set the LED pin as an output
}
void loop() {
  digitalWrite(ledPin, HIGH); // turn the LED on
  delay(1000);              // wait for 1 second
  digitalWrite(ledPin, LOW);  // turn the LED off
  delay(1000);              // wait for 1 second
}
```
### Example 2: Analog Read and Serial Print
This example demonstrates how to read an analog value from pin A0 and print it to the serial monitor using the Arduino MEGA 2560 CH340 R3 Compatible Board.
```c++
void setup() {
  Serial.begin(9600); // initialize serial communication at 9600bps
}
void loop() {
  int sensorValue = analogRead(A0); // read the analog value from pin A0
  Serial.println(sensorValue);      // print the value to the serial monitor
  delay(500);                       // wait for 500ms
}
```
### Example 3: Serial Communication with UART
This example demonstrates how to use the Arduino MEGA 2560 CH340 R3 Compatible Board to send and receive data using the UART communication protocol.
```c++
void setup() {
  Serial.begin(9600); // initialize serial communication at 9600bps
}
void loop() {
  if (Serial.available() > 0) { // check if data is available in the serial buffer
    char receivedChar = Serial.read(); // read a character from the serial buffer
    Serial.print("Received: "); // print a message to the serial monitor
    Serial.println(receivedChar); // print the received character
  }
Serial.println("Hello, world!"); // send a message to the serial monitor
  delay(1000); // wait for 1 second
}
```
Note: These examples assume that you have the Arduino IDE installed on your computer and have connected the Arduino MEGA 2560 CH340 R3 Compatible Board to your computer via a USB cable.