Author Topic: The Living PCB Design Thread  (Read 229593 times)

psyduck200 and 2 Guests are viewing this topic.

Offline bpiphany

  • Posts: 1022
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #800 on: Thu, 03 January 2019, 16:41:16 »
Hi,
I'm currently trying to build my own full size keyboard with a custom layout. After reading through the whole thread (I actually just made an account so subscribe to this thread  ^-^) I still have some questions:

  • I've read that you should not place traces below the oscillator and surround it by a ground plane. Is that only specific to that layer or should I keep the traces on all layers away from the crystal?
  • I want to use a ceramic resonator. Do these even have the same issues with interference as crystals?
  • Originally I wanted to add LED backlighting but now I'm unsure: At >100 LEDs in parallel, drawing 20mA each, thats more than 2A (and therefore more than the 500/900mA USB provides and way more than the 20/100mA the Atmega32u4 can drain). What are the tricks to get low power LED backlighting?

Thanks a lot.

1. The surrounding ground would be to shield off the crystal. Preferably a plane underneath it, and a ring off GND around it.
2. Ceramic oscillators may not be stable enough to work properly with USB.
3. You don't want 100 LEDs driven at 20mA each continuously at the same time. You would be blind. A few mA probably is enough, but you would still need to be careful in the design to meet the current limits.

Offline kuerb

  • Posts: 4
Re: The Living PCB Design Thread
« Reply #801 on: Fri, 04 January 2019, 08:53:10 »
 Thank you for the response.

@1&2) I designed the PCB around the Adafruit Feather 32u4 Bluefruit LE because that already works with QMK. I guess I'll think about switching to a quartz. But then I'd have to retrace a lot of wires for the extra caps and bigger component :eek:

@3) Now I feel stupid about the LEDs ;D I only thought about reducing the duty cycle to keep the overall power consumption low and didn't even think about what would happen if I connected the LEDs to a low current power supply (resembling the pin).

I just tried a setup of 25 parallel green* LEDs. With 5 mA on the power supply (that should be equal to 100LEDs@20mA) each LED still gets to around 180 uA but the power supply is also lowering the voltage to 2.2V. But at least the LEDs stay visible with artificial lighting. With keycaps on the LEDs, they're only visible in the dark but that might be just enough for a very subtle backlight. Powering the LEDs through a Teensy (LC) was also possible but with a bit of flickering.
*or rather the green parts of RGB LEDs

I might hold back on adding per-key backlighting and just add a few dedicated LEDs instead. I can always upscale for later projects :))

Offline bpiphany

  • Posts: 1022
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #802 on: Sat, 05 January 2019, 14:35:51 »
1&2. I haven't looked too hard but I couldn't find out what the part used actually is. According to the datasheet the 32u4 should have an internal oscillator that's supposedly possible to trim to make it good enough for USB But there's very much not a promise in there that a resonator will be good enough in general.

3. It's not a fantastic idea to just parallel up LEDs, google for thermal runaway. And you'd probably want to drive them through something else than the micro, a dedicated LED driver or simply with transistors.

3++. Using a switching regulator to lower the voltage for the LEDs can save a lot of the power consumption. You should probably still really have a current limiting resistor in series with the LED. but you can shift more of the power to be dropped actually producing light.

Offline kuerb

  • Posts: 4
Re: The Living PCB Design Thread
« Reply #803 on: Wed, 09 January 2019, 08:14:32 »
@3) I know that parallel LEDs weren't the best idea, I just wanted to test the output before scrapping the idea of LED backlighting. But in the end I removed all of the backlight LEDs from my PCB and opted for four dedicated LEDs instead.


I want to add support for multiple layouts. But then I'll get holes overlapping pads (as well as overlapping holes) like in the picture. Can someone recommend a manufacturer who will produce it that way?
I asked support at JLCPCB (the people behind EasyEDA) and they told me that they can't produce it (although I'm not 100% sure that my question was understood correctly).

