Author Topic: Peer Review for my first circuit  (Read 3613 times)

0 Members and 1 Guest are viewing this topic.

Offline LinenoiseTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Peer Review for my first circuit
« on: August 23, 2020, 01:24:53 am »
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 concern
1. 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_F1AN https://www.mouser.com/ProductDetail/Panasonic-Battery/ML-1220-F1AN?qs=%2Fha2pyFaduh6kcAmafAGdBP1Ww2yTLc0LbBk5LtPZJP9N0Kno5bnbA%3D%3D] [url]https://www.mouser.com/ProductDetail/Panasonic-Battery/ML-1220-F1AN?qs=%2Fha2pyFaduh6kcAmafAGdBP1Ww2yTLc0LbBk5LtPZJP9N0Kno5bnbA%3D%3D[/url]
ESP32 ESP32-WROOM-32D_M113DH2800PH3Q https://www.mouser.com/ProductDetail/Espressif-Systems/ESP32-WROOM-32DM113DH2800PH3Q0?qs=%2Fha2pyFadugKGKyA%252BZerg77Y77SFhqN4eEeMgYdepSrW4hBJ%2F7RzvPWjKRD%2FL5PA2BBEGc45i7I%3D] [url]https://www.mouser.com/ProductDetail/Espressif-Systems/ESP32-WROOM-32DM113DH2800PH3Q0?qs=%2Fha2pyFadugKGKyA%252BZerg77Y77SFhqN4eEeMgYdepSrW4hBJ%2F7RzvPWjKRD%2FL5PA2BBEGc45i7I%3D    [/url]
Voltage Supervisor  BD48K33G-TL  https://www.mouser.com/ProductDetail/ROHM-Semiconductor/BD48K33G-TL?qs=%2Fha2pyFadui9DP%2FRZ594qX5nlUrkJ%252BwgGZmOgX4K9ObnYSWPiAyvsg%3D%3D] [url]https://www.mouser.com/ProductDetail/ROHM-Semiconductor/BD48K33G-TL?qs=%2Fha2pyFadui9DP%2FRZ594qX5nlUrkJ%252BwgGZmOgX4K9ObnYSWPiAyvsg%3D%3D   [/url]
USB to Serial Converter  CP2104-F03-GM https://www.mouser.com/ProductDetail/Silicon-Labs/CP2104-F03-GM?qs=j12q4iUN960zrcKDk%2FjKbw%3D%3D] [url]https://www.mouser.com/ProductDetail/Silicon-Labs/CP2104-F03-GM?qs=j12q4iUN960zrcKDk%2FjKbw%3D%3D   [/url]
LIPO Charger  MCP73831  https://ms.componentsearchengine.com/part.php?partID=159526] [url]https://ms.componentsearchengine.com/part.php?partID=159526 [/url]

Here is the schamatic.  Thanks for the help everyone.

Linenoise
 

Offline LinenoiseTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Re: Peer Review for my first circuit
« Reply #1 on: August 23, 2020, 12:00:44 pm »
Just adding a schematic thumbnail for convenience.

Linenoise

 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 12646
  • Country: nz
Re: Peer Review for my first circuit
« Reply #2 on: August 23, 2020, 12:08:22 pm »
- 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 esp32
Also 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.
« Last Edit: August 23, 2020, 12:47:09 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 
The following users thanked this post: Linenoise

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1751
  • Country: de
    • Renate's Android Page
Re: Peer Review for my first circuit
« Reply #3 on: August 23, 2020, 01:22:31 pm »
You've got Vbus and Vbatt shorted.
 
The following users thanked this post: Linenoise

Offline LinenoiseTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Re: Peer Review for my first circuit
« Reply #4 on: August 23, 2020, 01:46:14 pm »
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.

Quote
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 esp32
Also i doubt your reset button will glitch the power enough for the superviser to detect it and toggle EN for a reset.
10k is a tiny load, 10R maybe

Yeah 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. 
Quote
- 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 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.

Quote
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.

This 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. 

Quote
Note that you will want to check what two pins on the ESP32 can output a complementary timer signal.
I 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.




 

