Silicon ChipThe Arduino Uno’s cousins: the Nano and Mega - December 2018 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Love or hate Google, the massive EU fine is a joke
  4. Feature: "The Grand Tour": the incredible Voyager missions by Dr David Maddison
  5. Project: An incredibly sensitive Magnetometer to build by Rev. Thomas Scarborough
  6. Project: Amazing light display from our LED Christmas tree... by Tim Blythman
  7. Feature: The Arduino Uno’s cousins: the Nano and Mega by Jim Rowe
  8. Subscriptions
  9. Serviceman's Log: Travelling makes me go cuckoo by Dave Thompson
  10. Christmas Showcase
  11. Project: A Useless Box by Les Kerr & Ross Tester
  12. Feature: El cheapo modules, part 21: stamp-sized audio player by Jim Rowe
  13. PartShop
  14. Project: Low voltage DC Motor and Pump Controller (Part 2) by Nicholas Vinen
  15. Vintage Radio: 1948 AWA compact portable Model 450P by Associate Professor Graham Parslow
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: Tinnitus & Insomnia Killer, November 2018; LED Tachometer, October-November 2006
  19. Outer Back Cover: Hare & Forbes Machineryhouse

This is only a preview of the December 2018 issue of Silicon Chip.

You can view 37 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "An incredibly sensitive Magnetometer to build":
  • Extremely Sensitive Magnetometer PCB [04101011] (AUD $12.50)
  • Extremely Sensitive Magnetometer PCB pattern (PDF download) [04101011] (Free)
  • Drilling template for the High-Sensitivity Magnetometer (PDF download) (Panel Artwork, Free)
Items relevant to "Amazing light display from our LED Christmas tree...":
  • Software for Amazing Light Patterns for the LED Christmas Tree (Free)
Articles in this series:
  • Oh Christmas tree, oh Christmas tree... (November 2018)
  • Oh Christmas tree, oh Christmas tree... (November 2018)
  • Amazing light display from our LED Christmas tree... (December 2018)
  • Amazing light display from our LED Christmas tree... (December 2018)
Items relevant to "A Useless Box":
  • Useless Box PCB [08111181] (AUD $7.50)
  • Pair of programmed micros for the Useless Box [0811118A/B.HEX] (Programmed Microcontroller, AUD $20.00)
  • Software for the Useless Box (Free)
  • Useless Box PCB pattern (PDF download) [08111181] (Free)
  • Useless Box panel label (Panel Artwork, Free)
Items relevant to "El cheapo modules, part 21: stamp-sized audio player":
  • DFPlayer Mini audio player module (Component, AUD $6.00)
  • Sample BASIC source code for interfacing a Micromite with the DFPlayer Mini module (Software, Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
Items relevant to "Low voltage DC Motor and Pump Controller (Part 2)":
  • Four-channel High-current DC Fan and Pump Controller PCB [05108181] (AUD $5.00)
  • PIC16F1459-I/SO programmed for the Four-channel High-current DC Fan & Pump Controller (0510818A.HEX) (Programmed Microcontroller, AUD $10.00)
  • Firmware for the Four-channel High-current DC Fan & Pump Controller (0510818A.HEX) (Software, Free)
  • Four-channel High-current DC Fan and Pump Controller PCB pattern (PDF download) [05108181] (Free)
Articles in this series:
  • Low-voltage, high-current DC Motor Speed Controller (October 2018)
  • Low-voltage, high-current DC Motor Speed Controller (October 2018)
  • Low voltage DC Motor and Pump Controller (Part 2) (December 2018)
  • Low voltage DC Motor and Pump Controller (Part 2) (December 2018)

Purchase a printed copy of this issue for $10.00.

The Mega and Nano The Arduino Uno is probably the most widely used micro in the world. We’ve used it in quite a few of our projects. But you may not be aware of its “little brother”, the Nano, or its “big brother”, the Mega 2560. Jim Rowe explains the differences between these Arduino variants. I n this article, we’ll describe the latest “Revision 3” versions of all three modules. We won’t mention the earlier versions or other variants like the Leonardo or Duemilanove. That’s partly because those other variants are less popular nowadays than the three modules discussed here. Let’s start with the Nano, which is smaller than and slightly cheaper than the Uno. The photos show just how tiny it is, measuring only 45 x 18 x 18mm. Despite its small size, most of its capabilities are identical to those of the Uno. In one respect, it’s actually better, offering eight analog-to-digital converter (ADC) input channels instead of six. It uses the same CPU as the Uno, an ATmega328P but it has the 32-lead TQFP (SMD) package version rather than the 28-pin DIP version used in the Uno. Two of those extra pins are the additional analog inputs. Like the Uno, it has 32kB of flash memory, 1kB of EEPROM and 2kB of static RAM, a RISC instruction set including two-cycle 8x8 multiplication, 23 programmable I/O lines, 32 8-bit 44 Silicon Chip working registers, two 8-bit timer/ counters and one 16-bit timer/counter (with prescalers), a master/slave SPI serial interface and a byte-orientated I2C interface. But keep in mind that the Nano’s small size means that its I/O pins are broken out to two 15-pin SIL connectors. As a result, it’s not directly compatible with Arduino shields designed to plug into the Uno. It also lacks the Uno’s concentric DC power input socket and instead, receives its power via the mini-USB socket. There are adaptor shield modules available for the Nano but it’s best regarded as the Arduino most suitable for mounting directly on another PCB. That’s the way we used it in our Brainwave Monitor project, described in the August 2018 issue of Silicon Chip (siliconchip.com.au/Article/11185). Inside the Nano The full circuit of the Arduino Nano is shown in Fig.1. This circuit is for the lower-cost Chinese-made version, which uses a CH340G chip for the USB interface instead of the FT232RL chip Australia’s electronics magazine used in the US/European version. Otherwise, the two versions are essentially and functionally identical. It has a 6-pin header for in-circuit serial programming (ICSP) or SPI serial bus connections, a reset pushbutton switch (S1) and four tiny LEDs to indicate power on, serial data transmit/receive and a general purpose/programming indication LED connected to pin D13 (SCK). These are all identical in function with those on the Uno. As mentioned above, all the micro’s I/O pin connections are brought out to pins on the two 15-pin SIL headers, J1 and J2. So basically, the Nano can be regarded as a “Bonsai” version of the Uno (or perhaps more appropriately “penjing” given its Chinese origin). This, and its more standard SIL header layout, makes it better suited for building into other projects. The Mega 2560 The Mega 2560 is considerably larger than the Nano or the Uno, at 108 x 53 x 14mm. Not surprisingly, it is also more capable. siliconchip.com.au Fig.1: complete circuit diagram of the Arduino Nano. The genuine Nano boards use a FT232RL for IC1 instead of the CH340G shown, but is otherwise identical. It uses an ATmega2560 micro, essentially a larger version of the ATmega328P chip used in the Uno and Nano. It offers 256kB of flash memory instead of 32kB, 4kB of EEPROM (vs 1kB) and 8kB of static RAM (vs 2kB). So it has eight times as much flash plus four times as much EEPROM and static RAM. Since the ATmega2560 comes in a 100-pin TQFP (SMD) package, it also has many more programmable I/O pins; 86 compared with 23. It also has 16 ADC inputs, compared with six for the Uno and eight for the Nano. Significantly, there’s now also a total of four programmable USART serial I/O ports, compared with the single port on the Uno and Nano. Other siliconchip.com.au features include four 16-bit timer/ counters instead of just one in the Uno/Nano. The ATmega2560 also has a slightly larger set of instructions: 135 compared with the 131 offered on the Uno or Nano. Three of the instructions are used to access and manipulate the extra flash memory of the ATmega2560. These instructions are EIJMP (extended indirect jump), EICALL (extended indirect call), ELPM (extended lead program memory). The last additional instruction (BREAK) is for use with the onchip debugger (JTAG). But there’s still the on-chip twocycle multiplier, the same set of 32 eight-bit working registers, a master/ Australia’s electronics magazine slave SPI serial interface and a byteorientated I2C interface. So the main advantages of the Mega 2560 are the larger memories, the much larger number of programmable I/O pins and of course the three additional programmable USART serial I/O ports. One interesting point to note about the Mega 2560 is that it’s designed to be compatible with Uno shield boards. In effect, all of the extra analog and digital I/O capabilities are added to the right-hand end, as you can see from the photo opposite. This means that standard Uno shields can be plugged into the sockets on the left-hand end of the PCB and they will work normally. December 2018  45 Fig.2: complete circuit diagram of the Arduino Mega 2560. The ATmega16U2 (IC2) is used to handle USB communications. The 6-pin ICSP/SPI header (just to the right of the main CPU) is also in exactly the right position to mate with the socket on Uno shields. The Mega’s additional USART port connections are brought out to an extra 8-pin SIL socket at upper right, with the I2C SDA and SCL pins at the far end. The analog input connections are brought out to another two 8-pin SIL sockets along the bottom right, with one of these sockets effectively replacing the 6-pin socket of the Uno. The additional digital I/O connections are brought out to an 18x2 DIL socket mounted vertically on the far right of the PCB. 46 Silicon Chip So it’s all quite logical and fairly easy to follow, as well as being almost 100% compatible with the Uno and shields intended for use with it. There are also expansion shields available specifically for use with the Mega 2560, which take advantage of its extra capabilities. Banggood has such a prototyping shield available for around $6.00, together with a small (17 x 10) breadboard. Inside the Mega 2560 The full circuit of the Mega 2560 is shown in Fig.2. We’ve redrawn it from the official circuit diagrams because we found these a little hard to follow Australia’s electronics magazine in terms of signal flow. As with most Uno boards, the Mega 2560 uses a separate ATmega16U2 processor to handle USB communications. This is IC2, shown on the left-hand side of Fig.2, with the main ATmega2560 (IC1) over on the right-hand side. All of the circuitry on the left associated with IC2 is virtually the same as that of the Uno and that’s also true of the power supply circuitry at lower left. As with the Uno, the Mega 2560 can be powered either via the USB connector (CON2) at upper left or via the nominal 9V DC input connector CON1, at lower left. And the circuitry associated with IC7b, Q1 and REG1 performs siliconchip.com.au automatic switching between these power inputs. Note also that the Mega 2560, like the Uno, provides a second 6-pin ICSP/ SPI header for IC2, so that it can be siliconchip.com.au reprogrammed if necessary. This additional header is marked as ICSP1 in Fig.2, whereas the ICSP/SPI header for the main processor is over on the far right and marked ICSP2. Australia’s electronics magazine As with both the Uno and the Nano, the Mega 2560 has four indicator LEDs. LED1 and LED2 are connected to pins 11 and 10 of IC2 and show activity on the TXD and RXD lines used for communicating with the host processor. LED3 shows when the module is powered up, while LED4 is driven via IC7a from the PB7/IO13 pin of main processor IC1, to allow it to be turned on or off by program control. This is precisely the same as on the Uno or Nano. Over on the right-hand side of Fig.2, you can see how all of the additional December 2018  47 Shown above are the main differences between the Arduino Nano, Uno and Mega. The prices shown are from https://store.arduino.cc, however, the modules can be found cheaper elsewhere online Below: the three Arduino boards shown at close to actual size for comparison. While the Arduino Mega is directly compatible with the Arduino Uno, the Nano uses a different pin layout and structure, even though its performance specifications are identical. I/O connections of the ATmega2560 (IC1) are brought out to the various SIL sockets and the 18x2 DIL socket. The two 8-pin SIL sockets for the expanded range of ADC inputs are shown at lower left, with the 8-pin socket above them for I2C and the RX and TX lines for the three additional USART ports (RX1-TX3). Then above these again there’s the fourth 8-pin SIL socket and the 10-pin socket, which basically duplicate the functions of the same socket on the Uno: RX0 and TX0, followed by IO215 and then GND, AREF, SDA and SCL. To the right-hand side of IC1, in addition to its ICSP/SPI header (ICSP2) there is the 18x2 DIL socket for the ATmega2560’s extra digital I/O pins, plus two pins carrying the +5V supply line (pins 1 and 2), and another two pins to the module’s ground (pins 35 and 36). So as you can see, the Arduino Mega 2560 is very much an expanded version of the Uno. It has very similar processing power but with considerably more memory, three additional USART ports, 10 additional ADC inputs and more than 60 extra digital I/O lines. It is software compatible with both the Uno and the Nano. These features allow it to run much larger sketches and control more peripheral devices. It’s the Arduino you’ll probably need for applications that are too large for the Uno or Nano. It does cost about twice that of the Uno but it’s still quite good value for money when you consider what it offers. The comparison table above summarises the features of the three Arduino versions we’ve discussed here. At the bottom of the table, it shows comparative price ranges for the three versions but these will vary depending on exchange rates, vendors and other factors. Finally, note that Microchip recently purchased their rival Atmel, the manufacturer of the ATmega chips used in these boards; hence the links below to the product pages refer to the Microchip website. Handy links store.arduino.cc/arduino-nano store.arduino.cc/arduino-mega2560-rev3 microchip.com/atmega328pb microchip.com/ATmega2560 banggood.com/search/mega2560SC 1280-proto-shield.html 48 Silicon Chip Australia’s electronics magazine siliconchip.com.au