If you want to know how to wire & program a Nokia 5110 LCD using an Arduino Uno, you have come to the right place 🙂
Here are the parts needed:
- Arduino Uno (Qty: 1) (http://core-electronics.com.au/arduino-uno-r3.html/?acc=7f39f8317fbdb1988ef4c628eba02591)
- Nokia 5110 LCD (Qty: 1) (http://core-electronics.com.au/graphic-lcd-84×48-nokia-5110.html/?acc=7f39f8317fbdb1988ef4c628eba02591)
- Logic Level Converter (Qty: 2) (http://core-electronics.com.au/logic-level-converter-module.html/?acc=7f39f8317fbdb1988ef4c628eba02591)
- Lots of connecting wires
- USB cable for the Arduino Uno (USB A to USB B)
Here is my setup (made with Fritzing):
Here are the software/libraries I used:
- Arduino 1.0.4
- Adafruit’s base library for the Nokia 5110 (https://github.com/adafruit/Adafruit-PCD8544-Nokia-5110-LCD-library)
- Adafruit’s graphics library for the Nokia 5110 (https://github.com/adafruit/Adafruit-GFX-Library)
Here are the instructions to run the sample code:
- Extract the Adafruit libraries into “..\arduino-1.0.4\libraries\”.
- Your directory structure should look like this:
- Start the Arduino IDE
- From the File menu, click on Examples, then “Adafruit_PCD8544” and “pcdtest”.
- Find the following line:
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
- Change it to:
Adafruit_PCD8544 display = Adafruit_PCD8544(13, 11, 7, 6, 5);
- Compile and download (or “upload” in the Arduino world).
- Done! You should see various graphic examples being displayed.
I have a SparkFun Pro Micro 5V running an older bootloader. In order to burn a new bootloader you need an ISP (In-System Programmer). You can buy an AVR ISP and use that, or you can use an Arduino Uno as an AVR ISP 🙂
Here are the instructions:
We turn the Uno into an ISP:
- Connect your Uno to your computer.
- Run the Arduino programming software.
- From the File menu, select Examples and click on “ArduinoISP”.
- Download this sketch to your Uno.
Now we wire in the ProMicro to the Uno. Don’t connect the ProMicro to your computer! And connect the following pins together:
- Uno Pin GND to ProMicro Pin GND
- Uno Pin GND to ProMicro Pin GND & GND (located on the other side of the board)
- Uno Pin 5V to ProMicro Pin VCC
- Uno Pin 13 to ProMicro Pin 15
- Uno Pin 12 to ProMicro Pin 14
- Uno Pin 11 to ProMicro Pin 16
- Uno Pin 10 to ProMicro Pin RST
- Remove the wire to VCC and put it back in. (I had some errors where didn’t work until I did a “reset” on the ProMicro)
We burn the bootloader:
- Close the Arduino programming software
- Download the new bootloader for the ProMicro (It’s the Add-on link located in https://www.sparkfun.com/products/11098?)
- Unzip that folder into “C:\…\arduino-1.0.4-windows\arduino-1.0.4\hardware”.
- Run the Arduino programming software.
- From the Tools menu, select Board and click on “SparkFun Pro Micro 5V/16Mhz”.
- From the Tools menu, select Programmer and click on “Arduino as ISP”.
- From the Tools menu, click on “Burn bootloader”.
- Wait a few minutes. You should see the RX & TX LEDs flashing on your Uno during the burning process.
If it doesn’t work, the error is displayed in the console. If it works, it won’t show a message in the console but in the area just above it, “Done burning bootloader”.
If you have a Raspberry Pi connected to an external hard drive and you keep it on all the time then you may find that the external hard drive continues to stay spinning, even though you aren’t reading anything from it. I have two problems with that:
1) Waste of energy (negligible but still)
The noise part annoys me the most because I like a little peace and quiet around the home 🙂
Anyway, I’m using a Seagate Expansion External Hard drive (3Tb) and it never stopped spinning…I found a solution! Follow these steps:
1) Run this command
sudo nano /etc/hdparm.conf
This will open the hdparm.conf file for editing.
2) Look for the line “# -B apm setting” and observe the line that follows. My one looked like this:
# apm = x
where x = some value.
3) Remove the # from the start of the line, and change the 127 to 1.
4) Hit Ctrl+X and press Y to save the file.
5) Reboot your RPi
In Linux, the hdparam program is used to get/set hard drive parameter, see http://linux.die.net/man/8/hdparm. You can achieve the above by entering this:
sudo hdparm -B 1 /dev/sda2
/dev/sda2 is the hard drive’s device path
1 means highest power management (254 is lowest power management)
The bad part is that you have to run that command each time you reboot your RPi. However, by editing the /etc/hdparm.conf file, it is automatically applied at boot time and it becomes the default setting for all hard drives.