Offline LinenoiseTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Re: Peer Review for my first circuit
« Reply #5 on: August 23, 2020, 01:56:08 pm »
Quote
You've got Vbus and Vbatt shorted.

Ok I think this is what you were referring to.



 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1751
  • Country: de
    • Renate's Android Page
Re: Peer Review for my first circuit
« Reply #6 on: August 23, 2020, 04:37:33 pm »
Ok I think this is what you were referring to.
Yes, but no.
You have to break it between the MOSFET and the Schottky.
 
The following users thanked this post: Linenoise

Offline LinenoiseTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Re: Peer Review for my first circuit
« Reply #7 on: August 24, 2020, 08:44:50 pm »
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.
 

Online Bud

  • Super Contributor
  • ***
  • Posts: 7937
  • Country: ca
Re: Peer Review for my first circuit
« Reply #8 on: August 24, 2020, 10:03:47 pm »
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.
Facebook-free life and Rigol-free shack.
 
The following users thanked this post: janoc, Linenoise

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1751
  • Country: de
    • Renate's Android Page
Re: Peer Review for my first circuit
« Reply #9 on: August 25, 2020, 12:53:28 pm »
Use port symbols if you have multi sheet schematic but do not overuse them on a same sheet.
At least make all those grounds on the MCU a single connection to a ground symbol!
 
The following users thanked this post: Linenoise

Offline LinenoiseTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Re: Peer Review for my first circuit
« Reply #10 on: September 06, 2020, 11:15:35 am »
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
 

Offline LinenoiseTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Re: Peer Review for my first circuit
« Reply #11 on: September 06, 2020, 01:11:39 pm »
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.

Thanks

Linenoise
 

Offline LinenoiseTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Re: Peer Review for my first circuit
« Reply #12 on: September 06, 2020, 01:21:13 pm »
Psi,

Quote
- 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.

This 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
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 12646
  • Country: nz
Re: Peer Review for my first circuit
« Reply #13 on: September 07, 2020, 01:21:49 am »
Psi,

Quote
- 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.

This 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

Setup 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 reset
And set the other one to Set output pin B on match, Clear output pin B on reset

That 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).
« Last Edit: September 07, 2020, 01:24:13 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1751
  • Country: de
    • Renate's Android Page
Re: Peer Review for my first circuit
« Reply #14 on: September 07, 2020, 02:28:50 am »
Dont leave DC across the piezo when not in use, it may drain your battery.
Really? 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.
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 5367
  • Country: nl
Re: Peer Review for my first circuit
« Reply #15 on: September 07, 2020, 09:10:40 pm »
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.
 

Offline cmumford

  • Contributor
  • Posts: 48
  • Country: us
Re: Peer Review for my first circuit
« Reply #16 on: September 13, 2020, 03:35:16 am »
I see on the CP2104 page:

Quote
Not Recommended for New Designs: This part is Not Recommended for New Designs (NRND). For newer designs, we recommend you use: CP2102N-GQFN20

My guess is that you're fine, but wanted to point that out.
 
The following users thanked this post: Linenoise

Offline Psi

  • Super Contributor
  • ***
  • Posts: 12646
  • Country: nz
Re: Peer Review for my first circuit
« Reply #17 on: September 13, 2020, 04:49:33 am »
Dont leave DC across the piezo when not in use, it may drain your battery.
Really? 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.

Normally 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.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline cmumford

  • Contributor
  • Posts: 48
  • Country: us
Re: Peer Review for my first circuit
« Reply #18 on: September 14, 2020, 12:22:39 am »
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?
 
The following users thanked this post: Linenoise

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1277
  • Country: ru
Re: Peer Review for my first circuit
« Reply #19 on: September 14, 2020, 12:31:09 am »
S3 short VBUS (external power and USB power) to ground.
And battary power directly connected to USB power, gate line of MOSFET to.
« Last Edit: September 14, 2020, 12:37:08 am by S. Petrukhin »
And sorry for my English.
 
The following users thanked this post: Linenoise

Offline LinenoiseTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Re: Peer Review for my first circuit
« Reply #20 on: September 26, 2020, 09:42:15 pm »
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?


Thanks 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?

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->