Silicon ChipTwo new Arduino Nanos: the “Every” and the “33 IoT” - October 2019 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Encouraging chip developments
  4. Feature: History of Cyber Espionage and Cyber Weapons, Part 2 by Dr David Maddison
  5. Project: 45V, 8A Bench Power Supply to build by Tim Blythman
  6. Feature: Two new Arduino Nanos: the “Every” and the “33 IoT” by Tim Blythman
  7. Product Showcase
  8. PartShop
  9. Project: High resolution Audio Millivoltmeter/Voltmeter by Jim Rowe
  10. Feature: Three Arduino Motor Driver Shields by Tim Blythman
  11. Serviceman's Log: A shockingly cute new companion by Dave Thompson
  12. Project: Solving one of Home Automation’s biggest beefs! by Tim Blythman
  13. Project: Precision Audio Signal Amplifier by Jim Rowe
  14. Subscriptions
  15. Vintage Radio: Healing M602T transistor mantel radio by Ian Batty
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: Six-decade Resistor Sorter, September 2019; Gamer’s Simulation Seat, September 2019; Voice Modulator for Sound Effects, August 2019; Vintage Radio - National AKQ, July 2019; 433MHz Data Range Extender, May 2019; High power H-bridge, November 2017; RGB to Component Video Converter, October 2004
  19. Outer Back Cover

This is only a preview of the October 2019 issue of Silicon Chip.

You can view 39 of the 112 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.

Articles in this series:
  • History of Cyber Espionage and Cyber Weapons, Part 1 (September 2019)
  • History of Cyber Espionage and Cyber Weapons, Part 1 (September 2019)
  • History of Cyber Espionage and Cyber Weapons, Part 2 (October 2019)
  • History of Cyber Espionage and Cyber Weapons, Part 2 (October 2019)
Items relevant to "45V, 8A Bench Power Supply to build":
  • 45V/8A Linear Bench Supply PCB [18111181] (AUD $10.00)
  • FJA4313OTU 15A NPN transistor (Source component, AUD $10.00)
  • LM317HVT regulator and INA282AIDR shunt monitor IC for 45V 8A Linear Bench Supply (Component, AUD $15.00)
  • 3mm acrylic heatsink spacer for High-power Linear Bench Supply (PCB, AUD $2.50)
  • High Power Linear Bench Supply PCB pattern (PDF download) [18111181] (Free)
  • High Power Linear Bench Supply panel artwork and drilling/cutting diagrams (PDF download) (Free)
Articles in this series:
  • 45V, 8A Bench Power Supply to build (October 2019)
  • 45V, 8A Bench Power Supply to build (October 2019)
  • Digital Panel Meter/USB Display suits a range of projects (November 2019)
  • High performance linear power supply – part two (November 2019)
  • Digital Panel Meter/USB Display suits a range of projects (November 2019)
  • High performance linear power supply – part two (November 2019)
  • High performance linear power supply – part three (December 2019)
  • High performance linear power supply – part three (December 2019)
Items relevant to "High resolution Audio Millivoltmeter/Voltmeter":
  • High Resolution Audio Millivoltmeter PCB [04108191] (AUD $10.00)
  • Arduino sketch for the High-Resolution Digital Audio Millivoltmeter (Software, Free)
  • High Resolution Audio Millivoltmeter PCB pattern (PDF download) [04108191] (Free)
  • High Resolution Audio Millivoltmeter lid panel artwork and drilling diagrams (PDF download) (Free)
Items relevant to "Precision Audio Signal Amplifier":
  • Precision Audio Signal Amplifier PCB [04107191] (AUD $5.00)
  • Precision Audio Signal Amplifier PCB pattern (PDF download) [04107191] (Free)
  • Precision Audio Signal Amplifier lid panel artwork and drilling diagrams (PDF download) (Free)

Purchase a printed copy of this issue for $10.00.

