Sketch freezes when I touch copper pour

I’ve got a pretty simple sketch that using I2C to control Adafruit’s OLED display. I’ve got a Leonardo and the OLED display plugged into a test double sided PCB that I made. The large copper areas on the top and bottom of the PCB are not connected to ground or anything else. I’ve got 4.7k pull-ups on the I2C lines. When I run my sketch the OLED displays some text then just counts up some numbers. As soon as I touch the copper area the sketch freezes. But if I ground the large copper area, the sketch does not freeze .
I included pics of my setup. I get the same result if I use an Uno.

Can anybody tell me what’s happening?

Here’s my sketch

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 8
Adafruit_SSD1306 display(OLED_RESET);

void setup()  {                
  Serial.begin(9600);
  delay(4000);

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)

  display.clearDisplay();   // clears the screen and buffer
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("HELLO THERE");
  display.setCursor(0,9);
  display.println("HAVE A NICE DAY");
  display.setTextSize(2);
  display.setCursor(0,18);
  display.println("thanks");
  display.display();
  delay(4000);

  pinMode(13, OUTPUT);
}


void loop() {
  display.clearDisplay();   // clears the screen and buffer
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("TIME TIME TIME TIME");
  display.setTextSize(2);
  display.setCursor(0,18);
  char buff[12];
  display.println(ltoa(millis()/100, buff, 10));
  display.display();
    
  Serial.println(millis()); 
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(50);
 }


void testdrawchar(void)  {
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);

  for (uint8_t i=0; i < 168; i++) {
    if (i == '\n') continue;
    display.write(i);
    if ((i > 0) && (i % 21 == 0))
      display.println();
  }    
  display.display();
}

void testscrolltext(void)  {
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(10,0);
  display.clearDisplay();
  display.println("scroll");
  display.display();
 
  display.startscrollright(0x00, 0x0F);
  delay(2000);
  display.stopscroll();
  delay(1000);
  display.startscrollleft(0x00, 0x0F);
  delay(2000);
  display.stopscroll();
  delay(1000);    
  display.startscrolldiagright(0x00, 0x07);
  delay(2000);
  display.startscrolldiagleft(0x00, 0x07);
  delay(2000);
  display.stopscroll();
}

It is likely to be stray capacitance grounding it is probibly the way to go or etch it off.

Grounding it, then touching it, absorbs your body charge. Without grounding, your bodies charge spreads around the copper surface which acts like a capacitor and to the pins in the circuit where it plays havoc with the electronics.

Hi, in any PCB design where large areas of copper are left to save etchant and etch time, the area is connected to the circuits gnd. You have found out why. As said, it has to do with capacitance and charge, when you touch it unearthed a current flows breifly that is induced into the tracks of your circuit. If the area is at circuit ground, that is where the current flows and is not induced into the other tracks.

Tom.... :)

When I get PCBs made by someone like OSH Park, I frequently have a ground pour. I made this PCB because I was just doing some tests. I was surprised the Arduino and/or OLED display would be so sensitive to this. I'm assuming that somehow the I2C communication is disrupted and the Arduino can't recover from that? I've done another test where I just blink the LED on the Arduino and I can't get it to lock up by touching the copper. I wish the I2C was more robust. In my final design, I'll certainly have this copper grounded.

Your fingers carry perhaps 50 to 100Vac pickup from nearby mains wiring, touching the pour will make the pour carry that signal and there's enough capacitance between it and a high impedance input to cause some problem. Check you don't have any floating input pins for instance.

Mains wiring consists of live and neutral and earth wires, the field around mains wiring is sort of the average voltage of these, which for single phase mains is perhaps 30 to 50% of the live voltage. Most dwellings have much more mains wiring than earthed plumbing (for instance) so the whole room and its contents pickup the 50+V signal, being more or less surrounded by mains wiring.

With industrial facilities using 3-phase mains the voltages are balanced so the average voltage pickup is much less, ironically!

If mains cables were shielded, it wouldn't be an issue either.

In general touching any live circuit board isn't a good idea unless you are already grounded.

Making the pull up resistors smaller will reduce the sensitivity to interference. There is a level shifter on that board so maybe you can go down to as little as 1K8. Also adding more decoupling capacitors would help as well.

"Doctor it hurts when I do this" "Well stop doing that!"

The Level shifter (PCA9306) is needed because the panStamp I'm using is a 3.3 volt board - not shown in picture form O.P. The reason I built this test board was to experemint with the I2C pullups - both on the 5v signals and 3.3 volt signals. The OLED display, which is on the 5v I2C line, has 10k pullups to 3.3 volts. The 3.3 volts comes from an on-board voltage regulator on the OLED PCB. The Real Time Clock (not shown in OP pictures) is also on the 5v I2C lines, and it has 2.2k pull-up resistors to the 5 volt line.

I have spots on my homemade PCB for pull-ups to 5v and spots for pull-ups to 3.3 volts (other side of PCA9306). I might not need any of them, not sure yet. According to the PCA9306 Data sheet (Table 13), I don't need pull-ups on the 3.3 volt side - assuming I'm reading it right.

What is important to remember here is that you are using CMOS logic with a very high input impedance. Anything (that is, MCU pins,) that is not pulled to ground or supply voltage will pick up stray voltages.

And ESD may affect things even if there are pull-ups of modest value.