Peer Review for my first circuit - Page 1
Forum section: electronics / projects

author: Linenoise
author_rank: Newbie
timestamp: August 23, 2020, 01:24:53 am
content: I have been lurking this forum for a while and this seems to be a great group of people. I took the plunge and created my first schematic with plans to have a custom PCB with surface mount components made. I was hoping to get some peer reviews to review my schematic to make sure I haven't made any obvious mistakes. I wanted to make a custom ESP32 board with all of my sensors on a single board. I used a combination of sparkfun, adafruit designs as well as the refrence designs from the data sheets. Many of the componets are now obsolete so I tried to find alternative components.Areas of concern1. ESP32 reset buttons and usb to serial convertor, this was pulled from the adafruit design. I am not exacly sure how the transistors work to automaticly reset, so I am not sure I implemented this correctly.2. Voltage supervisor, want to make sure this is setup correctly to make sure the MC boots when 3.3 volts is applied to avoid under powered boot or brownouts.3. LIPO charger, want to make sure I can charge the battery while powering the device. I have solder jumper pads to select the LIPO batery size with 17mA for a rechargable coin battery along with a regular jumper to select from Lithium coin battery to LIPO battery. Want to make sure I a) I can use the LIPO charger to charge the ML-1220_F1AN Lithium Manganese Dioxide (LiMnO2) battery. I am also open to other compact rechargeable solutions, that are in the $2-3 price range.4. Any comments are welcome to improve the design.Parts and links for easy refrence.Coin Battery: ML-1220_F1ANhttps://www.mouser.com/ProductDetail/Panasonic-Battery/ML-1220-F1AN?qs=%2Fha2pyFaduh6kcAmafAGdBP1Ww2yTLc0LbBk5LtPZJP9N0Kno5bnbA%3D%3D] https://www.mouser.com/ProductDetail/Panasonic-Battery/ML-1220-F1AN?qs=%2Fha2pyFaduh6kcAmafAGdBP1Ww2yTLc0LbBk5LtPZJP9N0Kno5bnbA%3D%3DESP32 ESP32-WROOM-32D_M113DH2800PH3Qhttps://www.mouser.com/ProductDetail/Espressif-Systems/ESP32-WROOM-32DM113DH2800PH3Q0?qs=%2Fha2pyFadugKGKyA%252BZerg77Y77SFhqN4eEeMgYdepSrW4hBJ%2F7RzvPWjKRD%2FL5PA2BBEGc45i7I%3D] https://www.mouser.com/ProductDetail/Espressif-Systems/ESP32-WROOM-32DM113DH2800PH3Q0?qs=%2Fha2pyFadugKGKyA%252BZerg77Y77SFhqN4eEeMgYdepSrW4hBJ%2F7RzvPWjKRD%2FL5PA2BBEGc45i7I%3DVoltage Supervisor BD48K33G-TLhttps://www.mouser.com/ProductDetail/ROHM-Semiconductor/BD48K33G-TL?qs=%2Fha2pyFadui9DP%2FRZ594qX5nlUrkJ%252BwgGZmOgX4K9ObnYSWPiAyvsg%3D%3D] https://www.mouser.com/ProductDetail/ROHM-Semiconductor/BD48K33G-TL?qs=%2Fha2pyFadui9DP%2FRZ594qX5nlUrkJ%252BwgGZmOgX4K9ObnYSWPiAyvsg%3D%3DUSB to Serial Converter CP2104-F03-GMhttps://www.mouser.com/ProductDetail/Silicon-Labs/CP2104-F03-GM?qs=j12q4iUN960zrcKDk%2FjKbw%3D%3D] https://www.mouser.com/ProductDetail/Silicon-Labs/CP2104-F03-GM?qs=j12q4iUN960zrcKDk%2FjKbw%3D%3DLIPO Charger MCP73831https://ms.componentsearchengine.com/part.php?partID=159526] https://ms.componentsearchengine.com/part.php?partID=159526Here is the schamatic. Thanks for the help everyone.Linenoise

author: Linenoise
author_rank: Newbie
timestamp: August 23, 2020, 12:00:44 pm
content: Just adding a schematic thumbnail for convenience.Linenoise

