Home Creators Posts Import Register Favorites Logout

Content

If you look at the code for any of my Arduino projects, you'll notice that I make a lot of use of the Serial.print() command. This sends data from the Arduino via the USB serial interface, where it can then be displayed on the Arduino IDE Serial Monitor window on a PC. This a useful way to check the value of any variables, sensor readings, or the overall state of the controller, and is invaluable when writing new code, or debugging strange behaviour.But it can often be useful to be able to read such information directly on the device itself, without needing to plug in a USB cable, or print additonal debug statements. This is true if, for example, you've got an Arduino nested deep in the belly of an escape room puzzle prop. In today's video, I'd like to show you how to use a little (under 1" long) OLED device display which can can provide realtime status information about any aspect of a running sketch.These displays draw very little current, are 3.3V/5V tolerant, can display a surprising amount of information, and use an I2C interface that requires only 2 Arduino pins.I'm using the lcdgfx library from https://github.com/lexus2k/lcdgfx which creates the interface to the display itself, and also provides some nice utility functions to create a scrollable menu UI.You can buy a 128x32 pixel board like the one I'm using for about $3 from https://www.banggood.com/custlink/K3vDNrCGJP

Files

Creating an Arduino Status Monitor using OLED Display

Arduino coders will be familiar with writing Serial.print() statements peppered around their code to send debug information, or monitor the readings of sensors or other inputs, by sending it via a USB connection and displaying on the Arduino IDE Serial Monitor. But there are many occassions when it's useful to be able to check the status of a running sketch or read configuration information directly on the device itself - and that's where these tiny little OLED screens can come in handy. They draw very little current, are 3.3/5V tolerant, can display a surprising amount of information even on a 128x32px display, and use an I2C connection that requires only two pins on the processor. In this example, I'll create a small status monitor that displays build information and Wi-Fi connection information from a WeMos D1 mini, but you can use the same approach on any Arduino UNO or Nano board or similar microprocessor, and use the lcdgfx library to display whatever information you like in a nice UI menu. I'm using the following library to interface with the display: https://github.com/lexus2k/lcdgfx You can buy a 128x32 pixel board like the one I'm using for about $3 from https://www.banggood.com/custlink/K3vDNrCGJP Part of my Escape Room Tech Advent Calender for 2019! For my Escape Room tech projects, see https://www.patreon.com/playfultech

Comments

Suzanne Heeg

It's me again! I am trying to debug my Rotary Telephone project and I wanted to add an OLED status display because I have a LOT of debugging to do. I'm using the Arduino Nano that you suggested and I downloaded and copied the lcdgfx.h file from the indicated github link. I placed only the h file in my SRC folder and added the following line to my Include statements:

Suzanne Heeg

#include "src/lcdgfx.h" When I tried to compile the script, I got an error message stating: "Error compiling for board Arduino Nano" Is there a different h file that I should be using for the Arduino Nano? Do I need to include the entire downloaded Github library in a folder within the project?