Arduino Uno R3 vs CH340

The CH340 Arduino board contains an ATmega328P-U-TH chip, which differs from the classic ATmega328P-PU in official Arduino Uno Rev3 boards. The CH340 is an inexpensive USB-to-Serial chip (datasheet here) that takes the place of the Rev3 board’s more expensive ATmega16U2. This creates issues when programming the Arduino board with certain operating systems (specifically Windows), however, for most Linux and Mac systems — there appears to be no issue. In this tutorial, I will explore the CH340 Arduino board to see whether there are differences in performance and power under different operating conditions. This will definitively answer whether the CH340 is a worthy alternative to the Rev3 or if it’s just a cheap imposter.

Parts List

The most important components needed to conduct the subsequent performance tests are:

Arduino Uno Rev3 — $8.99 [Amazon]

Arduino Uno CH340 — $11 [Shop]

Alligator Clips — $6.39 [Amazon]

These components will allow the user to test most of the functionality between the two boards. In my particular tests, I will also be using the follow sensors and motors for fully-integrated tests:

SG90 Micro servo — $11.99 (4 pcs) [Amazon]

VL53L0X Time-of-flight I2C sensor — $8.21 [Amazon]

LED — $9.99 (600 pcs) [Amazon]

“As an Amazon Associates Program member, clicking on links may result in Maker Portal receiving a small commission that helps support future projects.”

Compatibility Issues

One of the most cited complaints regarding the CH340 is its lack of compatibility with certain operating systems. I have tested the CH340 and Uno Rev3 on several systems with the following results:

Operating System Compatibility
Linux ✔
Windows ✔
Mac X

Some recommend the following the download procedure outlined here: https://sparks.gogo.co.nz/ch340.html

However, I prefer to use a Raspberry Pi where the drivers are naturally compatible with the Arduino IDE and Linux.

Upload Speeds

Another area that is often referenced as a point of contention is the time to upload. Below I use different sized sketches to determine whether upload times are different between the CH340 board and the Uno Rev3.

Sketch Size [Bytes] Rev3 Upload Time [s] CH340 Upload Time [s]
453 5.2 5.5
4874 9.4 9.7
7230 9.5 10.7
10758 12.7 12.4
15789 15.9 15.6

upload_times.png

Upload Time Comparison for CH340 and Rev3 Uno Boards

Power Consumption

Both the CH340 and Rev3 boards were put through various routines with 5V supply and a multimeter in series. This allowed for measurement of current consumption to approximate the difference between each board. Surprisingly, the CH340 board was much more efficient than the Rev3 board universally. A table and bar chart of the results are shown below.

Parameter Rev3 Current [mA] CH340 Current [mA]
Bare Minimum 32.5 15.0
Serial 33.0 16.7
I2C 37.0 19.5
LED Blink (20ms) 36.6 18.9
Low Power Sleep 23.8 5.0

Rev3 Uno vs. CH340 Uno

Timed Comparisons

The next logical comparison between the two board is the timing difference in computation and I/O tasks. Again, several routines were computed for each board and then compared. The millis() function was used to approximate run time for several tasks, each outlined in the table below.

Routine Rev3 Time [ms] CH340 Time [ms]
Serial Print n 2 , n = 0 — 1000 890 890
1,000 Analog Reads 112 112
100,000 PWM Writes 443 443
10 I2C Communications 409 410

Since both boards are ATmega328P boards, we wouldn’t expect any difference between the two boards, and just as the table indicates — there is unanimously NO DIFFERENCE AT ALL between the boards and the specified tasks timed above.

Conclusion

I think that the CH340 is often considered a poor alternative to the Uno Rev3, however, most of the tests done in this post demonstrate the opposite. The CH340 is nearly as fast at uploading sketches, the CH340 board is universally more efficient than the Rev3 (at 5V), they both run at the same speed when computing, and the CH340 is universally cheaper. The only widespread known issue with the CH340 is its incompatibility with MacOS. And ultimately, if you are using a Raspberry Pi, Linux, or Windows system — you won’t have any noticeable issues with the CH340 when compared to the Rev3. That being said, I did not cover all of the possible issues between the two boards, however, I did analyze many of the common misconceptions between the two. Therefore, I can definitively say: the CH340 Uno board is just as good as the Uno Rev3 for ordinary maker-based projects.


Источник: makersportal.com