NEW FROM Nano Every and Nano 33 IoT Several new Arduino Nano boards were recently released. We got a hold of the two most interesting new boards, the Nano Every and Nano 33 IoT, to see what’s new, figure out how to use them and get an idea of what they’re good for. T he Arduino company has added four new Nano boards to their range. These use the same compact and breadboard-friendly form factor as the original Nano, but with a lot of extra performance and features. To program these, you will need to be familiar with the Arduino software environment, specifically, their Integrated Development Environment (IDE) which can be downloaded for free from: siliconchip.com.au/link/aatq The Nano Every The first board we will look at is called the “Nano Every”. Instead of using the ATmega328 processor used in the Arduino Uno, Duemilanove and Nano (among others), it has the much newer ATmega4809 micro. This board is an upgraded drop34 Silicon Chip in substitute for the older Nano. The pin layout is the same and its I/O pins work at 5V levels, in contrast to many other recent Arduino boards which have 3.3V I/O levels. One example of a 3.3V Arduino is the Arduino MKR Vidor 4000 which we reviewed in March this year (siliconchip.com.au/Article/11448). The Nano 33 IoT The second board we’re reviewing is the Arduino Nano 33 IoT. The “33” emphasises the fact that this board has 3.3V I/O levels. It is based on a SAMD21G18A (ARM Cortex M0+) processor and has the same NINA W102 WiFi module as the Vidor Review by Tim Blythman Australia’s electronics magazine board mentioned earlier. The WiFi features are the reason for the “IoT” (Internet of Things) designation, as you need network connectivity for that. The two other boards released at the same time as these are the Nano 33 BLE and Nano 33 BLE Sense. Both are based on a NINA B306 module, which provides support for Bluetooth. The difference between the two is that the Sense version boasts several extra sensors; these add up to make it the most expensive Nano series board. We haven’t bothered reviewing those two because we think that the WiFi version is more generally useful, while also being cheaper. Price Speaking of price, these new Nano boards are inexpensive. From the ofsiliconchip.com.au ficial Arduino store (at https://store. arduino.cc/usa/nano-family), the Nano Every is less than half the price of even the original Nano, coming in at US$9.90 (approx AU$14.50 at press time). The Nano 33 IoT is just US$18.00 (approx AU$26.90), even less than an R3 Arduino Uno board. The headers are included separately with both packs, and we had no hesitation in saving ourselves the $2 or so that it would have cost us to have them fitted at the factory. Nano Every details The “Getting Started” page at www. arduino.cc/en/Guide/NANOEvery notes that the Nano Every is fully compatible with the original Nano. Table 1 shows a comparison between the specifications of the ATmega4809 micro (as used in the Nano Every and the Uno WiFi Rev2 board) and the good old ATmega328. We’ve also included the SAMD21G18A in this comparison, as used in the Nano 33 IoT. Note though that the Nanos, as supplied, can’t necessarily use all of their theoretical capabilities. For example, the Nano Every runs at 16MHz, despite the chip being capable of 20MHz (it’s even listed on the Every’s product page as 20MHz). The reason is that it has a 16MHz crystal onboard. Also, the original Nano only had 30kB available for user programs, as 2kB of the chip’s memory is reserved for the bootloader. The Nano Every does not use a bootloader, but instead is directly programmed by a second chip on the board, so the full 48kB is available. The extra flash (+50%) and RAM (+200%) on the Every are welcome improvements. RAM is especially tight on the ATmega328-based Arduinos. We doubt most users will be inconvenienced by the smaller EEPROM size; generally, you only need to use it to store a few settings. The ATmega4809 can write to its own flash, so you can allocate some of that as non-volatile storage, although the Arduino framework doesn’t provide an easy way to do this (and it doesn’t have anywhere near the endurance or convenience of a proper EEPROM). As shown in Table 1, the ATmega4809 is programmed via UPDI (Unified Program and Debug Interface). siliconchip.com.au Flash Memory SRAM EEPROM Programming method Max clock speed SPI/UART/I2C interfaces ADC pins ATmega328 32kB 2kB 1024B ICSP 20MHz ATmega4809 48kB 6kB 256B UPDI 20MHz SAMD21G18A 256kB 32kB 0B Bootloader 48MHz 3 6 3 8 (6 in DIP) 16 7 Table 1 - Arduino Nano micros comparison We’ve seen UPDI previously on the ATtiny816, which we reviewed in January 2019 (siliconchip.com.au/Article/11372). UPDI only requires one extra pin apart from power and ground connections, and this is usually shared with the RESET pin, meaning that no I/O pins are lost. The second chip on the Nano Every is a very capable ARM-based ATSAMD11D14A. It programs the ATmega4809 via UPDI, and it also acts as the USB-Serial bridge (much like the Microbridge chip in the Micromite BackPack V2/V3 and recent Explore-28). Six pads on the back of the board are connected to the ATSAMD11D14A and can be used to update its firmware, should that become necessary. The USB interface is provided via a micro-USB socket, as is common on mobile phones. Also on the Nano Every board is an MPM3610 regulator, providing a regulated 5V rail from the VIN pin. This IC is a switchmode device which can deliver up to 1.2A from input voltages up to 21V. This is a major improvement from previous Arduinos, so now the 5V rail can supply high currents to connected peripherals without the regulator overheating. Watch out for Clones of the Nano Every as they may revert to an inferior linear regulator to reduce the cost! There’s also a 3.3V regulator to power the ATSAMD11D14A and three lev- el shifting transistors for the TX, RX and UPDI lines. These are rounded out with two LEDs (for power and digital pin 13 activity), a reset button and the usual passives like bypass capacitors. The I/O pin mounting pads have castellated edges, making it possible to surface-mount the board on another PCB instead of soldering on headers. It has been suggested that it could be possible to add features to this board by reprogramming the ATSAMD11D14A bridge chip. However, the extra ATmega16u2 chip on Uno boards was also capable of this, yet such mods were never particularly popular. As of writing this article, a minor bug exists in the USB-Serial bridge firmware of early releases of the boards which can cause it to lock up when receiving more than 128 bytes from the serial port. New boards will have this bug fixed, but there are already quite a few in circulation with that problem. The firmware can be updated by using the “bossac” program, which is installed with SAMD board profiles under the Arduino IDE. Nonetheless, this is still an inconvenience which could cause some frustration for inexperienced users (at which Arduino is firmly aimed). Using the Nano Every The ATmega4809 processor on the Every has some newer features that have been added to the AVR family since Microchip’s takeover of Atmel in 2016. Screen1: the Nano Every requires the “megaAVR” board profile. It can be installed from the Boards Manager in recent versions of the Arduino IDE, as shown here. Australia’s electronics magazine October 2019  35 Like many Arduino boards, the hardware designs are available for download, although the Nano Every would be harder to build than the older through-hole boards. The back of the PCB is empty, allowing it to be mounted flat on a PCB using the castellated pads along its edges. These photos are shown about twice life size for clarity. (Actual size of the Arduino Nano Every is 43 x 18.5mm) These include custom-configurable logic (CCL), programmable look-up tables (LUT), a peripheral Event System and more. However, there are not many libraries presently available to take advantage of these new features. The so-called “megaavr” software core needs to be installed in the Arduino IDE to use the Every. It can be installed from newer (1.6.4 or later) versions of the IDE by using the Boards Manager and searching for “megaavr”. Screen1 shows the result of this search. Make sure you use megaavr version 1.8.3 or later as earlier versions had some bugs. Once installed, the board can be selected from the Arduino megaAVR digitalRead digitalWrite pinMode multiply byte divide byte add byte multiply integer divide integer add integer multiply long divide long add long multiply float divide float add float itoa() ltoa() dtostrf() random() y l= (1<<x) bitSet () analogRead() analogWrite() PWM Nano Every 6.679µs 6.459µs 3.244µs 0.570µs 5.297µs 0.381µs 1.263µs 14.052µs 0.759µs 5.547µs 38.362µs 1.514µs 7.314µs 78.337µs 9.692µs 12.792µs 125.487µs 76.687µs 90.512µs 0.444µs 0.444µs 112.887µs 6.932µs boards group under the Tools menu. We compiled and uploading the “Blink” sketch to test that everything worked as expected. This resulted in a sketch size of 1370 bytes, and the upload took a few seconds. There was an error message “Cannot locate ‘flash’ and ‘boot’ memories in description”, but it worked despite that. Interestingly, the “Blink” sketch compiled for the original Nano comes to around 930 bytes; even a blank sketch compiles around 400 bytes larger on the Every than the original Nano. This is due to the extra initialisation code that the Arduino IDE tacks on. It’s a minor loss compared to the extra 16kB of flash on the chip. Original Nano Nano 33 IoT 5.032µs 0.984µs 4.532µs 1.913µs 4.470µs 1.931µs 0.632µs 0.197µs 5.412µs 0.636µs 0.443µs 0.197µs 1.386µs 0.171µs 14.277µs 0.591us 0.883µs 0.171µs 6.102µs 0.168µs 38.662µs 0.596µs 1.763µs 0.169µs 7.932µs 3.016µs 80.162µs 11.721µs 10.107µs 2.806µs 12.597µs 3.041µs 125.987µs 16.196µs 78.637µs 91.412µs 9.546µs 0.569µs 0.569µs 0.123µs 111.987µs 422.946µs 7.167µs 6.801µs Table 2 - Nano board performance comparison (lower is better) 36 Silicon Chip Australia’s electronics magazine Occasionally, we found that the Every stalled during the upload process. Because sketch uploading requires the transfer of much data over the serial port, we suspect this is related to the bug noted earlier. We found a benchmarking test sketch online at: http://siliconchip. com.au/link/aau5 We compared the Nano Every against the original Nano using it. On the original Nano, the sketch compiled to 20722 bytes, while the Every needed 21600 bytes, almost 1kB more. Otherwise, the performance is quite similar, and there’s nothing significant enough to favour one over the other speed-wise (see Table 2). There is an option in the tools menu of the IDE to change the “Register Emulation” to suit either the ATmega328 or ATmega4809. It appears this is part of Arduino’s pitch that the Every is compatible with the original Nano. We saw no effect from changing this option. The “Getting Started” page mentions that this option may help with sketches that contain assembly language or do not manage pin mapping. We found that some sketches using direct port writes would not compile for the Every, even though they did compile for the Uno WiFi Rev2 (which has the same microcontroller). Most users would not run into this problem, but it suggests that some third-party libraries will not work on the Nano Every. Interestingly, there is one less PWM channel available on the Every than on the original Nano. Pin 11 can no longer be used for PWM, so sketches that depend on this feature are also not compatible with the newer board. Is it Every-thing we hoped for? Probably the biggest advantage of siliconchip.com.au The Nano 33 IoT is packed with components; the NINAW102 WiFi module is easily the largest. The slotted metal piece at far right is the 2.4GHz antenna. It’s unfortunate that the only space for pin markings is on the back of the package. If you don’t need access to the reset button and status LEDs, the headers could be mounted on the opposite side, to allow the markings to be seen while the Nano is plugged into a breadboard. Again, these are shown about twice life size. the Every is its price. Given that it’s cheaper than the genuine original Nano and has more flash and RAM, unless you absolutely need compatibility with the original Uno/Nano, you might as well use the Every instead. It is one of the handiest 5V-based Arduino boards available. Like some of the newer PIC microcontrollers, the ATmega4809 offers peripheral pin select, meaning its internal peripherals can be re-mapped to different pins. It also offers CCL (configurable custom logic) which allows simple logic functions to be performed in hardware on the input and output signals. An example would be gating a clock signal with an AND gate or inverting a signal with a NOT gate. These features are a bit beyond the scope of the intended Arduino audience, but advanced users can experiment with them by diving deep into the data sheet and tweaking the internal registers directly. These features will allow the Every to be much more efficient at certain tasks than the original Nano. Interestingly, since Microchip’s MPLAB X IDE supports the ATmega4809, you could program it using that software instead, using pure C/ C++ rather than the modified version of C++ used in the Arduino IDE. So it is even less likely than the Every to be compatible with existing Nano projects. It does, however, maintain the six PWM outputs in familiar locations and adds a seventh PWM output at digital pin 2. Like other SAMD based boards, though, it is only compatible with 3.3V I/O levels. The Nano 33 IoT is very similar to the Vidor in many aspects. WiFi is provided by the same NINA W102 module (which contains an ESP32 running custom firmware) and it also has an ATECC608A crypto chip, similar to the ATECC508A on the Vidor. The Nano 33 IoT is also similar to the larger MKR WiFi 1010 board. The crypto chip is used for encrypting WiFi and internet communications. There is also an onboard LSM6DS3 IMU (inertial measurement unit) which connects to the main processor via an I2C bus. The IMU can be used to detect the orientation and rotation of the board. There is no separate serial-USB converter, as the SAMD21G18A has its own USB interface which provides a virtual serial port. Otherwise, the board is similar to the Every. An MPM3610 switchmode regulator provides the 3.3V rail. A 5V rail is only available directly from the USB port and if a solder jumper is closed. The power and pin D13 LEDs, a reset button and a handful of passives complete the board. We didn’t find any bugs affecting the Nano 33 IoT, probably because it is so similar to other MKR series boards such as the Vidor which have been around for a while. Using the Nano 33 IoT The Nano 33 IoT can also be added to the Arduino IDE through the Boards Manager. See Screen2 for the correct board profile to install; we recommend searching for “samd” although it brings up more than one result. The option including the Nano 33 IoT name is correct. Click on the item then click the button to install it. Note that the Vidor board had its own separate “SAMD beta” board profile, but these have now been merged into one. Again, We tried the “Blink” sketch, and everything worked as expected. We then tried the same benchmarking program as before. We had to delete some of the tests as it appears that the functions they use are not defined under the SAMD board profile. Although a minor Nano 33 IoT details The Nano 33 IoT has the same footprint as the other Nano boards. Like the Every, if it is ordered without headers attached, it can be surface-mounted on another PCB as if it were a component. The SAMD21G18A processor is common to many of the newer 32-bit Arduino boards, including the Vidor board that we reviewed previously. This is a very different architecture to AVR-based boards. siliconchip.com.au Screen2: the Nano 33 IoT requires the “SAMD” board profile, which also supports many other recent Arduino boards, including the Vidor and other MKR series boards. Australia’s electronics magazine October 2019  37 you can connect devices like a USB flash drive to it. Libraries to support these features are included with the board profile. With features such as WiFi, USB and onboard sensors, the chances of this board having everything you need already present are quite good. We were able to run all our tests without even having to solder the header pins. Size becomes the predominant factor. The verdict Screen3: the “WiFiNINA” library is required to use the WiFi module on the Nano 33 IoT. This library also interfaces with the onboard crypto chip. problem, that indicates a lack of total compatibility. The compiled code was around 33kB, larger again than for either of the other Nanos. This is not unexpected as the Nano 33 IoT has a 32-bit processor compared to the other boards’ 8-bit processors. You can see the results in Table 2. Those which we could not run appear as blank rows. It is substantially faster in almost every test. The one outlier is the analogRead(), which is much slower on the Nano 33 IoT, presumably due to a longer analog sampling time. We also scanned the I2C bus to detect the onboard devices. The IMU IC is at address 0x6A, which matches the address in the LSM6DS3 datasheet with its SA0 pin tied low. The crypto chip was not listed, but if it is like the Vidor, the address will be 0x60. To make use of the WiFi module, you need the “WiFiNINA” library. This can be installed through the Library Manager (accessible from the Sketch → Include Library → Manage Libraries… menu option) by searching for “wifinina” search term. See Screen3 for details; it is the topmost library. The library also includes some sample code, found under the File → Examples → WiFiNINA menu. We tested the ability of the board to use encryption with the “WiFiSSLClient” example sketch. This requires the SSID and password of an internet-connected WiFi network to be added, after which the sketch connects to a Google server using HTTPS (port 443) and performs a search with the query term “arduino”. The retrieved text can then be displayed (after copying and saving) as a web page. There’s an old joke which says that the “S” in “IoT” is for security. So it’s refreshing to find that this IoT board makes it so easy to connect and communicate using secure protocols. You also need a library to use the onboard IMU. The recommended one is called “Arduino_LSM6DS3” and can be found by searching for its name in the Library Manager, as shown in Screen4. Two example sketches show how to read the orientation and rotation from the sensor. Another great feature of the SAMD21G18A is that it can operate as both a USB device and a USB host, meaning The Nano 33 IoT packs a lot into a small size. It’s a radical departure from the original Nano and is not in the same league: it’s pretty much better in every way (unless you need 5V I/Os) and despite this, is cheaper than a genuine original Nano. Really, the only Nano feature that’s left is the footprint! We think this board will be very popular. The ability to work as a USB device such as a keyboard means we may see the Arduino Micro board being replaced as the default choice for applications that require it. The minimum regulator input voltage of 4.5V means that it cannot run from a Li-ion or LiPo cell, but that is a minor quibble. However, larger boards such as the MKR range can run from a lithium rechargeable battery and provide the required charge and regulator functions. Along with the Every, the ability to use the board as surface-mounted components is helpful as it means you can test your design on a breadboard, then easily mount them on a larger PCB in the final application. Where to get them As well as the Arduino online store (https://store.arduino.cc/usa/arduinonano), they are starting to appear at other retailers, including: Digikey: siliconchip.com.au/link/aav0 Mouser: siliconchip.com.au/link/aav2 Core Electronics: siliconchip.com.au/link/ aav1 Screen4: the IMU (inertial measurement unit) on the Nano 33 IoT can be easily accessed using the “Arduino_LSM6DS3” library. Two example sketches are included. 38 Silicon Chip Australia’s electronics magazine Digi-key and Mouser both offer free express international delivery for orders over AU$60, so if you order a few Nanos (or one or two Nanos plus some other parts), you won’t have to pay for postage. SC siliconchip.com.au