Magic smoke or not with this circuit? - MOSFETs - Page 1
Forum section: electronics / beginners

author: MathCa
author_rank: Contributor
timestamp: March 01, 2023, 03:08:31 pm
content: Do you know how to use MOSFETs? I saw too many sources and I'm now lost 🥴<- and why the image is not displayed here?!

author: inse
author_rank: Super Contributor
timestamp: March 01, 2023, 03:49:30 pm
content: What are you trying to achieve with the circuit?

author: MathCa
author_rank: Contributor
timestamp: March 01, 2023, 04:08:50 pm
content: @inse Most of the time it will be connected to AC and act like super fast charger, but sometimes I will bring it with me and continue to use it from the batteries. I could use physical switches or relays but I want everything to be done automatically without having to use a microcontroller. I'll add one after but just to get some stats.

author: Peabody
author_rank: Super Contributor
timestamp: March 01, 2023, 04:34:04 pm
content: I think your mosfets are wrong. The P-channel on the left will turn off whenever the power supply is connected. So the batteries can never be charged. The N-channel on the right will shut down when the power supply is not connected, so the batteries can never power the PD modules.You don't need any mosfet on the left because the BMS should terminate charging when the batteries are charged, and because you want the power supply to both charge the batteries and power the load at the same time. Normally, the maximum battery voltage would be lower than the power supply voltage. In that case the mosfet on the right would be a P-channel, oriented backwards so the body diode will prevent 23.7V from flowing back into the batteries. It will turn off when the power supply is present, and turn on when it's not, automatically.But that box with the BMS and batteries is a complete mystery. Will the 8 batteries be in series (33.6V) or what? What BMS and charger will you use? I think it would be easier to use just 5 batteries, or two stacks of four in series.

author: MathCa
author_rank: Contributor
timestamp: March 01, 2023, 05:23:36 pm
content: @Peabody thanks I will do a new schematic!Config: 4S2PCharger: Power supply + buck converter CV (16.8v) & CC (4A)BMS: QS-B305ABL-50A

author: MathCa
author_rank: Contributor
timestamp: March 01, 2023, 05:35:02 pm
content: Quote from: Peabody on March 01, 2023, 04:34:04 pmThis new schematic would be good? 🙏

author: inse
author_rank: Super Contributor
timestamp: March 01, 2023, 06:00:08 pm
content: No unfortunately it’s not good either.Why not simply a relay that is driven by the power supply and switches the output between battery and mains supply?Ain‘t that automatic enough?

author: MathCa
author_rank: Contributor
timestamp: March 01, 2023, 06:19:11 pm
content: Quote from: inse on March 01, 2023, 06:00:08 pmI really don't like mechanical relays... It would be much easier for me but I also prefer to learn to use MOSFETs. Do you know what I have to change in the last schematic? Thanks!

author: themadhippy
author_rank: Super Contributor
timestamp: March 01, 2023, 06:34:35 pm
content: 2 diodes maybe a simpler solution if all your after is switching to battery if the powers removed

author: inse
author_rank: Super Contributor
timestamp: March 01, 2023, 06:48:15 pm
content: Exactly!The issue with MOSFETs is that they conduct in both directions but you only can control one of them.And recheargable batteries are bidirectional as well.Using MOSFETs would require more circuitry.KISS - diodes or relay.

author: JustMeHere
author_rank: Frequent Contributor
timestamp: March 01, 2023, 06:50:16 pm
content: What stops you from incorrectly charging or overcharging your batteries?

author: MathCa
author_rank: Contributor
timestamp: March 01, 2023, 09:27:31 pm
content: I understand it's easier with relays and diodes, but where is the fun of learning more complex ways? 😊I want to use small projects like that to start to learn, so my priority is not simplicity.

author: MathCa
author_rank: Contributor
timestamp: March 01, 2023, 09:28:51 pm
content: Quote from: JustMeHere on March 01, 2023, 06:50:16 pmHopefully the BMS is taking care of that, I only had to limit de current and voltage on the buck converter.

