USE DISCOUNT CODEEXPERT30TO SAVE $30 USD
[Schematic Review Request] - Using ESP32 C3FH4 and external sensors
Mini , 07-16-2024, 11:23 AM
I was quickly looking only your top left(U5) schematics and I noticed that your EP(external pad) is not connected. Also noticed your U5 pin number 22(VDD) and pin number 7(VSS) not connected. May I ask you why you leave them unconnected? Datasheet also clearly states EP must be connected to GND.
Mini , 07-16-2024, 11:32 AM
I also randomly went over other parts and noticed that your accelerometer INT lines are pulled just to VDD_IO directly? If you don't use them then do not connect them. If you use them then use pull ups/pull downs. Now if you connect directly them to VDD_IO them think what happens when whatever reason this INT goes low. IT will short your VDD_IO to GND. I mean if you don't use it then just don't connect it.
Mini , 07-16-2024, 11:46 AM
Also I haven't used easyeda, but I don't get how you can label pins with two different pins and expect them to be connected. Look accelerometer connections. U8 pins 12,13,14. You named them GPIO8-10 and yet when going to ESP32 they are named ACC_CS, ACC_SDA, ACC_SCL.
Mini , 07-16-2024, 11:48 AM
Not sure what you use accelerometer CS, it should be part of SPI communication. Not sure is it needed if you choose I2C. Have to read datasheet. Whole your accelerometer connections and everything else needs to checked. That's quite a bit of work.
Mini , 07-16-2024, 11:50 AM
All the naming and connections look quite messy. Keep positive voltages up and GND down. Name your pins properly not like GPIO8. At least that's what I would do.
QDrives , 07-16-2024, 08:43 PM
He makes a short between "TBD" and VDD_IO. However, there are 2x "TBD" nets. They too should not be shorted.
QDrives , 07-16-2024, 09:05 PM
@luis857 I am going to be blunt and direct.If you try to cramp everything into a single A4 size schematic, you get problems like @Mini described here already.There are many more critical errors, like shorting 3V3 to Gnd.My advice:- Split the schematic into multiple sheets.- Give everything space: no lines crossing text, no dots over text, text above line is a netlabel- Netlabels should convey the function of the signal, like "SCL", "SDA", etc.- Gnd symbols face down, power ports face up.- Keep the grid to 100mil- No unneeded connection dots- No floating netlabels
QDrives , 07-16-2024, 09:06 PM
Here is an example of a clean schematic.
luis857 , 07-17-2024, 09:32 PM
Update
QDrives , 07-18-2024, 07:27 PM
That is a whole lot better.You do have a pull-up of SDA and SCL three times. Only have one set of pull-ups.Position them at the furthest chip from the I2C master (layout). Schematic wise, I would place them on the page of the master (ESP32).
QDrives , 07-18-2024, 07:37 PM
Your INTx nets may need pull-ups.Why do you have an inductor in your crystal circuit? Is that to get the second over-tone?
QDrives , 07-18-2024, 07:37 PM
Please repeat any questions that may remain.
luis857 , 07-18-2024, 08:05 PM
The inductor in the crystal circuit is basically what the hardware data sheet told me to do
luis857 , 07-18-2024, 08:07 PM
What do u mean by only one set of pull ups?
luis857 , 07-18-2024, 08:08 PM
both int 1 and 2 need pull ups?
QDrives , 07-18-2024, 08:13 PM
Ok, weird.
QDrives , 07-18-2024, 08:22 PM
Both SDA and SCL need pull-ups. However, you have 3 for each: R3, R4, R5, R6, R7 and R8. 2x4k7 and 1x10k so about 1.9k pull-up. It is not to low, but still, I would only have one pull-up per net.
QDrives , 07-18-2024, 08:23 PM
Yes, I would add a pull-up for each net, unless the ESP32 has pull-ups internally that can be used.
luis857 , 07-18-2024, 11:25 PM
Should I add a pull up to cs for spi
luis857 , 07-18-2024, 11:26 PM
For U5
Mini , 07-19-2024, 01:02 AM
Yes, CS should have pull up unless you are using ESP32 internal one. I checked your accelerometer and I still don't understand you. Are you using I2C or SPI? By looking at your schematic you seem to use none of them, but a weird combination of both. You have used I2C clock and data and then CS and SDO. Read your accelerometer datasheet and learn the basics of I2C and SPI. And then connect it properly. Your accelerometer has 4 different modes. You want to use mode 1, but I can't understand which communication you want to use. Also you cannot connect them randomly to ESP32. Not sure did you connect your ESP32 even correctly. Unless you want to do bit banging which I doubt.
luis857 , 07-19-2024, 02:36 AM
The connections were made based on the datasheet of the esp32 where i2c connections include any gpio pin. The spi interface were connected based on a Phil’s lab video where he used SDO on a gpio pin and the cs having a it’s own indicated pin.
luis857 , 07-19-2024, 02:36 AM
from what I understand the pins can be reprogrammed on the esp32
luis857 , 07-19-2024, 02:36 AM
I connected it the accelerometer based on the schematic provided in the datasheet for mode 1
Mini , 07-19-2024, 09:11 AM
You are using I2C or 3 wire SPI or 4 wire SPI? Which one you want to use? It's hard to say from your connections. I doubt it's shown this way in datasheet.
Mini , 07-19-2024, 12:36 PM
Do you mean this schematic? It doesn't show you I2C or SPI. It shows them both, it is general drawing. You need to read pin description to get an idea what to connect where.
Mini , 07-19-2024, 12:38 PM
I also hardly doubt ESP32 crystal requires inductor as @QDrives pointed out. Quick reference schematic google shows no inductors. You are messing up again something. Take a look at reference design.
luis857 , 07-19-2024, 02:49 PM
luis857 , 07-19-2024, 02:49 PM
The datasheet also mention I could use a resistor instead of an inductor for the crystal circuitry
luis857 , 07-19-2024, 02:49 PM
In other words I’d have to choose an interface?
luis857 , 07-19-2024, 02:50 PM
Between i2c and spi?
luis857 , 07-19-2024, 03:03 PM
From what I’ve read from the datasheet I’d have to choose between spi(3and 4 wire) and i2c. So would I have to only configure the spi interface(one I’d choose)
luis857 , 07-19-2024, 03:03 PM
?
Mini , 07-19-2024, 07:53 PM
This picture is impossible to see literally.
Mini , 07-19-2024, 07:56 PM
No offense, but I think you should learn first how I2C or SPI works and understand how to read the datasheet. Watch videos from PhilsLab or Robert. You can't do schematics without not knowing basics.
QDrives , 07-19-2024, 07:57 PM
Looking a bit at the ESP32 datasheet it states the any GPIO pins can bu used or both I2C and SPI.The accelerometer datasheet does the I2C / SPI selection based on CS. When CS is high, it is in I2C mode, CS low in SPI.
QDrives , 07-19-2024, 07:57 PM
Why do you have a voltage level translation between 3.3V and 5V?What is powered by 5V?
Mini , 07-19-2024, 07:58 PM
That's pretty interesting. Never used ESP32 myself. Gotta have one big multiplexer to give all GPIO both.
QDrives , 07-19-2024, 08:03 PM
"...one big..." -- It does not have 100 IO pins. And can only have one I2C channel. SPI too (general purpose).
Mini , 07-19-2024, 08:11 PM
Thats right though, not many pins. Still kind of interesting that you can map each to all of them. But I guess having only one channel makes it easier indeed.
luis857 , 07-19-2024, 09:40 PM
5v for heart rate sensor
Mini , 07-20-2024, 10:40 AM
Which heart rate sensor? Your heart rate sensor U8 has no 5V connection. I can't see anywhere in this schematic any 5V connections.
Mini , 07-20-2024, 10:46 AM
I looked where your 5V goes to. You are literally doing it right this. ESP32(SCL_IN)->U9->U7(SCL)
Mini , 07-20-2024, 10:49 AM
Your ESP32 is powered by 3.3V and you use 5V pull up. And then it goes to logic converter and then U7. U7 is also powered by 3.3V. Both U7 and ESP32 use 3.3V logic. Why you using converter? You can literally connect them directly.
Mini , 07-20-2024, 10:53 AM
Also note that ESP32 only allows max 3.6 VDD and IO pins absolute maximum voltage is VDD+0.3V so 3.9V. You can't use 5V on ESP32 pins.
QDrives , 07-20-2024, 10:55 AM
Your heart rate sensor is powered from 1.8V. The heart rate sensor is capable of handling 3.3V signals on the IO. There is no need for level conversion of signals.
QDrives , 07-20-2024, 10:56 AM
Always check the "absolute maximum ratings" section in the datasheet.
Mini , 07-20-2024, 11:30 AM
Yes it's actually powered by 1.8V not 3.3V. In that case you should also check logic level voltages. It might not fit into them since ESP32 is running of 3.3V.
Mini , 07-20-2024, 11:33 AM
I made a quick look into ESP32 datasheet. I found on that HIGH level minimum is 0.75*VDD so 0.75Vx3.3V= 2.475V. Since his heart rate sensor is powered by 1.8V there is a problem. Not sure 100% if i miss something. I don't have time to go over all the datasheets for OP.
Mini , 07-20-2024, 11:33 AM
ESP32 datasheet IO voltage table
Use our interactive
Discord forum to reply or ask new questions.