Step 2: Connecting the Nokia3310LCD With Joystick Shield

So, this is easy, just take the shield (see picture). Plug it in. Load the sample sketch and run it. Right?

Problem 5: Well, not so fast. When I first tried it, the LCD screen was dark and hard to read. When I powered it up with an external 9V battery, it was unreadable.
So I emailed nuelectronics with my problem and of course, got no response.

Solution 1?: I wondered why the LCD was better with USB power than with external power. So I measured the 5V. See picture. It was 4.84V. The power was coming from my PC but it was also going through an unpowered USB hub and 4.84V is acceptable. I measured the same place using a 9V battery connected to the 7805 regulator. The voltage was 5.03V, about what I expected.
The tiny LED in my head blinked. I decided the LCD would be more readable if I dropped the ‘5V’ voltage to the Freeduino and the Nokia LCD. 
My Freeduino has the typical power supply like the schematic. All I had to do was remove the PWR SEL jumper and replace it with a potentiometer (variable resistor) on pins 1 and 2. (or 2 and 3 if using USB power)
So I scrounged a three pin connector with wires on it and solder two wires to a scrounged 200 ohm potentiometer. For those of you not familiar with potentiometers, they are a resistor with a mechanical wiper that can move from 0 ohms to the maximum (200 in this case). Why 200, well it was the smallest resistance I could find. Potentiometers have three leads. You only need two connections, make sure you solder one to the variable pin. See picture. Then plug it in, see next picture.
So this worked pretty good. I could tweak the potentiometer to get a nice display on the screen. BUT. . .