Offline bpiphany

  • Posts: 1022
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #804 on: Thu, 10 January 2019, 14:44:49 »
It's probaby going to depend on their process and tooling, if they are willing to do it at all or at the price point. I think you'd generally not want to overlap holes by too much when drilling. A bottom cutting end mill may be able to do more awkward cuts, but be more expansive and not doing it as fast as a drill bit. You want to have enough wall for the bit not to snap into the previous hole and break.

I've had this made https://geekhack.org/index.php?topic=67713 with overlapping holes just like your design.

Another option is to actually make the overlapping holes into a single slot, which will be milled instead. Like on the phantom https://deskthority.net/w/images/3/3e/Phantom_PCB-Small.jpg

The manufacturer may also be reluctant milling into copper pads, especially plated through holes. It can tear the copper and cause shorts, and they may still do it at your risk.

3+++) There are different (probably more than you can count) LED drivers that will drive any number of LEDs you'd ask for through any serial interface you'd ask for (probably). They can often do constant current delivery to simplify your BOM, and life in general.
« Last Edit: Thu, 10 January 2019, 14:50:45 by bpiphany »

Offline kuerb

  • Posts: 4
Re: The Living PCB Design Thread
« Reply #805 on: Fri, 08 February 2019, 02:29:35 »
I ended up ordering at JLC and have received a board with overlapping holes/pads without any extra fees.

Unfortunately the USB connector doesn't fit. I guess I should have created a smaller test PCB with a single key to test all the components and software first, but well, at least I'm learning. Everything else was soldered and running a simple program to blink one of the LEDs (uploaded via ISP) so I've tried soldering a cable directly to the USB lines but can't get the chip to be recognised.

My guess was that this had something to do with the resonator so after trying different fuses (mainly switching CKSEL and CKDIV8) and uploading the dfu-bootloader again and again I still have no idea how to fix this. So I resoldered the resonator and ended up frying my 32u4. I guess I'm going to make that test PCB after all :D.

I know this isn't directly "PCB Design" but what are the correct steps in order to get USB working out of a blank 32u4?
Is it just supposed to work out of box (the datasheet mentions USB will work with the internal resonator when powered >3.4V)?
Do I have to disable CKDIV8 (as it would give me 8 MHz/8 = 1 MHz, which is lower than the 1.5 MHz in Low Speed USB) or does that not matter for the communication part?




Offline bpiphany

  • Posts: 1022
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #806 on: Fri, 15 February 2019, 13:51:47 »
If you didn't get the 32U4RC it should pop up as a USB device, _if_ you have a 16MHz crystal hooked up the correct way. And use a crystal. Also this is only true as long as you didn't already erase the bootloader with your ISP programmer.

Changing fuses you can set the chip to run from the internal oscillator, without any need of an external clock signal. It's not guaranteed to work out of the box though. It may be a good way to reach the blinky level with a minimum number of parameters.

Here's the app note on using USB with the built in resonator
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=2ahUKEwjIvazFwL7gAhWgwMQBHfwLBtIQFjAAegQIChAC&url=http%3A%2F%2Fww1.microchip.com%2Fdownloads%2Fen%2FAppNotes%2Fdoc8384.pdf&usg=AOvVaw1nqlVSHuKhP1LCT5U4thL6

Offline rickylago2

  • Posts: 1
Re: The Living PCB Design Thread
« Reply #807 on: Wed, 20 February 2019, 15:42:16 »
I've just stumbled on this thread via google search, and I've got to say reading through it has been massively helpful. Lots of good information here!

I'd like to get some verification from anyone who might be more knowlegable than myself. I've got a lot of experience in hardware modification, but as far as designing my own goes, this is basically my first project. My main goal here is to make a 25 key macro keyboard with an analog joystick on the thumb and per-key RGB lighting using APA102-2020 mounted under RGB cherry switches all connected via Type-C. I've pieced together information from about a million sources online, and I think (or hope  :p) I've set everything up correctly in my schematic. A few specific questions I have about my design so far though:

