Building a Wi-Fi-connected RSS-Reader with an Arduino Nano RP2040 Connect, an LCD and a remote control
The Arduino Nano RP2040 comes with quite decent specifications. Besides the 133 Mhz clock speed, it also has 520 KB SRAM and a Nina W102 module that supports Wi-Fi and BLE. Enough to let it do awesome things on the Internet and built fantastic connected devices.
The Nano pulls the RSS feed on boot and then allows navigating through the headlines with the remote control LEFT and RIGHT buttons as well as scrolling through the title with the UP and DOWN buttons.
While my construction and my code are more of a proof-of-concept, there are some very interesting use-cases for the Nano in combination with Wi-Fi and connected displays like LCDs or E-Ink. It also doesn’t have to be a remote control, hardware buttons could also do the job. But, I had the IR receiver and the LCD lying around, so I wanted to give them a try.
Advantage of the Arduino Nano RP2040 Connect
Yes, there are examples of feed readers out there using the USB bridge to connect to the Internet. However using the Nina chip onboard the Arduino Nano RP2040 Connect in combination with a battery, makes a final construction very portable and low-energy. Soldering the components into a pocket-sized case could make a nice portable RSS feed reader.
Wiring up the Arduino Nano and the breadboard
My board is essentially a combination of two different circuit diagrams. I focused on the more complicated circuit diagram for the LCD and just changed the PIN for the IR receiver.
I found both of the diagrams relatively easy to understand and just merged them together. With the IR remote SS-PIN connected to PIN 10 on the Arduino Nano. The Nina Chip is onboard the Arduino, so there’s no wiring required for the networking. The Nano’s 5V power output doesn’t really produce enough when connected to USB, so instead of the 5V output, I connected the power to the VIN where the juice of the USB input is on. Depending on what power source you’re using, you might consider either putting the LCD on the VIN or on the 5V+. The IR receiver is connected to the 3V3+ as it is sufficient for it. Check the specs of your IR receiver about what voltages it supports.
Configuring the chip and the environment
There are some obstacles and preparations required. Especially since the Nina chip does not contain all root SSL certificates, the desired certificates need to be installed on the chip. Given the limited storage space, the amount of root certificates it can carry are limited. You’d probably use a proxy API in a real-world example or an MQTT gateway.
Installing the drivers on the MacBook M1 Pro
I had written some smaller Sketches with my other Arduinos, but the Nano is quite different. It requires additional drivers and those you mostly find for macOS don’t do it on the Apple Silicon or M1 chips. Hence, I had to download the latest CH340 driver from a Chinese manufacturer.
The installation of the driver was straight-forward and I did not experience any issues with it afterwards. It may help to reboot the Mac after installation.
Setting up the SSL certificate for the Nina chip
Once everything is installed for the Nano, you’ll have an example Sketch that you need to upload to the Nano in order to install the SSL certificate for the desired domain (tagesschau.de in my case): How to add SSL certificates to Wi-Fi Nina modules.
If you don’t add the certificate, the Wi-Fi SSL connect will just fail as it will not be able to initiate the SSL/TLS connection with the remote server. In case you don’t to SSL/TLS or HTTPS, you can skip this part. The chip will just work fine from the start without it.
Linking the required libraries in the Arduino IDE
There are libraries the feed reader needs. WiFiNINA, LiquidCrystal and IRremote are essential for the use-case. The List library by Niklas Kaaf is something I really like, because it is a wonderful List implementation and takes away the pain of managing arrays.
- WiFiNINA by Arduino
- LiquidCrystal by Arduino
- IRremote by Armin Joachimsmeyer
- List by Niklas Kaaf
Once you have installed the libraries in the Arduino IDE, you’re good to continue with the code of the Sketch.
A look at the code of the feed reader
The setup is simple and straight forward. It connects the serial, initialises the LCD and enables the IR receiver. Once that is done, it goes on to connect to the Wi-Fi network and once connected, establishes an SSL connection to the web server from which it requests the data feed. Parsing of the feed is kept very simple (it’s just a proof-of-concept) and extracts the titles of the news items in the feed. Once everything is loaded and ready, it shows the first title of the feed and handles the events of the keys on the IR remote. Keep in mind: IR remote key IDs differ by sensor, board and remote control. Depending on which board, sensor and remote you use, the result may be different.
Yes, the code could have a number of optimizations, but it works as a proof-of-concept. Once all the contents of the feed are loaded, it essentially keeps the titleList in memory and allows to navigate through the list as well as scrolling the titles by moving through the string that contains the title. That essentially happens inside the loop function as well as the renderReader function.
It took me a little less than a day to complete the circuit and the code, so it’s a pretty straight forward approach with the Nano RP2040 Connect. Once you’re comfortable with the Nano and the Nina-Chip, you’re pretty much able to build any circuit and connect it to the Wi-Fi, then let it perform whatever you want it to.
Conclusion of my Arduino Wi-fi feed reader project
I had done some smaller projects with the Arduino Uno, BeagleBone, Rapsberry Pi and the STM32. Take a look at my STM32 practical tutorial connecting it to AWS IoT with MQTT. You could pretty much do the same with the Arduino using the Arduino MQTT client. My problem with the Arduino Uno was always the limited peripherals it had onboard. Especially Wi-Fi and BLE as well as the relatively small memory. My Arduino Uno, which is also an older revision, hits its memory limits quite easily.
Anything I was missing with the Arduino family is pretty much in the RP2040 Connect. Compared to the STM32 development kit, the Arduino IDE is quite comfortable and the ecosystem is significantly larger. Development with the RP2040 is way more comfortable than with my STM32 development kit. The form factor is absolutely brilliant to stuff the RP2040 into almost any case imaginable and build really wonderful things with it and connect them to the Internet or your local network.
I really enjoy the Arduino Nano RP2040 Connect, because of the comfort with the Arduino IDE, the outstanding documentation, a fantastic community and tons of practical examples already out there. I’d definitely recommend it to any maker that wants WiFi and BLE with a powerful SoC.
Thanks for reading and happy making!