Building a Wifi Radio – Part 7, Building an LCD Display

Summary of Building a Wifi Radio – Part 7, Building an LCD Display


This article details the seventh installment of an open-source streaming internet radio project, focusing on constructing an LCD status display using an Atmel ATmega168 microcontroller. It outlines necessary software installation for Windows and Mac users, recommends testing with a blinking LED first, and provides a complete bill of materials including specific capacitors, resistors, and the Sparkfun 16×2 LCD screen.

Parts used in Building an LCD Display:

  • A-B USB cable
  • AVR programmer (such as Adafruit USBTinyISP)
  • Atmel ATmega168 AVR microcontroller
  • Sparkfun 16×2 Character STN LCD display
  • Solderless breadboard
  • 4-pin female 0.1″ header
  • Two 22pF ceramic capacitors
  • One 0.1uF capacitor
  • 10 Ohm resistor
  • Potentiometer (1k or 10k) for contrast adjustment
  • 20 to 24 gauge solid hookup wire
  • Sparkfun ISP breakout board (optional)
  • Normally-open pushbutton switch (optional)

This is the seventh part of an ongoing series about building a low cost, open source streaming internet radio.  If you haven’t already, check out the previous parts (see the links at the end of this article) for some background about the project.
In part six, we used OpenWrt’s UNIX-style shell commands to interface with mpd, the music player daemon, and redirect song and stream information to our ASUS WL-520gU wireless router’s serial port.  In this part, we’ll use a Sparkfun 16×2 LCD display and a handful of other components to build an LCD status display for the radio.Building a Wifi Radio – Part 7, Building an LCD Display

The Atmel AVR Microcontroller:

After much thought, I decided to use an Atmel ATmega168 AVR microcontroller to drive the display.  I realize that this raises the technical level of this project significantly, but I have been wanting to feature an AVR project on the site and this is a great opportunity.  The truth is that an Arduino would work just as well and it shouldn’t be too difficult to port this program to an Arduino sketch.  (The Arduino is built with the same ATmega168 microcontroller, after all.)  If anyone does this, let me know and I’ll post a link to your version of the display.
If you’re an AVR veteran, you can skip over this part and straight to the bill of materials below.
If you are new to the AVR, don’t be intimidated.  There are a number of tutorials online to help you learn how to use this inexpensive and powerful microcontroller.  I recommend starting with this one or maybe this one, but see my note about AVR MacPack below if you’re using a Mac.  If you’ve never programmed in C before, you’ll have an additional hurdle to get over, although for this project you won’t need any actual knowledge of programming or C to burn the code to the AVR and get things working.
You will need to install some software to work with the AVR, I recommend:

  • AVR MacPack for OS X (the Adafruit tutorial recommends OSX-AVR, use this instead)
  • WinAVR for Windows

I recommend following a tutorial or two and getting a simple blinking LED example working on your AVR before building the LCD display.  That way you can be sure your programmer, development environment, breadboard, etc are working first.

Building the display:

Bill of Materials:

You will need:

also nice, but not required:

  • a Sparkfun ISP breakout board to simplify connecting the programmer to the breadboard
  • a normally-open pushbutton switch to reset the circuit

Schematic:

Here is the schematic of the LCD display (click to enlarge):Schematic Building a Wifi Radio – Part 7, Building an LCD Display

Firmware:

You can download the source code and compiled .hex file here.
Special thanks to Peter Fleury for his excellent LCD library, which saved me from reinventing the wheel!  He also has another page about interfacing LCD displays to an AVR.
For more detail: Building a Wifi Radio – Part 7, Building an LCD Display

Quick Solutions to Questions related to Building an LCD Display:

  • What microcontroller is used to drive the display?
    The project uses an Atmel ATmega168 AVR microcontroller.
  • Can I use an Arduino instead of the AVR microcontroller?
    Yes, an Arduino would work just as well because it is built with the same ATmega168 microcontroller.
  • Which software is recommended for OS X users?
    For OS X, the author recommends installing AVR MacPack.
  • What should a beginner do before building the full LCD display?
    Beginners are advised to follow a tutorial and get a simple blinking LED example working first.
  • Do I need programming knowledge to burn the code?
    No, you will not need any actual knowledge of programming or C to burn the code to the AVR for this project.
  • What library was used for interfacing the LCD display?
    The project utilizes an excellent LCD library by Peter Fleury.
  • How can I adjust the contrast on the LCD display?
    You can adjust the contrast using a small 1k or 10k potentiometer.

About The Author

Author avatar

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Stay in the loop

New AVR projects, tutorials and schematics, every week.

Subscribe Browse projects

Scroll to Top