author: MathCa
author_rank: Contributor
timestamp: March 01, 2023, 09:41:06 pm
content: And for the box, I think I'll use something from the army!Everything can pretty easily fit inside with screws under and at the back of the box. The power cord could be kept inside when not in use, and I could add more batteries later with standoffs on top of the firsts. It's also safer if something happen with the batteries, it's cheap and better than buying a new plastic box!There is a boost converter for 1 PD module that will need a higher voltage.

author: Peabody
author_rank: Super Contributor
timestamp: March 01, 2023, 09:54:25 pm
content: I think the new schematic is ok, except that R2 could be zero ohms.But that BMS is described on Aliexpress as a "protection board". That's not the same as a charger, and you can't use a buck converter as a charger. I don't know where you will find a charger for a 4S2P pack.Also, I have no experience using mosfets and schottky diodes at these current levels. I don't know what parts you would find that are suitable. The reverse leakage current of the diode would be important because it would run hot, and reverse leakage is related exponentially to temperature.I think this is going to be a very challenging design. It would be helpful if you could find something similar that's already been done.

author: MathCa
author_rank: Contributor
timestamp: March 02, 2023, 03:34:24 pm
content: Quote from: Peabody on March 01, 2023, 09:54:25 pmIt's too often hard to find good description in English on chinese websites 😅 It's very cultural I think for the "elite" (the happy collaborators), they would tell you to learn chinese if you want to read the real description. I travelled some years in Asia and the "regular" Chinese population is very different hopefully!The BMS did a good job at charging and balancing the pack I think, but I had to set the charging voltage and limit the current with the buck converter, so I guess both together are a good charger? I'm really a beginner, I think it was done well because I saw the current decreasing and the voltage change close to the end when lights on the BMS blinked to show the board was now balancing. And the charging stopped after and all cells were at the right voltage.But it's very possible that I miss something! If you think I need something more or have any advices, I'm very open! Thanks!!

author: Peabody
author_rank: Super Contributor
timestamp: March 02, 2023, 04:10:05 pm
content: Well if it works, it's hard to argue with success.Do you have a link to the buck converter?

author: MathCa
author_rank: Contributor
timestamp: March 02, 2023, 04:22:02 pm
content: Quote from: Peabody on March 02, 2023, 04:10:05 pmI tried this one:https://www.amazon.ca/dp/B09MKMGK3G. I needed less than 70W (16.8v 4A) so I guessed this cheap "300W" would be ok.