Great 'ible, very comprehensive! <br>Just one question; <br>Why does referencing 1.1v make the analog read more accurate? <br>Does it not also have 1.5% error? <br>Thanks
You are correct, there would still be a 1.5% error. But 1.5% of 1.1V is a smaller voltage than 1.5% of 5V. However, this is only speaking theoretically due to the inaccuracy of the A to D conversion. <br>One of the factors that will affect 'accuracy' is the tolerance of the 1.1V reference which is between 1.0 and 1.2V. <br> <br>However, for real applications, this is pretty meaningless. Generally, I choose a reference voltage based on the sensors connected to the Arduino. If the maximum analog voltage is going to be 1.1V or less than choosing the internal 1.1V reference would probably be best. <br>I usually like to use 3.3V reference as shield compatible Arduinos have a 3.3V source and so do most USB to Arduino converters. These are usually much more accurate then the USB 5V or (I think) the 7805 regulators. <br> <br>LOG
I am trying to hook up a nokia 5110 that is supposed to be the same pin mapping. Is this the pin mapping that the shield uses?<br><br>#ifdef PB1<br>#define LCD_RST PB1<br>#define SPI_CS PB2<br>#define SPI_MOSI PB3<br>#define SPI_SCK PB5<br>#define LCD_DC PB0<br>#define LCD_BL PD7<br>#else <br>#define LCD_RST PORTB1<br>#define SPI_CS PORTB2<br>#define SPI_MOSI PORTB3<br>#define SPI_SCK PORTB5<br>#define LCD_DC PORTB0<br>#define LCD_BL PORTD7<br>#endif<br><br>which when translated for the arduino pins this is how I believe it should be set<br>LCD_RST digital pin 1<br>SPI_CS digital pin 2<br> SPI_MOSI digital pin 3<br> SPI_SCK digital pin B5<br> LCD_DC digital pin 0<br>LCD_BL Pdigital pin 7<br><br>am I missing something?<br><br>
Sorry, my ISP won't connect to Instructables.com.<br><br>I tried to design my own interface to a Nokia LCD but couldn't figure it out so that's why I bought one with software. So I can't really help with the code. I don't see anything obviously wrong with your code but don't know.<br><br>One thing I do remember was that the LCDs were not 5Vdc so a lot of the hacks had ways to convert the signals. I think the LCD expects 3Vdc signals.<br><br>Good luck.
Very well written! Nice and detailed!
Thanks. I get frustrated with internet articles that don't quite tell you what you're looking for so I try to make mine as complete as possible.<br><br>Lazy Old Geek
Do you have any experience getting this display shield to share the SPI bus with other shields? I'm trying to get it to play nicely with a Freetronics ethernet shield (which unlike most w5100 based shields, honors the cs line).<br><br> -- Mitch
Sorry, I haven't. This is my only experience so far.<br><br>LOG
I can tell that you are a very organized, grammatically correct, and SMART, lazy old man. You speak my language and I love how you actually got the results that you desired, good work, very resourceful and patient. Paying attention to the smaller details was always a key highlight in engineering. <br><br>To add furthermore on to your very eloquent and detailed instructable that you have created I would also like to add one small tidbit to your comment on discarding the first reading from the modified AnalogReference() id. <br><br>Your tip that explains not to include the first reading ( and I am speculating, I have never used an arduino or any of the devices listed here ) most likely is due to two consequences. Firstly, when you plug a device into any battery or power source, there will be an initial &quot;pulse&quot; high energy output that comes from the power source. One can interpret this as the phenomenon of kinetic energy from physics, i.e. - there are two <i>different</i> equations for the initial (or static) state of energy and when the energy is in motion. Molecules are put into a state of havoc then ultimately into a more steady state of flow, thus explaining the two different equations. Different batteries and alternative power sources that I know of have different &quot;pulse&quot; currents that initially &quot;pulse&quot; out, just like the Silver Surfer character in the second &quot;Fantastic 4&quot; comic movie. Secondly, the initial reading would be tossed out ( again here, speculating ) because the unit, when modified, might not use the same algorithm as the normal, debugged input. It might not be compensating for the initial &quot;bounce effect&quot;, i.e. basketball effect of when a button is pushed. Digitally speaking, this means that whenever you are typing on your keyboard or pushing a button, there is a microcircuit with an algorithm automatically compensating for the impossibly small bounce that sends multiple &quot;1's&quot; to your next device. To fix this, the algorithm simply is written to ignore the initial bounce gap interval of &quot;1's&quot; and set the gap interval of &quot;1's&quot; to just plain and simply &quot;1&quot;. That's it, and everything runs smoothly.<br><br>Did my comment overcompensate the &quot;geek&quot; effect in this article? ;)<br><br>I hope someone here understands it and appreciates it.<br><br>-Keith
Thank you for your comments. I do try to pay attention to details. Unfortunately, as I get older, it is harder to do. In my case, I think this comes from a couple of factors. One, I spent many years in electronics, mostly developing test systems where missing details could develop serious design flaws. Two, in this work, i had to write a lot of test programs. In debugging and troubleshooting programs you learn to pay attention to the littlest details that won't allow the program to run or won't run correctly.<br><br>I find your comments interesting. I do not fully understand them but definitely see and engineering background and probably highly educated. <br><br>Some of the initial power states, I am aware of as are most designers. I don't know how familiar you are with microcontrollers but at least in the earlier ones I used to work with there was always a resistor and capacitor attached to the the reset pin so there was always a delay that held the microcontroller idle until power was stable. As for the ATmega chip, apparently, there is a watchdog circuit that keeps the microcontroller idle until power is stable. I am not sure if this is what you were referring to or not. <br><br>Here is the data sheet for this microcontroller all 448 pages of it.<br>http://www.atmel.com/dyn/resources/prod_documents/doc8161.pdf<br><br>My suggestion to discard the first sample only refers to conditions where the Analog Reference type is changed and not to initial power up conditions.<br>From the datasheet:<br>'The first ADC conversion result after switching reference voltage source may<br>be inaccurate, and the user is advised to discard this result.'<br>Now, i am not sure but I believe it is using the same algorithm but the hardware comparator reference is changing. Perhaps the reference has residuals of the old reference until after the first conversion?<br><br>I am also familiar with the 'bounce effect' and there are hardware circuits to 'debounce' switches. In the Arduino world, though mostly what you see are little tiny buttons connected to an ATmega digital pin with a pullup resistor. So 'debounce' is usually done in software, if at all. If you do an internet search for Arduino debounce, you will find lots of suggestions and software that didn't work and fixes but it is very hard to find any information on theory and how to make it work if it doesn't. <br><br>After perusing the Arduino forum and playground areas for analog reference information, I was totally frustrated by the lack of understandable information that I could trust. It was probably there, but I have no good way of finding it.<br><br>That is one of the reasons why I chose Instructables to write about what I know, explain some of the theory and put the theory to work. <br><br>So, yes, I really appreciate your comments. It's good to know that someone is actually paying attention.<br><br>LOG
Well, it would appear that you are still as sharp as a tac! I get what you are saying by the initial &quot;startup&quot; states in your pdf now that you explained it. <br><br>I took 4 years of physics and 2 1/2 of electrical engineering, along with another 2 1/2 of advanced math and statistics/finance/economics courses. Let's just say I wanted to get the most for my money out of college ^^ :). <br><br>As far as the &quot;not understanding&quot; part, I was merely referring to patterns I saw while reading your statements in this instructable. There are many equations and laws of physics which can be referenced and applied to the problems that you were having, and apparently already knew of. I just found it fascinating that someone would actually put in as much work as you did in writing an article - and yes, I do appreciate it very much! I learned a lot from your article and it brought back memories from when I used microcontrollers and programs to implement circuit functions (and the headaches!!). But as you say, it is <b><i>very</i></b> hard work. I certainly wish I had you as my teacher instead of foreigners with thick accents that I could not even understand!<br><br>The capacitors are there to compensate for delay like you said and to provide open/close switch circuit operations for different &quot;states&quot; of digital electrical &quot;time frames&quot; - so to speak. For any given output at any given time, there must be a programmed circuit (both hardware and software) to fulfill all of the different combinatorial digital circuit logic functions that one may want, therefor, one must acquire capacitors and transistors to provide for those exact functional outputs. It is indeed very complicated and I did not want to pursue that stressful environment. The capacitors are almost always coupled with transistors in any circuit due to our &quot;digital age&quot;. <br><br>ON....OFF....ON....OFF....etc...<br><br>The capacitor takes care of one part and the transistor takes care of the other. They pretty much work hand in hand, different properties and such with AC and DC current. I'm a sucker when it comes to &quot;why&quot; these things work the way they do. Technology is unbelievably mind boggling, it is very cool to see how you &quot;hacked&quot; the device to work for you and the very hard work you put into it to make it precisely the way you wanted it to be. I still could look at a circuit diagram drawing now and get lost in less than a second, and I'm only 26!! lol.<br><br>I make LED toys now ;). I've been working on new designs for over a year now and I am trying to start up a small business. I'm a geek too :).<br><br>Do you have any other instructables online?
Ha! Yes, I suspected you had a strong physics background!<br>My education was mostly practical, starting with training in the USAF. It was a rather ominous start. I was taking classes during the graveyard shift and all I remember was sitting around playing Battleships. They did get rid of that instructor. Like you I was a sucker for the &lsquo;why&rsquo;, so when I wasn&rsquo;t drunk or sleeping (graveyard shift again) I probably applied my training better than most.<br>After getting out, I later took a correspondence course in microcomputers. Most of my experience came from working in electronics test and measurement for over 20 years. The Internet became such a significant factor in my life, instructor, reference, guru.<br><br>In some ways doing this project wasn&rsquo;t that hard for me. It was mostly just applying some theory and a lot of experience. Probably the harder part was formatting the Instructable, trying to keep it interesting but informative and complete. I don&rsquo;t think I&rsquo;m ever satisfied with them but just decided to publish and hope I didn&rsquo;t make any major mistakes.<br><br>This is actually my fifth:<br> Making a bedframe with lots of storage<br> Easy Laptop stand<br> Arduino-No Blinky<br> A 67 cent postal scale<br><br>You might like Arduino-No Blinky more than most. I don&rsquo;t think it went over that well. <br>I actually was working on one called Arduino Basic Electronics but decided it was too theoretical for the more practical Instructable audience. I incorporated some of the material in the two Arduino Instructables. <br>I am currently working on one about GPS. Like you, I want to know how it works. <br><br>So good luck in your business. Let me know if I can help. I guess you can send me a Private Message.<br><br>LOG
Very cool btw, this must have taken you F-O-R-E-V-E-R! I appreciate the time that you spent to put together the grammar, organization, detailed information, and dummied down explanations. Your perspective writing is very well written and you have a keen sense of situational awareness. Very refreshing.
Thanks again. For a few years, I managed an electronics test group and had to do some instructing. More recently, I was an instructor in electronics and programming at a technical school. One of the things I learned was to know your audience and teach to them. Now the Instructable 'audience' varies all over the place. <br><br> Especially, in the Arduino Instructables, I notice a lot of authors, doing incredible, amazing projects with them and many seem to have a limited understanding of electronics and programming. Those are the ones who inspired me to do some of my Instructables. I hope to return the favor by helping them in future projects and giving them a better understanding of how it works. <br><br>Yes, these do take a while. But teaching is a learning experience. I'm always learning new stuff when I write one of these. It's good to keep the OLD brain cells active.<br><br>LOG

About This Instructable




Bio: Lazy Old Geek
More by msuzuki777:Senior Moments Weather Station 5 IP Time Clock Part 2 
Add instructable to: