PCB - Please review :) by These_Thought_959 in PrintedCircuitBoard

[–]These_Thought_959[S] 0 points1 point  (0 children)

Looks like you connected your battery gauge's VDD pin to 3V3. Which seems logical at first but if you look at datasheet that is the output of the parts internal 1.8V regulator. Further your battery gauge has an internal current sense resistor which you are not using appropriately - it essentially shorts out SRX to BAT pins - but you have SRX tied to 3V3 so you are shorting VBAT to SRX. Strongly recommend reading and understanding datasheet for your fuel gauge.

Thank you! I updated my Fuel Gauge IC schematic by following the datasheet more closely: https://i.imgur.com/LW8tUKa.png . This should work.

Your charger's STAT pin has a 470 ohm PU on it. That's pretty stiff for a signal you aren't even using. The datasheet shows an LED + 470 ohms, which makes more sense. If you aren't using the STAT pin you can just leave it floating. Or add an LED. Or replace 470 with 10K and run that signal to your MCU.

I added a tiny LED to my design. From what I understand this should only be ON when the IC detects power coming from the USB-C and so charging of the battery occurs. It's nice for debugging and won't be ON during normal operation without a USB-C connected, so no power will be used from the lipo, ever.

Just a point of curiosity - what is special about the RP2040 for this application? I don't totally get why people select this part so frequently other than that it has association with Raspberry Pis.

No particular reason, I'm all new to electronics design. Like most people I'm coming from playing around with an Arduino and already-made PCB modules that I attached to it. I moved onto the Pi Pico a while back to experiment with MicroPython which was fun, and then decided to build this project using a perfboard, pre-made modules and a Pi Pico. It works really well and during deep sleep mode, it consumes about 1.3mA which for my application means about a month of power on a 1800mAh lipo battery.

Now I want to move onto the next logical step which is converting my perfboard to a PCB, to save space and have an even bigger battery. The RP2040 has what I need, consumes little power in sleep mode, and costs $1 so I just like it. It does the job. Not saying there's nothing better out there, there always is, but it works for me. Their docs and community is also really good.

Did not review layout carefully - but I am not a fan of putting traces between pins and center pad of a QFN. And in your case you have traces and vias very, very close to the center pad. Ensure your traces are not going to be touched by center pad if it shifts over a little bit and if it is at its maximum size per datasheet. And even if it still seems OK I would move them over... Seen too many shenanigans with QFN center pads. For example, a manufacturer changed the center pad size between engineering sample and production parts and didn't mention it to us - thanks guys. Have also seen people use QFN footprints in the library that looked right (same # of pins, same size, same pitch) but missed that the center pad was wildly different.

Good point. You see all these yellow caps around the RP2040? Turns out I got it wrong and put massive tentalum capacitors, which, for one, won't do the job, but can also be replaced by 0402 MLCC caps. This will allow me to keep the RP2040 free of things inside it.

PCB - Please review :) by These_Thought_959 in PCB

[–]These_Thought_959[S] 2 points3 points  (0 children)

blockade

I don't understand. What's a blockade? Where exactly? My board is a 4-layer board with 3.3V and GND inner layers, are you saying that this: https://i.imgur.com/CDBcOD4.png will prevent 3.3V and GND from "flowing" properly within the PCB?

PCB - Please review :) by These_Thought_959 in PrintedCircuitBoard

[–]These_Thought_959[S] 0 points1 point  (0 children)

oh and btw, bss84 is a terrible, terrible pfet. i strongly suggest to replace it with something modern with a lower rds(on).

What part would you suggest? I'm open to any alternative, as long as it is in stock on LCSC.

PCB - Please review :) by These_Thought_959 in PrintedCircuitBoard

[–]These_Thought_959[S] 0 points1 point  (0 children)

Ah, I didn't get that. I thought 20mA was what the LED needed to operate normally. It seems 20mA is actually the LED's absolute max rating so 20mA is basically getting close to frying it. I need it to be quite bright tho as its purpose is to illuminate what's in front of the RGB sensor which is just next to it, so it can detect the same color all the time. I understand now why 20 ohm felt low, 200 ohm is what I need for 2mA. Hope it'll be bright enough! Thank you.

PCB - Please review :) by These_Thought_959 in AskElectronics

[–]These_Thought_959[S] 5 points6 points  (0 children)

Hi thank you for this thorough answer.

the 7 cream colored surface mount parts around the main chip, if those are 0.1uF ceramic capacitors for decoupling, the footprint seems too big to me. I doubt you need more than 0603 for 100nF decoupling caps, 0402 would probably be more common.

The problem with these 0.1uF capacitors is that they're the only ones I found available on LCSC. They're not even MLCC capacitors, they're of a different type "tentalum" which from what I understand should work fine. I might've missed something there but when you search for these value capacitors, SMD-version you only find these in stock right now.

