1

I am moving my first steps into Arduino and electronics and I have tried to program an LCD 1602A display following this tutorial.

I managed to complete the tutorial up to setting up the contrasts of the display using the potentiometer (on the display I get nice "white" rectangles), but when I tried to upload the code provided I get no text on the display.

I checked and I connected pins the right way but I suspect that my soldering skills might affect the final result: the pins seem wiggly and even just to power up the display I have to adjust the cable connections quite a bit before the LCD turns on.

Which steps should I follow to check that the pins are soldered correctly and that the right current flows through each of them? I figured I could use a multimeter to check the intensity through and voltage applied to each of the pins, but I have no clue what readings I should get. How should I proceed?

EDIT (2016/12/12)> Here is the picture showing the step I got stuck enter image description here

And here is a picture showing the soldering I did: enter image description here

Also I checked with the multimeter and each of the pin passes a continuity measurement.

What else can I try?

  • 2
    You should measure resistance. And it should read around 0 ohms. Most multimeters have continuity mode, where it beeps if there is a connection (0 Ohm). Could you post a picture? That might help identify where the problem is. – Gerben Dec 8 '16 at 18:46
  • Thanks @Gerben! I've not my Arduino with me at the moment, but I'll upload a picture of my LCD display! Thanks again! – lucacerone Dec 9 '16 at 8:01
1

As noted in a comment, you can measure connection resistances, which should be near zero. (Typical DVMs / multimeters will show an ohm or two for a short, because of leads resistances.)

Measuring voltages may give you more definitive results than measuring resistances. To measure voltages, install a sketch that toggles known pins in a known pattern. For example, the sketch below toggles PB0...PB5 high, low, high, low, ... every two seconds.

//  jw - Dec 2016 - toggle bits PB0-PB5 every 2 seconds
enum {PinMask = 63};    // Mask for PB0...PB5, or d8 ... d13 
void setup() {
  PORTB = DDRB = PinMask;  // Set pins as high outputs
}    
void loop() {
  delay(2000);      // Delay 2 seconds
  PINB = PinMask;   // Toggle the pins
}

To use this sketch, attach a meter lead to ground on your Uno. If you have small enough clips, hook a lead to pin 6 of the 6-pin ISP connector, as in the diagram. Then verify that pin 2 of that connector shows a steady +5V, and that each of pins 1, 3, and 4 on it are toggling between +5 V and 0 V every two seconds. Those pins are connected to PB4, PB5, and PB3, which are Arduino digital pins #12, 13, and 11, respectively. Note, toggling #13 should turn the on-board LED off or on every two seconds.

enter image description here Note, pins 1 and 2 are closer to the RX-TX corner of the Uno board than are pins 5 and 6. The latter are closer to the A4-A5 corner.

After you have the sketch loaded and verified (that is, have seen properly toggling voltages at the ISP connector), with one lead still attached to ISP pin 6 ground, point a probe at each LCD land where a wire connects. That is, make the probe contact the copper you intended to solder to, rather than contacting the wire. This is to get closer to end-to-end measurements. With the sketch shown above, you will touch your probe to the lands of LCD pins 6, 11, 12, 13, 14 (assuming you've followed pin assignments shown in your link). If you find those points toggling ok, you've got basic connectivity. If not, resolder, using proper solder and a hot-enough iron. If basic connectivity is ok but LCD still doesn't work, you may have some lines mixed up, or may have shorts between lines, etc. You can run a sketch like the one shown below to test individual lines. Set WhichPin to values 1, 2, 4, 8, or 16 in turn, to test Arduino digital pins #8, 9, 10, 11, 12, respectively.

//  jw - Dec 2016 - toggle one of PB0-PB5 every 2 seconds
enum {PinMask = 63};    // Mask for PB0...PB5, or d8 ... d13
enum {WhichPin = 1};    // Set this to 1, 2, 4, 8, or 16 for PB0-PB5
void setup() {
  PORTB = DDRB = PinMask;  // Set pins as high outputs
}    
void loop() {
  delay(2000);      // Delay 2 seconds
  PINB = WhichPin;  // Toggle the selected pin
}

For testing Arduino digital pin #7, you can add pinMode(7,OUTPUT); digitalWrite(7, HIGH); in setup() and digitalWrite(7, !digitalRead(7)); in loop().

Edit 1: The first sketch shows a brief way of toggling six lines at once, using port-level IO instead of using a half-dozen digitalWrite() calls. The sketch generates a low-frequency square-wave. The reason for measuring if LCD pin-voltages toggle up and down when the Uno outputs a square wave is to find out if there are ok connections between pins on the Uno and corresponding pins on the LCD.

One cannot realistically expect the LCD to work unless the connections are solid. Making solid connections requires finding out which connections are good, and which are bad, and fixing the bad ones. A quick test for if a connection exists is to output a square wave to an Arduino pin and observe if that square wave arrives at its destination pin on the LCD.

In the sketch, PinMask selects which bits of port B get toggled. (A 1 OR'd into PinMask selects PB0 or digital pin #8 to be toggled; a 2 OR'd in selects PB1, #9; a 4 selects PB2, #10; and so forth.) In the second sketch, WhichPin is a bit mask containing one bit, which is used to select one pin to be toggled instead of toggling all six pins.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.