1) Am I correct in assuming that to use analog signal with the AT90USB1286 I need to have a capacitor on both the AVCC and AREF pins? The datasheet seems to have said this, I mainly just want to make sure I understood it correctly.
2) I know that power over USB can be a concern with the addressable LED like I've chosen. It looks like each runs at 20mA at full brightness, which would max out the 500mA available over USB. If I simply run them at half brightness or so, would this cause power issues still?
3) I've set up my decoupling separate from the chip, similarly to how it is done in the github tutorial that a lot of people reference. I've seen this done a few different ways in this thread and other projects. Should I be setting this up differently to make things easier?
4) In my Type-C wiring, I've connected the CC1 and CC2 pins via 5.1k resistor to ground. I've seen it done this way and with both pins having their own resistors. Is how I currently have it set up sufficient? 213365-0

Thanks in advance for any help. like I said, I have some experience physically modifying existing things, and I have plenty of CAD experience, but PCB design is still pretty fresh to me.

Offline No_joke

  • Posts: 12
Re: The Living PCB Design Thread
« Reply #808 on: Sat, 30 March 2019, 11:20:48 »
Hey everyone!

Would love to get some critique on a new (actually, the first) design I'm working on.
It's meant to be a small, two octave digital synthesizer, based on mechanical switches and a Teensy 3.2 with the audio shield.

The connectors labeled as "controls" will be hooked up to linear potentiometers, and those labeled as "LED" to ws2812b LED strips.
On the right of the board you can see a micro USB connector and an audio jack (both connected via cable to the Teensy/audio shield respectively).

Are there any problems with the design?
Do you have any tips/ideas for improvements (both logical and visual)?
Are the via sizes (1mm), trace widths (0.4mm), and clearances (0.2mm) suitable for manufacturing?

216306-0

The KiCad project is available here https://github.com/m4ntis/teensynth-pcb.

Thanks! :)

Offline bpiphany

  • Posts: 1022
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #809 on: Wed, 10 April 2019, 15:35:55 »
Hey everyone!

I can't help to think you should be able to get away with wiring the matrix directly to the Teensy, and do away with the IO-expander. It looks like you have plenty of pins free. You could do some simpler multiplexing for the matrix as well. If you want to keep the 15 column layout you could use a 4-16 decoder to activate one at a time, and 2 inputs to the Teensy for the rows. That's only 6 pins, and no serial protocol.

It looks like you will be connecting the Teensy with a short USB cable soldered to J5. Is J8 on the bottom of the board? I think it's probably going to collide with the USB connector going into the Teensy otherwise.

Your diode footprint looks wrong. I guess it is possible to put an axial part in a vertical position, but there's no reason not to spread out to a 0.4" pitch.

In general with low speed stuff, if it passes the DRC it's going to be fine.

Edit: Perhaps pull-ups on the data channels to the IO-expander? I'm not familiar with using them, but I understand they are sometimes needed, or handy for even more pull-up even if there already are resistors on the Teensy itself.

And the obvious unconnected pins on the expander and multiplexer of course... But the DRC should catch that.
« Last Edit: Wed, 10 April 2019, 15:55:54 by bpiphany »

Offline bpiphany

  • Posts: 1022
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #810 on: Wed, 10 April 2019, 15:48:57 »
I've just stumbled on this thread via google search, and I've got to say reading through it has been massively helpful. Lots of good information here!

1. I think you need to read up on how the analog stuff works. I've never used the ADC functionality myself, but you still need to supply AVCC with power, just more decoupled than VCC in general. Also AREF needs to be connected to some reference for the analog signal in some way, decoupled with a capacitor (at least) probably.
3. The schematic doesn't really care where you put them. What's important is where you put them in the actual layout. Close to the supply pins (very low impedance) and solidly (low impedance) connected to your power source.

Edit: Apparently (reading the datasheet) you can use wither AVCC or an internal 2.56V reference as Aref, and then use only an external capacitor to GND like in your schematic to make it more noise immune. Or you can use an external reference (also decoupled to GND). But AVCC should always be at VCC+-0.3V maximum.
« Last Edit: Wed, 10 April 2019, 15:56:17 by bpiphany »

Offline tedfs3

  • Posts: 51
    • No Mercy Given
Re: The Living PCB Design Thread
« Reply #811 on: Sun, 14 April 2019, 17:49:29 »
I'm in the same boat as No_Joke and could use some help looking at a design. I honestly have no idea what I'm doing and just learning along the way.
Based off of the Fullsize Custom PCB FIlco Compatible - SaikouType 110 (NKBM-ST110r2) by null but a left handed version. Messed around with Freeroute a bit but
honestly just need some input as to whether the design is correct. Still some aspects I don't understand, like the USB implementation, as there is one connection
with no net. It has a schematic symbol but no footprint.

217263-0

Hope the Github thing was done correctly.
https://github.com/Tedfs3/104LH_v3.3

Offline HeroXLazer

  • Posts: 70
Re: The Living PCB Design Thread
« Reply #812 on: Sat, 27 April 2019, 19:26:40 »
DELETED
« Last Edit: Mon, 29 April 2019, 21:55:50 by HeroXLazer »

Offline HeroXLazer

  • Posts: 70
Re: The Living PCB Design Thread
« Reply #813 on: Mon, 29 April 2019, 21:55:08 »
Do AVCC, AVCC, and AREF need caps as they're for the A/D C?

Offline mythosmann

  • Posts: 24
  • Location: Ohio, USA
  • keyboards aren't even useful
    • My GitHub Page
Re: The Living PCB Design Thread
« Reply #814 on: Sun, 05 May 2019, 20:55:08 »
Howdy all, I've heard this is a good place to go with questions about a pcb.  I've made a few keyboard pcbs before, but it's my first time using onboard components.
I've been working on a pcb replacement for AEK and AEK II keyboards which features a built-in usb hub, rotary encoder support, mx/alps support, and a few other things.  This is what I got so far, I'm guessing it wouldn't work in its current state. You can also find the files on github.
218677-0
218679-1
218681-2
I'm pretty new to this, and I have a feeling I'm missing a bunch of important stuff.  Any feedback is greatly appreciated.

Offline Blitzschnitzel

  • Posts: 69
Re: The Living PCB Design Thread
« Reply #815 on: Tue, 07 May 2019, 18:15:14 »
Well, I would be careful with putting LED on HWB in series with the original pull down resistor. Forward voltage of LEDs is typically more than 0.9V. It is not a big deal though since LEDs conduct some current even below the forward voltage. But if you are unlucky and some interference kicks in then you may not enter the bootloader when you wanted to. If that happens then you would just press the reset button again and again untill the bootloader is entered. You should eventually get there.

After the MCU boots, there is no problem using HWB pin for GPIO (whether input or output ... it does not really matter). The rest of the circuit just cannot mind the pull down resistor there. Most of the time it does not matter. It only increases the power consumption a tiny bit. I used HWB as GPIO myself. It works without any problems (if the rest of the circuit does not mind the pull down there).

E.g. if your keyboard matrix scanning works with pull downs and shortening through switches to the Vcc (instead of to GND as it is common) then you can perfectly use HWB pin as one of the keyboard matrix scanning pins. You would need the pull down there anyway. This is one of the cases when HWB use does not even increase the power consumption.
In other cases, when the ideal circuit does not use pull up nor pull down then you often can add a pull down. In such a case it only increases the power consumption a bit. If the rest of the circuit requires a pull up there then you course you cannot use HWB pin (and keep the boot loader on reset feature).
Hi Guys,
I am exactly one pin short. would something like this work?
218771-0
Also, I was wondering if I could use a larger capacitor to put a bit of a delay on the reset pin, so that I can use the same switch to pull down reset and HWB? Or are there some kind of delay transistors, so that I don't get over the max capacitance?
Do you know of some opensource boards which use the HWB pin so that I can take a look at how they do it?
« Last Edit: Tue, 07 May 2019, 20:10:36 by Blitzschnitzel »

Offline ErgoMacros

  • Posts: 283
  • Location: SF Bay Area
Re: The Living PCB Design Thread
« Reply #816 on: Tue, 07 May 2019, 18:46:41 »
Quote
I've been working on a pcb replacement for AEK and AEK II keyboards...

Looks like you have a COL21 on the MCU that's not used in the matrix. No harm done.
All the best.
Today's quote: '...“but then the customer successfully broke that.”

Offline Villa

  • Posts: 27
  • Location: AC.
  • Bang.
Pffff, Syke—
« Reply #817 on: Thu, 09 May 2019, 20:53:47 »
Hello. I'm trying to dip my foot into KiCad and keyboard PCB design, but all of the tutorials recommended from these parts are old, outdated, and inapplicable to the current version of KiCad.

I would like to know if anyone can recommend some resources to make this possible.

Thanks for the time.


Got lucky, figured it out.

As I always do...
« Last Edit: Thu, 16 May 2019, 09:33:18 by Villa »

Offline ErgoMacros

  • Posts: 283
  • Location: SF Bay Area
Re: The Living PCB Design Thread
« Reply #818 on: Thu, 09 May 2019, 21:53:56 »
@Blitzschnitzel, re: needing an extra pin... I don't know what the rest of your pins are doing, so maybe these don't apply, but here goes.

1. I came across this while back...
  • 3 LEDs
  • 3 switches
  • only 3 pins required.
   https://www.edn.com/design/systems-design/4433477/3-pins--3-LEDs--3-buttons
Maybe of some use depending on what you other pins are being used for.

2. Also, if you needed 2 switches you can do that with a ADC pin and a couple resistors.
   https://www.edn.com/design/analog/4439796/Read-multiple-switches-using-ADC

3. Another of my favorite HW pages, many ways to read switches. Might be some inspiration...
   http://www.openmusiclabs.com/learning/digital/input-matrix-scanning/index.html

Luck!
Today's quote: '...“but then the customer successfully broke that.”

Offline Amy Worrall

  • Posts: 6
Re: The Living PCB Design Thread
« Reply #819 on: Tue, 04 June 2019, 14:56:26 »


The first PCB I ever designed! It's for a theatre lighting control keyboard.

It's iteration 1 of (probably) many. Currently this PCB only contains the keyboard matrix — the rows and the columns end in headers that I'll connect to my Teensy using wires. I have more ambitions, including RGB LEDs, but those will have to wait for future boards. I realised that I was biting off more than I could chew trying to do all the things on my v1, so I wanted to get something that worked first!

Offline Villa

  • Posts: 27
  • Location: AC.
  • Bang.
Re: The Living PCB Design Thread
« Reply #820 on: Thu, 06 June 2019, 06:57:07 »
Show Image


The first PCB I ever designed! It's for a theatre lighting control keyboard.

It's iteration 1 of (probably) many. Currently this PCB only contains the keyboard matrix — the rows and the columns end in headers that I'll connect to my Teensy using wires. I have more ambitions, including RGB LEDs, but those will have to wait for future boards. I realised that I was biting off more than I could chew trying to do all the things on my v1, so I wanted to get something that worked first!

Would that fit into a console of some kind? A compartment/case?

Also quite interested to know what kind of work you do, Amy.

Offline Amy Worrall

  • Posts: 6
Re: The Living PCB Design Thread
« Reply #821 on: Thu, 06 June 2019, 09:23:18 »

Would that fit into a console of some kind? A compartment/case?

Also quite interested to know what kind of work you do, Amy.

I have an enclosure that looks like this. It'll hold the keyboard-y bit, plus a tiny computer and some DMX output hardware, a couple of small LCD displays, etc.



As for work, for my day job I work for Facebook as a software engineer. This is a side project/hobby :)

Offline Villa

  • Posts: 27
  • Location: AC.
  • Bang.
Re: The Living PCB Design Thread
« Reply #822 on: Mon, 10 June 2019, 14:38:25 »

Would that fit into a console of some kind? A compartment/case?

Also quite interested to know what kind of work you do, Amy.

I have an enclosure that looks like this. It'll hold the keyboard-y bit, plus a tiny computer and some DMX output hardware, a couple of small LCD displays, etc.

Show Image


As for work, for my day job I work for Facebook as a software engineer. This is a side project/hobby :)

Cool biz—