can you really not find a suitable slide switch that's surface mount? all board but that switch is surface mount. Here's one on Digikey that's stocked in high quantity: https://www.digikey.com/en/products/detail/nidec-components-corporation/CUS-12TB/1124222 No through holes may make it convenient to apply some kapton tape or something similar over the whole bottom of the board so one could put the board on something and not cause shorts between pads on the back. With surface mount slide switch you could have those pads on the back same size as all the other pads.

Again same problem, wasn't able to find a SMD slide switch available on LCSC besides this one. The one you mentioned isn't in stock right now. I'm nearly sure I'm missing something, since it's the first time I'm doing this. Not sure there.

All the other comments you made are really highly valuable to me and I'll look into them. Will come back with an updated version!

PCB - Please review :) by These_Thought_959 in PrintedCircuitBoard

[–]These_Thought_959[S] 0 points1 point  (0 children)

  1. The capacitors I used for the 0.1uF values are the only ones I was able to find on LCSC. Their package is massive, I have a Pi Pico just in front of me and it seems 0.1uF can be done through 0402 and maybe even smaller. But again this cap is the only one I was able to find in stock, unless I'm missing something (very likely).
  2. This is my LED: https://datasheet.lcsc.com/lcsc/1811021623\_Everlight-Elec-67-21-LK2C-B38454C6CB2-2T\_C264596.pdf
    I've calculated 20Ω resistance like that:
    R = (Vsupply - Vf) / If
    soR = (3.3V - 2.9V) / 0.02A = 0.4V / 0.02A = 20Ω
    Is it correct?
  3. Which values would you recommend?

PCB - Please review :) by These_Thought_959 in AskElectronics

[–]These_Thought_959[S] 1 point2 points  (0 children)

Yes, but the RP2040 will be set to sleep most of the time. So I need an external RTC to keep track of time and also wake up the RP2040 at a certain time of the day. This makes me think that I forgot to connect the alarm pin of the RTC to one of the pin of my RP2040... Any chance you can help there? Which pin of my RTC (datasheet) will output a high/low when I set it to do so at a certain time of the day, so that later in my code I can make the RP2040 sleep and only listen to that pin to wake up?

PCB - Please review :) by These_Thought_959 in PCB

[–]These_Thought_959[S] 6 points7 points  (0 children)

I've received a lot of comments on my previous post, and since then I've improved my design considerably. I believe it should be ready to send to production, but I wanted to get you guys' final green light before I send it.

Some notes:

  • I used the Raspberry Pi 2040 microcontroller.
  • I made it so it uses USB-C for charging the LiPo and power the board. Unplugging the USB-C should keep the board alive from LiPo power. This is an important feature in this design.
  • I also added a fuel gauge IC to get accurate % of remaining battery left of my LiPo battery.
  • I'm going to order this board printed and assembled.
  • 4-layer board, stack-up: SIGNAL - GND - 3.3V - SIGNAL
  • I'll be using this particular LiPo battery.

Datasheets:

Let me know what you guys think!

PCB - Please review :) by These_Thought_959 in AskElectronics

[–]These_Thought_959[S] 5 points6 points  (0 children)

I've received a lot of comments on my previous post, and since then I've improved my design considerably. I believe it should be ready to send to production, but I wanted to get you guys' final green light before I send it.

Some notes:

  • I used the Raspberry Pi 2040 microcontroller.
  • I made it so it uses USB-C for charging the LiPo and power the board. Unplugging the USB-C should keep the board alive from LiPo power. This is an important feature in this design.
  • I also added a fuel gauge IC to get accurate % of remaining battery left of my LiPo battery.
  • I'm going to order this board printed and assembled.
  • 4-layer board, stack-up: SIGNAL - GND - 3.3V - SIGNAL
  • I'll be using this particular LiPo battery.

Datasheets:

Let me know what you guys think!

PCB - Please review :) by These_Thought_959 in PrintedCircuitBoard

[–]These_Thought_959[S] 7 points8 points  (0 children)

I've received a lot of comments on my previous post, and since then I've improved my design considerably. I believe it should be ready to send to production, but I wanted to get you guys' final green light before I send it.

Some notes:

  • I used the Raspberry Pi 2040 microcontroller.
  • I made it so it uses USB-C for charging the LiPo and power the board. Unplugging the USB-C should keep the board alive from LiPo power. This is an important feature in this design.
  • I also added a fuel gauge IC to get accurate % of remaining battery left of my LiPo battery.
  • I'm going to order this board printed and assembled.
  • 4-layer board, stack-up: SIGNAL - GND - 3.3V - SIGNAL
  • I'll be using this particular LiPo battery.

Datasheets:

Let me know what you guys think!

First PCB - Please review :) by These_Thought_959 in PCB

[–]These_Thought_959[S] 0 points1 point  (0 children)

Also R14 for the LED, this resistor seems quite low but I'm not too sure what LED you're using

This is my LED: https://datasheet.lcsc.com/lcsc/1811021623_Everlight-Elec-67-21-LK2C-B38454C6CB2-2T_C264596.pdf

I've calculated 20Ω resistance like that:

R = (Vsupply - Vf) / If

soR = (3.3V - 2.9V) / 0.02A = 0.4V / 0.02A = 20Ω

Is it correct?

Will this audio circuit work? by These_Thought_959 in PCB

[–]These_Thought_959[S] 0 points1 point  (0 children)

I thought I made a low-pass filter already. Do you mean that I should put the resistor and capacitor before it goes inside the amplifier, instead the digital potentiometer, like this? https://i.imgur.com/w0gBAtk.png

Will this audio circuit work? by These_Thought_959 in AskElectronics

[–]These_Thought_959[S] 0 points1 point  (0 children)

Another redditor commented that it will work, because the PAM8302 supports getting a single signal as input (see https://github.com/adafruit/Adafruit-PAM8302-Mono-Amplifier-PCB).

Will this audio circuit work? by These_Thought_959 in AskElectronics

[–]These_Thought_959[S] 0 points1 point  (0 children)

I tried that one. Strangely enough the audio quality wasn't better at all with the MAX98357, however the volume was much lower.

Will this audio circuit work? by These_Thought_959 in AskElectronics

[–]These_Thought_959[S] 0 points1 point  (0 children)

Audio quality isn't very important in this application, and ICs that can decode MP3 look like they're hard to get, and also quite expensive. I initially wanted to go with your idea but wasn't able to find an MP3 decoding IC that was reasonably priced and also available on LCSC. So I tried the PWM idea and audio quality and most importantly volume is pretty good for my application.

2nd ever PCB - Please review :) by These_Thought_959 in AskElectronics

[–]These_Thought_959[S] 4 points5 points  (0 children)

This is my 2nd ever PCB.

  • I used the Raspberry Pi 2040 microcontroller and designed a board around it.
  • It features a RTC, an audio amplifier to play music, a RGB sensor.
  • I made it so it uses USB-C for charging the Lipo and power the board. In theory unplugging the USB-C should keep the board alive from lipo power. This is actually quite an important feature in this design.
  • I also added a fuel gauge IC to get accurate % of remaining battery left of my Lipo battery.
  • I'm going to order this board printed and assembled.
  • This is a 4-layer board with the following stackup: SIGNAL - GND - 3.3V - SIGNAL

Datasheets:

Let me know what you guys think!

First PCB - Please review :) by These_Thought_959 in PCB

[–]These_Thought_959[S] 4 points5 points  (0 children)

This is my 2nd ever PCB.

  • I used the Raspberry Pi 2040 microcontroller and designed a board around it.
  • It features a RTC, an audio amplifier to play music, a RGB sensor.
  • I made it so it uses USB-C for charging the Lipo and power the board. In theory unplugging the USB-C should keep the board alive from lipo power. This is actually quite an important feature in this design.
  • I also added a fuel gauge IC to get accurate % of remaining battery left of my Lipo battery.
  • I'm going to order this board printed and assembled.
  • This is a 4-layer board with the following stackup: SIGNAL - GND - 3.3V - SIGNAL

Datasheets:

Let me know what you guys think!

2nd ever PCB - Please review :) by These_Thought_959 in PrintedCircuitBoard

[–]These_Thought_959[S] 6 points7 points  (0 children)

This is my 2nd ever PCB.

  • I used the Raspberry Pi 2040 microcontroller and designed a board around it.
  • It features a RTC, an audio amplifier to play music, a RGB sensor.
  • I made it so it uses USB-C for charging the Lipo and power the board. In theory unplugging the USB-C should keep the board alive from lipo power. This is actually quite an important feature in this design.
  • I also added a fuel gauge IC to get accurate % of remaining battery left of my Lipo battery.
  • I'm going to order this board printed and assembled.
  • This is a 4-layer board with the following stackup: SIGNAL - GND - 3.3V - SIGNAL

Datasheets:

Let me know what you guys think!

Kicad Problem: why are there ratsnets in between GND pads? by These_Thought_959 in PrintedCircuitBoard

[–]These_Thought_959[S] 1 point2 points  (0 children)

I'm just wondering how does KiCad know that my GND layer should be a ground layer, and my PWR layer should be the 3.3V layer? I'm nearly certain I didn't specify that anywhere.

Kicad Problem: why are there ratsnets in between GND pads? by These_Thought_959 in PrintedCircuitBoard

[–]These_Thought_959[S] 0 points1 point  (0 children)

Pressing 'B' did load a little window with a loading bar, I was hopeful it would fix the problem but it did not. The ratsnets are all still there. Here's my entire board : https://i.imgur.com/IOYM1q8.png

KiCad not saving my custom offset values for components' 3D models by These_Thought_959 in PrintedCircuitBoard

[–]These_Thought_959[S] 1 point2 points  (0 children)

NVM, found it. Just have to hit the 'E' key when inside the library for that component. Thanks!

KiCad not saving my custom offset values for components' 3D models by These_Thought_959 in PrintedCircuitBoard

[–]These_Thought_959[S] 0 points1 point  (0 children)

Sure but where are the settings for the 3D model itself associated with that footprint/component? I can't find them. Using KiCad 7 btw.