What do you do with an old phone, a microcontroller and lots of time?
You hook the old phone's LCD screen to the computer USB of course!

In this project we're going to communicate with a Nokia 3310 LCD display over USB! How are we going to do that? We're going to connect the LCD display to an Atmel ATmega8 micocontroller and talk to it using the SPI, then connect the ATmega to a PC using V-USB.

The Nokia 3310 LCD display is easy to find, and has a very well documented interface, so it's perfect for hobby use! Not only that, but we're going to use V-USB (Formerly AVR-USB) as our USB driver on the AVR chip. This makes the project very easy to pull off the ground.

V-USB is very slow, so you cannot do any fancy animations this way, but is perfect for updating the display with text! Also, when using USB, you can use this on pretty much any computer. It does require libusb though, but libusb is cross platfrom, so that shouldn't be a problem. Or, if you're really hardcore, you can write your own driver for this project (This is way out of the scope of this instructable)!

What uses does thing have?
As I mentioned, V-USB is pretty slow, so it's best for sending text. Even through this is a little drawback, there is still a lot of stuff you can do with it!
Display RSS feed, Twitter updates, weather, temperature, free disk space, unread e-mails.
You are not limited to just display text though. If you're feeling really fancy, you can make a 1-bit picture slideshow!
Only your imagination (And the slow speed of V-USB) limits you :)

What features does the code have?
With the code you get from this Instructable, you get:
* Built-in font and support for writing ASCII characters
* Character wrapping (Prevents characters from being printed over 2 lines if end of display is reached)
* USB connected
and powered
* Easy to expand

The code is open source (Both firmware and host software), so you're free to do whatever you want with it. (This only includes the software I have written. See the license for V-USB for further use of that, same goes for libusb. Both licenses are included in the source files.)

This project is loosely based on Raphnet's Multiuse PCB, V-USB's PowerSwitch and DharmaniTech's Nokia 3310 LCD routines library.

If you have problems downloading the attached files, I have mirrored them here: Atmega8_LCD.rar and LCD_Screen.rar

Step 1: This Instructable

In this instructable, our main focus is the programming of the decive and host software.

What we'll cover in this instructable:
* Circuit and components
* Processing the data using V-USB on the AVR
* How to communicate with the LCD screen, and what you can tell it
* Transferring data through USB using libusb on the host
* Make a custom font for the display

We will not cover setting up V-USB or libusb, as these are included in the sources!

This instructable is a little advanced, but I assume you know the following:
* Can read datasheets and schematics
* Can solder decently
* Is familiar with programming in C/C++
* Uses Visual C++ 2008 (For the host software, no platform depended code used, so can easily be ported)
* Knows how to burn AVR chips and the programs needed to do so
* Knows the basics of AVR programming
* You use Windows (This can be done on any OS, but I currently only have Windows at hand)

If you have little or no programming experience and is very new electronics, this is not a good way to start. Have you tried making a LED blinker yet? Yes? How about a music box with a piezo element? That might keep you busy for quite some time :)

The concepts in this instructable might be very confusing to one who have little programming experience, and I do not go into too deep details in the concepts.

If you absolutely want to do this instructable even though you are a beginner, I have commented the source code as good as I can. If something still is unclear, drop a comment and I'll try to help you.
Could I use the arduino uno for this
At last, after 3 months try, i have successfully completed your project. Now it displays time.. Thanks..... <br> <br>What software i will use to compile host software? <br>Can u give me a vb6.0 example?
i m using codeblocks and vb6.0 but failed
We followed your schematic but why is it always &quot;USB Device Not Recognized&quot;?
You may have swapped the D+ and D- wires. I spent a few hours debugging only to find I had swapped them. Also, if the voltage on the data lines are not according to the specs you'll also get a &quot;Device Not Recognized&quot;. Get your multimeter and confirm the data lines are running at around 3,3v.
Sir we already have the &quot;Display Initialized&quot; output at the LCD but why is it still &quot;usb device not recognized&quot; in my pc? Am I doing it right?
The display will initialize regardless of the success of the USB connection. Did you double check the data lines on the USB connector?
I think the problem is the zener diodes... Can I use 5V to data lines.
No, using 5v on the data lines will almost certainty make your device not recognized, and may damage your USB port. You have to follow the USB specifications and use 3.3v to ensure proper operation.
hey how r u,,,,, dude ur anabsolute genious..could u tell me what's the way to display content on any lcd screen plz???<br>thnx
hey :) <br>nice instructable but i have to ask something isnt the nokia lcd running @3.3V ?
Only the data input lines has a recommended voltage of 3.3v, they can however work with up to 7v if you look at the maximum ratings in the datasheet. It's also actually recommended to run the VCC at 6v to 9v, but should work at lower voltages. For simplicity sake I just ran everything off the 5v of the USB, which works pretty good and shouldn't be at risk of permanently damaging the LCD. Hope this cleared things up!
ive done some tests myself and got the lcd working powered @ 3.3V from arduino and the data lines were @5V <br><br>anyway thanks for the quick reply
thanks a lot for this instructable...i have been looking for a better reference on v-usb for months and at last ... i found yours!great work!
Thank you very much for your comment! I decided to give some attention to the use of V-USB in this instructable (Especially considering this was for the USB contest). I'm glad you found it useful!
Your work made me understand v-usb....and i have applied it to develop a loader software for usbasp.But i can only send data to the device...cant get them....i m using vb6 as my language and libusbvb0.dll as my link library to communicate with libusb...if u can give me some suggestions...that will be really great!!!<br>(My software is actually a GUI for avrdude..with some extra usbasp control features)
do you think the LCD from a nokia 6340i would work? it looks very similar to the one in your picture, same dimensions, pin count, but it has three smd components instead of two. i haven't been able to find much helpful info from google, just a bunch of sites trying to sell replacement parts. i guess i'll just have to wire it up and see what happens.
I can tell you right off the bat that it will most likely not use the same interface as the 3310 display and in worst case might damage the display (The 3310 display says in the datasheet the operation without resetting the screen first might damage the device). If you give me a few moments, I can try to look for a datasheet and see if we cannot modify the code to work with your 6340i display! ;)
Thanks for your info! i'll let you know if i get it working!
Thanks for posting this Instructable! Hard work = sweet project
Thanks a lot! I did pull my hair a couple of times during this project, hehe.
could you point me in the direction of doing this on a mac
Unfortunately, I have no experience in compiling programs on Mac, but the Mac port of libusb can be found here: http://libusb.darwinports.com/ . The firmware on the AVR is the same regardless of OS, so you only have to worry about the host software. Hopefully, the Mac port of libusb uses the same header file as the Win-32 port, so your only concern should be to actually get the program to compile. I do have Macs myself, so if you're really stuck I probably can look into the Mac developing tools and help you.
could the lcd be used as a multimeter panel(for e.g i want to include an lcd screen on a bench power supply)??
Yes! As long as you have the information, you can display it on this LCD display. For getting the information, you can use the ADC on the AVR chip (If you do, you don't even need the USB connection!).

About This Instructable




More by wkter:Connecting Nokia 3310 LCD to USB using AVR 
Add instructable to: