This project is a sub-project of the InternetRadio project. The goal of the InternetRadio project is a project to build an MP3 playing radio that streams its sound over WiFi from radio stations on the internet. As part of its development, the need arose to have a dedicated board for input (buttons) and output (Nokia 5110 LCD).
At one point, the InternetRadio electronics was to be mounted in an enclosure. In the first version of the front panel, the LCD is the Adafruit breakout board, while the buttons are mounted on a separate breakout board, which is in fact the button section of the “full” radio PCB, that I sawed off for this purpose. (The “full” PCBs were manufactured in China: a pack of prototype PCBs contains around 10 boards, out of which I would use only 3 or 4, so I could easily sacrifice one to use for mounting the buttons.)
It looks and works OK, but the way everything is mounted in the case is a bit of a mess:
More elegant solution
A more elegant solution would be to have an integrated front panel, with the LCD screen and the buttons mounted on the same board. That way they can be better aligned, and mounted closer to the surface. It also saves a bunch of wires going to the various components, since e.g. power supply can be grouped for several functions.
The Nokia LCD screens can be bought for cheap on Aliexpress; they are used screens though, so the quality varies: some are pristine, but others will have scratches, or other defects. The ones I bought turned out to be of the LPH 7366 type. This page has a bunch of info on these and other Nokia LCD types: http://serdisplib.sourceforge.net/ser/pcd8544.html.
The LCD is held in place using metal lips that go through the PCB, and that can click in place, or that can be twisted. I didn’t know how to design the slots in Eagle, so they were approximated using several drill holes next to each other. This is not so clean, but it worked fairly well. It should be noted that the LCDs do not come with backlight LEDs, so you have to provide these yourself. The LCD enclosure does have cutouts for them.
Here is an Eagle footprint for the LPH-7366 LCD: Eagle footprint for LPH-7366.
The footprint shows where the cutouts for mounting the LCD need to be, and also where the LEDs for the backlight have to be placed.
In fact, the I/O board would have to perform 3 functions:
- buttons the buttons are pull-up buttons: the GPIO pins are configured with pull-down resistors, and pressing a button pulls the corresponding GPIO pin high. So, for this function, the board will have the 4 buttons, each with a 1kΩ protection resistor, connecting the corresponding pin header connections to Vcc.
- LCD control lines these go from the pin header connections to the LCD connector. In addition to the control lines, we also connect Vcc and GND. We don’t expose the Chip Select line, since the presence of the Data/Command line in the LCD bus makes it “not quite SPI”, and we’ll have to bit-bang the protocol using GPIO pins anyway.
- LCD backlight the backlight consists of 4 LEDs protected by 100Ω resistors. In order to have a dimmable backlight, we can use a PWM power supply, but we can’t connect the 4 LEDs directly to a PWM pin on the microcontroller. So the board will have a NPN transistor to switch the LEDs on and off from a tiny signal.
The board will have a 12-pin header to connect a cable to, with the following pin assignments:
|2||LED backlight control|
|4||Data / Command (D/C)|
|7||S1 (leftmost button)|
|10||S4 (rightmost button)|
The boards were ordered from a Chinese PCB house as “prototype”, which means you get 10 boards, give or take a few. Given that I also got 10 LCDs, I ordered enough parts to make 6 or 7 complete boards. Most of them worked OK, but it was not easy to make the LCDs have (and keep) good contact with the PCB. Good alignment of the LCD is also critical to get a good picture. If it is not well aligned, you may get no image, or an all-black image, or poor/uneven contrast.
This is the result:
This is my first SMD board, using mostly 1206 size components (the largest SMD variant), and some 0805 size components, notably the backlight LEDs. With a magnifying glass, a pair of metal tweezers, and by pre-tinning one pad per component for fixing it before soldering all pads, assembling the boards was much easier than I had expected. Of course, the board only has resistors, one capacitor, and one NPN transistor, so there were no complex components.
(The wire across the pinheader connects the LED input pin to Vcc, so the backlight will be on even with a 10-strand flatcable instead of a 12-strand one.)
In addition to having both the screen and the buttons on the same panel, the mounting plate becomes much simpler as well:
This archive contains the Eagle schematic and board file for the I/O board: netradio-2-io.zip