Twin keypad pcb design

I've designed the following PCB:

for two side by side keypads using Cherry MX mechanical keys. I've put a power jack at the bottom for an external power supply which connects to a 220 ohm resistor then to a 7805 regulator and 220 ohm resister on the circuit side. The keypads are each using the OnewireKeypad library.

Fritzing is currently showing me a message: "... 1 connection still to be routed". I think this might be the GNDBREAK pin on the power jack. What do I need to connect that to?

Can anyone see any other issues on this circuit? The 6 pin header at the top is to connect this keypad circuit to a child circuit containing a number of 7-segment displays. The ATmega168PU on this circuit controls both keypads (the input) and the 7-segment displays.

you might be able to indicate that there is no connection to that line,
you might be able to connect one lead and wire it back to the same pad. a do-nothing, but shows it is connected.

Hi Andy,

The way I have been told is "normal" for pcb design is to have a "ground plane". This means you don't route any tracks to ground, you leave them unconnected. Then in the final stage, you get the software to "flood-fill" all the unused areas of the pcb, connecting up all the ground pins. This is better for physically producing the pcb, because you don't have to etch/mill away so much copper. It has electrical advantages too, in some situations.

I don't know how to do a flood-fill-ground-plane in Fritzing, I use Eagle.

AndyInSurrey:
I've put a power jack at the bottom for an external power supply which connects to a 220 ohm resistor then to a 7805 regulator and 220 ohm resister on the circuit side.

Don't quite understand that and it doesn't sound right. Can you post the schematic? Rather than those resistors, I suspect you should have some caps, e.g. 100uF and 0.1uf. you should have a 0.1uF close to the chip's power pins too.

Paul

PaulRB:
Hi Andy,

The way I have been told is "normal" for pcb design is to have a "ground plane". This means you don't route any tracks to ground, you leave them unconnected. Then in the final stage, you get the software to "flood-fill" all the unused areas of the pcb, connecting up all the ground pins. This is better for physically producing the pcb, because you don't have to etch/mill away so much copper. It has electrical advantages too, in some situations.

I don't know how to do a flood-fill-ground-plane in Fritzing, I use Eagle.

Thanks, I'm new to PCB design and have yet to venture into DIY PCB production. I've found how to flood-fill the ground plane and how to set the connectors to connect to the ground plane.

PaulRB:
Don't quite understand that and it doesn't sound right. Can you post the schematic? Rather than those resistors, I suspect you should have some caps, e.g. 100uF and 0.1uf. you should have a 0.1uF close to the chip's power pins too.

Sorry, I meant capacitors. So, I should have a 100uF capacitor between the PWR pin of the power jack and the IC In of the 7805 regulator. Then a 0.1uF capacitor between the 7805 IC Out and the 5V Vcc of the circuit.

You say that I should have a 0.1uF capacitor close to the ATmega168 pin#7 VCC and pin#20 AVCC, where do I connect the cathode of each of these two capacitors, if the anode of each is connected to pin#7 and pin#20 respectively?

AndyInSurrey:
You say that I should have a 0.1uF capacitor close to the ATmega168 pin#7 VCC and pin#20 AVCC, where do I connect the cathode of each of these two capacitors, if the anode of each is connected to pin#7 and pin#20 respectively?

0.1uF are usually ceramic and are not polarised. Just put them as close to the chip as you conveniently can.

Many example designs show 100uF + 0.1uF on both sides of the regulator. However, I suspect that most "wall-wart" power supplies already have them built-in, so I usually just put my caps on the 5V side of the regulator.

PaulRB:
0.1uF are usually ceramic and are not polarised. Just put them as close to the chip as you conveniently can.

Many example designs show 100uF + 0.1uF on both sides of the regulator. However, I suspect that most "wall-wart" power supplies already have them built-in, so I usually just put my caps on the 5V side of the regulator.

Thanks Paul, very helpful. So the 0.1uF caps go from Gnd to both power pins on the chip.

Both a 100uF + 0.1uF either side of the regulator? In series or parallel?

In parallel.