author: Psi
author_rank: Super Contributor
timestamp: August 23, 2020, 12:08:22 pm
content: - You have the enable pin tied to ground on the IC2 3.3V regulator.The enable pin on regulators is usually a normal enable rather than an inverted enable that you might encounter on other ICs.So connecting it to ground will keep the regulator shutdown permanently.- ive not looked to closely but the reset and voltage superviser stuff doesnt look right.You don't appear to have any ground going to the GND_1 pin of the esp32Also i doubt your reset button will glitch the power enough for the superviser to detect it and toggle EN for a reset.i would wire it to EN/RESET directly rather than trying to glitch the supervisor- Check CP2104 datasheet, ive never used the CP2104 but i'm pretty sure you need VBUS connected so the chip can detect when a usb cable is inserted.- You will get a louder piezo beep if you connect both the piezo pins to outputs on the ESP32 and switch them in opposition.ie, one output high when the other is low, then flip. If running from 3.3V this creates 3.3V deflection in one direction then 3.3V in the other so your using both directions for double the peak to peak deflection you would have got driving the piezo from 3.3V and GND.Note that you will want to check what two pins on the ESP32 can output a complementary timer signal.

author: Renate
author_rank: Super Contributor
timestamp: August 23, 2020, 01:22:31 pm
content: You've got Vbus and Vbatt shorted.

author: Linenoise
author_rank: Newbie
timestamp: August 23, 2020, 01:46:14 pm
content: Psi,I fixed the 3.3v regulator enable pin, thanks for that.Thanks so much for the feedback, the trick with the Pizeo is awesome, I have no idea how to determine if the pins are complementary.QuoteYeah this was a shot in the dark for me. 1. I assuming all of the grounds on the ESP32 are tied together infernally therefor GND_1 is grounded through GND_12, but I can easily be wrong on this. I will add a ground here just to be sure.I looked over the datasheet for the supervisor and was a little confused, I used case 2, which seems to remove the resistor all together. I included the sample circuit from the datasheet.QuoteYou were right on the VBUS I fixed that and a few other things I caught after looking again at the data sheet which I also included.QuoteThis is a great idea, I was thinking of adding a buck boost converter to get 3v3 up to 5v or higher to get the volume up since it was very low on the breadboard.I am not sure how to implement this in code though, is there a library that has this function or would I have to code this? I added a jumper to bypass the second IO just in case I cant get this to work the way you described.QuoteI am not sure how to check this in the datasheet, I am not sure how I would implement this in the code.Thanks again Psi, the few minutes you took to respond has saved me $$$ and hours of my time. I really appreciate it.

author: Linenoise
author_rank: Newbie
timestamp: August 23, 2020, 01:56:08 pm
content: QuoteQuote from: Renate on August 23, 2020, 01:22:31 pmOk I think this is what you were referring to.

author: Renate
author_rank: Super Contributor
timestamp: August 23, 2020, 04:37:33 pm
content: Quote from: Linenoise on August 23, 2020, 01:56:08 pmYes, but no.You have to break it between the MOSFET and the Schottky.

author: Linenoise
author_rank: Newbie
timestamp: August 24, 2020, 08:44:50 pm
content: OK I looked over the adafruit feather as a reference and reworked the schematic. The enable pin should go to vin on the LDO regulator. I had completely mucked up the battery switch circuit and USB to Serial.I think i'm in much better shape now, still not 100% sure on the voltage supervisor, or how to implement the piezo using 2 GPIO in the code. But I feel much better thanks to all the help.Here is my updated schematic as well as the adafruit feather that I used as a reference.

author: Bud
author_rank: Super Contributor
timestamp: August 24, 2020, 10:03:47 pm
content: You make excessive and unnecessary use of ports symbols, which is a typical rookie mistake. This makes schematics notoriously difficult to read. I mean you draw a part and instead of connecting its pins with wires to other parts you slap a port symbol on each pin with a net name. This is fine for say power nets but not for every other net on a schematic. I do not know why this style is very popular with the beginners, maybe it has to do with the software used. When i see such schematics i cringe every time especially when i need to use it, as my time will be wasted on searching for all the corresponding ports on the schematic instead of simply following the wires to connection point with other parts. I also immediately know the schematic was made by a beginner.Use port symbols if you have multi sheet schematic but do not overuse them on a same sheet.

author: Renate
author_rank: Super Contributor
timestamp: August 25, 2020, 12:53:28 pm
content: Quote from: Bud on August 24, 2020, 10:03:47 pmAt least make all those grounds on the MCU a single connection to a ground symbol!

author: Linenoise
author_rank: Newbie
timestamp: September 06, 2020, 11:15:35 am
content: Thanks for the feed back. In my case I also found it extremely difficult to read, but I did them because many of the tutorials and examples I used from adafruit, sparkfun, etc. seem to like to break out the circuit into functions and they detach each block into its own module. Maybe it makes it easy to reuse functions in other schematics, but I definitely agree.hell the reason I am having so much difficulty trying to follow the other schematics is the disjointed schmatics. Let me try to tame this.Thanks again everyone for the feedback it really helps a lot.Linenoise

author: Linenoise
author_rank: Newbie
timestamp: September 06, 2020, 01:11:39 pm
content: Ok, I cleaned up the drawing and removed the unused net-tags and connected up as many of the nets, but some of them would have to route across the entire schematic and it ended up looking worse then with the net tags. The net-tags should now be limited to micro controller GPIO ports and power bus.I would appreciate you taking another look at the schematic to see if there are circuit errors.ThanksLinenoise

author: Linenoise
author_rank: Newbie
timestamp: September 06, 2020, 01:21:13 pm
content: Psi,QuoteThis sounds (no pun intended) like a great idea. I tried to do some research on how to do this but I cant find anything. I implemented it in the schematic with a jumper to ground just in case I cant get it to work I can always use it in the traditional way. Where I get lost is how to do this in code. I'm using C/C++ I couldn't find any examples or even mention of this anywhere. Can you provide some sample code or links.Thanks.linenoise

author: Psi
author_rank: Super Contributor
timestamp: September 07, 2020, 01:21:49 am
content: Quote from: Linenoise on September 06, 2020, 01:21:13 pmSetup the hardware timer at the frequency you want to use and then use two of the compare channels on that timer.Set one of them to Clear output pinA on match, set output pinA on resetAnd set the other one to Set output pin B on match, Clear output pin B on resetThat way you get two outputs pins that toggle in Opposition to each other.I'm not sure of the exact timer terminology used on ESP32, but it will be something like above.Basically it's the same as you would do toggling one output pin, You just enable a 2nd channel and set that one up inverted.Note: Dont leave DC across the piezo when not in use, it may drain your battery. So when beeping is over disable the outputs or set them to the same state (high or low).

author: Renate
author_rank: Super Contributor
timestamp: September 07, 2020, 02:28:50 am
content: Quote from: Psi on September 07, 2020, 01:21:49 amReally? I used to put 200 V across them and they never took any current.You may ask why you'd put 200 V across a little piezo.Well, it wasn't a buzzer, but it was on that scale.You polarize them that way.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 07, 2020, 09:10:40 pm
content: I had a very brief look at the schematic.all those boxes around everything make it hard to distinguish between graphical lines and electrical connections (even though they have different color).Without the boxes the schematic is a lot more readable.It seems some kind of new fashion to draw boxes around circuit parts, but they have no good use at all.A bit of empty space between separate parts of a circuit is a much more logical way to show the separation.A thing that I do find useful though is to make the texts for the names of the different sections bigger, so they really stand out.

author: cmumford
author_rank: Contributor
timestamp: September 13, 2020, 03:35:16 am
content: I see on theCP2104 page:QuoteMy guess is that you're fine, but wanted to point that out.

author: Psi
author_rank: Super Contributor
timestamp: September 13, 2020, 04:49:33 am
content: Quote from: Renate on September 07, 2020, 02:28:50 amNormally they wont take any DC current.But it's pretty common for them to start conducting a little if they are subjected to a impact/shock.I think it's probably micro-cracks forming in the substrate. They still work fine in this state but will draw a little DC current.They can also spontaneously stop conducting. It can come and go intermittently.If you buy cheap piezos sometimes you will get brand new ones in this state.

author: cmumford
author_rank: Contributor
timestamp: September 14, 2020, 12:22:39 am
content: I noticed two things. Caveat: I've only ever designed one circuit (very simple and a long time ago), so please double-check my suggestions.The datasheet says, "Pins SCK/CLK, SDO/SD0, SDI/SD1, SHD/SD2, SWP/SD3 and SCS/CMD, namely, GPIO6 to GPIO11 are connected to the integrated SPI flash integrated on the module and are not recommended for other uses.". You are using ping 6 and 11, so might want to select two others instead.Unless I'm missing it, I don't see over-discharge protection for the 17MH battery. I don't know that chemistry, but will it kill the battery to let it run down all the way?

author: S. Petrukhin
author_rank: Super Contributor
timestamp: September 14, 2020, 12:31:09 am
content: S3 short VBUS (external power and USB power) to ground.And battary power directly connected to USB power, gate line of MOSFET to.

author: Linenoise
author_rank: Newbie
timestamp: September 26, 2020, 09:42:15 pm
content: Quote from: cmumford on September 14, 2020, 12:22:39 amThanks for the feedback but I couldn't find in the datasheet where Pin 6 and 11 are not recommended for GPIO funcitons. The pinouts from the datasheet don't show "Pins SCK/CLK, SDO/SD0, SDI/SD1, SHD/SD2, SWP/SD3 and SCS/CMD"Can you point me to the right section?