author: MathCa
author_rank: Contributor
timestamp: March 02, 2023, 04:52:21 pm
content: I think I got something good!?MOSFET: G65P06F (https://www.digikey.ca/en/products/detail/goford-semiconductor/G65P06F/16634147)Diodes: APT30S20BG (https://www.digikey.ca/en/products/detail/microchip-technology/APT30S20BG/1494540)I used this videohttps://youtu.be/GRd9uTwg7r4?t=606.

author: Peabody
author_rank: Super Contributor
timestamp: March 02, 2023, 06:54:48 pm
content: His circuit is different from yours. His schottky diode connects after the boost converter, while yours connects before it. The attachment shows his circuit modified to be like yours, and the orientation of the mosfet would need to be reversed. In his orientation, current could flow through the schottky diode, then through the mosfet body diode, back to the batteries, which you don't want.I don't know about the parts selection. Perhaps others have more experience with high-current circuits.

author: MathCa
author_rank: Contributor
timestamp: March 02, 2023, 09:18:47 pm
content: I made a mistake, I forgot the 4A limit from the buck converter...The diode between the buck and the BMS is very optional I guess. My goal with it is only to never send current from the batteries to the LED of the buck converter.The second is to block the batteries to drive the MOSFET.I added a voltage divider to reduce the voltage for the gate.I'm not sure to understand about the orientation of the MOSFET, drain and source should be inverted on my schematic? Thanks again!!

author: Peabody
author_rank: Super Contributor
timestamp: March 02, 2023, 10:08:46 pm
content: I believe the second schematic is the correct one. But I know nothing about your PD modules, and don't know if they are different from a normal load. Here's a PDF from Microchip that has the mosfet source terminal on the load side.http://ww1.microchip.com/downloads/en/AppNotes/01149c.pdfI don't know about the extra diode. You would have to test your buck converter to see if current will flow backward through it when it's not powered up.

author: MathCa
author_rank: Contributor
timestamp: March 02, 2023, 10:17:36 pm
content: Thank you very much!Quote from: Peabody on March 02, 2023, 10:08:46 pmAt least I know how to do that. I think, else I'll learn it!When it will work like I wanted, I will add a microcontroller (ESP32) to monitor things like temperature and voltage. Programming it should be the easiest part for me so I keep it for the end!

author: MathCa
author_rank: Contributor
timestamp: March 03, 2023, 11:16:46 pm
content: Quote from: Peabody on March 02, 2023, 04:10:05 pmI'm sure you were right! It worked but it was not the right way to do it, I think.From what I understand now, the BMS, during the charging process, is only there to add a last protection in case there's a problem with the charger.So the charger should have the same protections? I think I will make a new post for that, because I saw a lot of tutorials where they did like me, so it could be a very interesting subject not only for me.

author: Peabody
author_rank: Super Contributor
timestamp: March 03, 2023, 11:36:33 pm
content: From your description, it sounds like your BMS is actually a charger. I don't know if that's true for all of them.

author: MathWizard
author_rank: Super Contributor
timestamp: March 04, 2023, 09:29:05 am
content: What are these 4 USB chargers tied together ? Are they made to do that without blowing up ?

author: MathCa
author_rank: Contributor
timestamp: March 04, 2023, 03:25:21 pm
content: I think I finally understood last night 😅A charger and a BMS should have very similar functions, but with different limits. The charger should never be allowed to reach the limits of the BMS, and when a limit is reached, we would have to know it before the BMS stop working...So a BMS is, in a way, like a charger but with higher limits.Do you think I understood right?

author: MathCa
author_rank: Contributor
timestamp: March 04, 2023, 03:32:51 pm
content: @MathWizard lol they should be fine, I think?!All are sold as 100W, but those in blue are not really able to go over 65W, that's why I ordered another one that will be able to give 100W...

author: Peabody
author_rank: Super Contributor
timestamp: March 04, 2023, 05:22:26 pm
content: I think a charger is what controls the charging process. In the case of lithium batteries, it starts with a constant current phase, then switches over to a constant voltage stage, and then finally terminates charging. For multiple serial cells, there is the additional requirement to balance them. But I think "BMS" does not have a standardized definition. Some may be chargers, but not all. Here's link that illustrates that:https://electronics.stackexchange.com/questions/184962/how-to-charge-a-18650-battery-pack-with-bms

author: MathCa
author_rank: Contributor
timestamp: March 04, 2023, 06:07:05 pm
content: I think I found a solution to be safe. I can keep the power supply + buck converter with CC CV, but I will add a microcontroller (simple ATtiny85 first or more later if I want to display the numbers on a small screen and/or use Wi-Fi to get stats and easy control over the parameters) to open/close the path to the BMS when the limits of my choice are reached (so I will have to measure voltage + current with the microcontroller), but those limits have to be under those of the BMS. That way, I could control the charge without having to trigger any protection of the BMS and the BMS would always stay there as a protection in case my microcontroller turn crazy. A nice project to learn, I just have to understand the risks!Sorry for my English, I hope it's easy enough to understand 🤭

author: MathCa
author_rank: Contributor
timestamp: March 05, 2023, 06:28:42 pm
content: Now that I understand I need to control the charge without using the BMS (only there in case of a problem), I made a new diagram to add an Arduino board to mesure the current and voltage of the batteries, I removed the MOSFETs for now because it's easier to start with relays instead.The power supply would automatically activate the first relay to allow the charge while disconnecting the load (the power delivery modules) from the batteries. The load would then get powered by the power supply.Arduino would be able to measure the current going in and out and the voltage of the batteries to activate if needed the second relay to stop the charge or discharge before triggering a protection from the BMS.The buck converter is taking care of giving a stable 16.8v at a limit of 4A.So I would now need to add a balancing circuit and then I could replace the relays with MOSFETs to finally get what I wanted?!

author: Peabody
author_rank: Super Contributor
timestamp: March 05, 2023, 07:45:02 pm
content: I don't know. It's all above my pay grade.

author: MathCa
author_rank: Contributor
timestamp: March 05, 2023, 08:03:33 pm
content: I thought it would be easy, now I want to return to school to study electronics lol