You know that if you connect 2 resistors in series, you add their values. But if you connect them in parallel, you have to add their reciprocals? (meaning if you put R1 and R2 in parallel, the result, R3 is calculated as 1/R3 = 1/R1 + 1/R2).

Well, its the other way around with caps. When in parallel, the result C3 = C1 + C2, but in series, 1/C3 = 1/C1 + 1/C2

Like I said before, you may not need the caps on the high voltage side of the regulator, since wall-warts normally have them built-in.

Thanks Paul, I'll get some chemicals and materials to produce the PCB soon and try it out.

I found that when I put a breadboard together with 10 7segment LEDs and a 3x4 small keypad running with OnewireKeypad, that I was getting interference on the keypad readings, so wasn't reading the correct number presses. I solved that by running the LEDs from an external regulated power supply and the keypad via the 5V out from the Arduino. What would I need to add to my circuit to avoid such interference?

What resistors did you use for you keypad? Voltage divider keypads can be a bit sensitive to nearby voltages or other resistive materials. Touching the resistors with your fingers also creates resistance which the Arduino picks up.

The only think you can do is pick better resistors, ones that will give you a better range of voltages.

HazardsMind:
What resistors did you use for you keypad? Voltage divider keypads can be a bit sensitive to nearby voltages or other resistive materials. Touching the resistors with your fingers also creates resistance which the Arduino picks up.

The only think you can do is pick better resistors, ones that will give you a better range of voltages.

I've got 1k on the columns and 4.7k on the rows.

Those were the resistors I had when I made the library, but if you use 4k7 for the rows and 3k3 for the columns (the pulldown resistor should be the same, 3k3)

You will get a better range of values, which means less interference.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  
  showValues(4,3,4700,3300, 5);
}

void loop() {
  // put your main code here, to run repeatedly:

}

void showValues(int rows, int cols, long Rrows, long Rcols, int Volt)
{
   for( int R = 0; R < rows; R++)
   {
     for( int C = cols - 1; C >= 0; C--)
     {
        float V = (5.0f * float( Rcols )) / (float(Rcols) + (float(Rrows) * R) + (float(Rcols) * C));
        Serial.print(V); Serial.print(F("\t"));
     } 
     Serial.println();  
   }
}

Results: using 4k7 and 3k3

1.67 2.50 5.00
1.13 1.46 2.06
0.85 1.03 1.30
0.69 0.80 0.95

Results: using 4k7 and 1k (the results are much narrower)

1.67 2.50 5.00
0.65 0.75 0.88
0.40 0.44 0.48
0.29 0.31 0.33

I would use 4k7 and 1k5, if I were to remake the keypad. Because I like every row to be lower than the previous row.

Results: using 4k7 and 1k5

1.67 2.50 5.00
0.82 0.97 1.21
0.54 0.60 0.69
0.40 0.44 0.48

HazardsMind:
Those were the resistors I had when I made the library, but if you use 4k7 for the rows and 3k3 for the columns (the pulldown resistor should be the same, 3k3)

You will get a better range of values, which means less interference.

void setup() {

// put your setup code here, to run once:
  Serial.begin(115200);
 
  showValues(4,3,4700,3300, 5);
}

void loop() {
  // put your main code here, to run repeatedly:

}

void showValues(int rows, int cols, long Rrows, long Rcols, int Volt)
{
  for( int R = 0; R < rows; R++)
  {
    for( int C = cols - 1; C >= 0; C--)
    {
        float V = (5.0f * float( Rcols )) / (float(Rcols) + (float(Rrows) * R) + (float(Rcols) * C));
        Serial.print(V); Serial.print(F("\t"));
    }
    Serial.println(); 
  }
}




Results: using 4k7 and 3k3

Results: using 4k7 and 1k (the results are much narrower)

Thanks, I'll give that a go soon

Try 1k5 resistors too.

Using 3k3 with 1k5 also give you a decent range too.

1.67 2.50 5.00
0.96 1.19 1.56
0.68 0.78 0.93
0.52 0.58 0.66

Just experiment and find the values that best suite you.