Design help with a PCB (useing a ESP32 devkit along with a bmp388 and MPU6050)

Currently I'm designing a flight computer using a ESP32 as the brain and some different sensors, I was wondering if any of you could look over the electronic schematic specifically. and then if anyone was willing to go a step further, if they could look at the board.

I already have done one iteration of this. but there were a few critical oversights, on my part and then just a difference in parts. so after i fixed those things i figured id see if anyone could check it before I spend more money on another version.

my main concern is weather or not my connections are correct, and weather or not the way i lay out the traces on the board matter too much, i have a lot of singles running more than one direction, like 2 I2C things running on the same line. so is the order in which I wire them matter? or as long as I complete all the air wires in my design will it be ok?

electronics Schematic
Board schematic
3D model (minus a few parts)

Have you done a test with a prototype or on a breadboard ? You are using a 38-pin dev-board right . Can you really use the GPIO pins that you have assigned ? (like 6, 7, 8, 9 ...)
You battery voltage divider results in 3.4v at 8.4v input, that is the full level, that is just a bit more than what can be measured. it results in 2.95 at 7.4v That is the empty level. That is not much range. Using an Op-Amp you should be able to get a more accurate reading.

Using a linear regulator like the 7805, you will waste a lot of energy, which for battery power applications would be better saved. Actually the ESP32 uses a linear on-board to reduce down to 3.3v, which is also wasteful.

Can you elaborate ?

the ESp32 model I got online was either designed incorrectly, or my board is a little wider. and then when I designed the library for the BMP388, I accidently made the pin holes a tad bit too small.

I went with the linear regulator for a few different reasons, but mainly just because I know how to use it and that it works.

I used a combination of resources to get the Ohm rating for the voltage divider, but even I'm not completely sure i understand even how the voltage divider works, so those values could definitely be wrong. what would you perchance recommend?

I haven't mocked up a breadboard prototype just yet, my bread board actually isn't big enough, but I plan to try and make one as soon as possible and definitely before i order any more boards.

Then try the circuit out on a breadboard, and measure with a voltage meter, the results you get.

You do need to understand how a basic circuit such as a voltage divider works if your designing PCBs.

1 Like

Hi,
@aidanborden images;



Thanks.. Tom... :grinning: :+1: :coffee: :australia:

Hi! A few things first. First, a schematic and PCB review usually takes multiple hours in person, even when data sheets and the schematics have been sent ahead of time. If I may ask, what program are you using to create this? I've had a lot of luck with KiCAD (free and open source) for my personal projects, though I've used Altium and Eagle in my professional life (Eagle less so).

@Deva_Rishi had a really good point - get everything working with a breadboard or by soldering wires together first, before ordering a PCB. It will help you solve a lot of the problems you'll run into just trying to get the thing to work. Also, nobody gets it right in the first revision (even the second, or the third...), even professionals. There are always a few small things that you find when you order your boards that are wrong.

Okay, so, let's get into it. The first thing that I notice right off the bat is that your BMP 388 is not going to communicate. There are two main digital communication protocols - I2C ("i squared c") and SPI. They are very different. The GY-521 uses I2C, and the BMP 388 uses SPI. This means that you cannot hook them up to the same signals. You'll need independent traces going to each, as they're different protocols.

To use SPI, it doesn't have an address like I2C, it has a CS (or Chip Select) pin that you have to drive low (to ground) in order for it to listen to the commands on the bus. There are usually libraries that do that for your specific device, so you might look into if anyone has written a BMP 388 library.

Again, to @Deva_Rishi 's point, there are certain pins that you cannot use for General Purpose I/O (GPIO) on the ESP32. I use ESP32's all the time, and this drives me crazy. There are also default pins for I2C and SPI that will make your life a lot easier when coding. Just look up your version of the ESP32 and "pinout" at the end, and your favorite search engine should show you the default pins. I'd highly recommend using those.

If you haven't already, I'd look through the device's datasheets. They usually tell you how to wire them up (some even include a "best practice" board layout that I'd recommend you try to accommodate).

To be completely honest, I haven't studied your schematic or board layout too much. However, on your board layout, on the bottom layer (I assume - it's the blue layer), on the right side, about halfway up the board, there's a (what I assume to be 5V) trace that does a little wiggle around a via. Try to avoid those as the board manufacturer will have difficulty getting that right. Instead, drag that part of the trace (where it's going up the board) to the left a little bit to get rid of that wiggle and make is straight. The more straight lines, the better.

Hi, @aidanborden
What is plugged in to the sockets where Q1 to Q4 are located?
What is the function of the Q1 to Q4?

A very good idea.

A schematic would be good with ALL your hardware connections.

Resistors R4, R7, R9 and R11 are to low, they should be 10K.

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

What software are you using ?
What is the board you actually have, and where did you get it from. There are so many ESP32 variants. The ESP32S3 dev-board is just a bit more narrow, and the pinou anyway doesn't match with any of the other variants. It is important we know what board you have,

I only found the SMT package ? So first of all i am assuming you mean 'footprint' not 'library' But when is see what a BM388 look like i am confused about 'pins'

From this statement i draw the conclusion that you don't know what you are really doing. I mean you have a plan, but are lacking knowledge on a variety of subjects. Incorrect use of terminology is probably confusing to people.

Well there you go. These are 2 different thing. I tend to first put everything on a breadboard (or 2)

I figure you need a bigger one. The small size is usually to small.
Anyway, after that works, i solder up a 'prototype using experimentation board. That can be tricky, because soldering comes into the equation. Soldering a prototype in some ways is more hard that soldering a PCB, but i found it t be a valuable step.

Good !

I do agree.

I mostly understand how a voltage divider works, just its an interesting concept for me.

I'm using Fusions tools, which are essentially eagle just baked into fusion.

i have an entire design document that holds links to everything I've purchased and all the different parts. thats this

but the BMP388, at least the one I have, does have I2C communication, its the whole reason i picked that board and sensor, as for the miss communication about its pins, i don't have only the chip, I have the whole sensor board form Adafruit. (sourced from Digikey.)

i know that, and i have the pinout for the board i got, so as far as i can tell ive selected the right things for the right pins.


its also in my design Document.

thanks for noticing that misplaced trace, I totally missed it.

these are the wireings from Adrafruite for the BMP388

website

Q1-Q4 are all pyro channels, they will all be connected to the two leads which will control different pyrotechnical charges. (maybe shoulda mentioned this is going to be a Rocket Flight computer.)

why is it that you recommend they should be 10K? those resistors are meant to filter out any traces of current form the pins in order to improve the safety of the board (since they will be connected too pyros.)

i have all the componant links here

plus the specific ESP32 is this

as for the software, its Fusion, so pretty much Eagle.

its the actually sensor board from adafruit. also linked in the doc above.
but here is the true link

your right, i definitely don't know everything about what im doing, im by no means a professional, but I have done countless hours of research so far. and i have a lot of different designs im taking ideas from. im also duel enrolled in both Highschool and College, so this semester im taking a electronics 111 course, which should help with some of this stuff.

They keep the Gate of the MOSFET at ground potential, so when the controller boots and the output it is connected to is a high impedance pin, by default, the MOSFET will not activate.
The lower the value you use the more current you will draw from the controller output pin, check how much current you can draw from an ESP32 output.
If 470R works reliably, then okay, but check the specs.

Tom.... :smiley: :+1: :coffee: :australia:

Oh good, well the header pins should have the same size as eh well 'pin-headers'

Well maybe, but you have attached things to GPIO 6, 7, 8, 9, 10 & 11 although those pins are marked with an exclamation mark and state that those are used by flash and can't be used as regular GPIO pins.

That is a 30-pin devkit, (on which pins 6 - 10 are not exposed even) the pinout you posted here

is a 38-pin Devkit. Those do not share the same pinout. It is really important that the footprint you use in your project matches what you actually have, or pins will not be connected to what you intent to connect them to.

If, as you said, the pins on the PCB were to close together, that probably means you used a footprint for an even different board that looks similar (probably an ESP32S3 devkit) which again has a different pinout.

I am trying to prevent mishaps here, so please post an actual picture of what you have, and see if you can manage to post the symbol & footprint. The software should have sections in which you can create and modify both symbol and footprint. I am not familiar with your software, so i can't guide you to the proper section of it.

im going to double check using a breadboad today. just to be sure.

i dont know what you mean by that, that has 38 pins, and is the same model i have? the pinout matches exactly to what i have in person.

i know where it is, i had to make a few adjustments to the library's.

i see what you mean now, and i think ive fixed it.

this should be the new layout

Ah yes sorry it does have 38 pins.

Be aware that GPIO 0 is a strapping pin that is used to define the boot mode. (The boot-switch is also connected to it and GND, and i think there is a pullup resistor on it) and that GPIO 2 has the buitin LED on it. These may influence the functionality of your circuit. That may all be fine like that, but you should test this before you go ahead and order PCBs
You can use pins 34, 35, 36 & 39 as input only, one of those might be a good pin for the battery level measurement. (or anything else which is just INPUT anyway) And probably better to increase the resistance of the 10K resistor in the divider (or decrease the 6.8K resistor) a little bit to make sure your top level doesn't exceed 3..3v (at 8.4 maximum battery level)

my board only has a Power LED, i know other board has a built in LED, but ived tried controlling it via Pin2, and it doesn't work, so do I need to still worry about that?
but how would usieng GPIO 0 (specifically) affect its utput? as long as i don't press the boot button, it would work, right? or would it short circuit?

im going to do more research on the Voltage divider definitely, and ill figure out what values to use for the resistor.