Author Topic: Need help with a schematic  (Read 4422 times)

0 Members and 7 Guests are viewing this topic.

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5139
  • Country: nl
Re: Need help with a schematic
« Reply #26 on: April 25, 2025, 07:11:49 pm »
The BMS is correct for the protection of the batteries, but I fear that the batteries are a bit of a scam. 18650 Lithium Ion batteries are at best something like 4000mAh. So if you can still cancel that one, I would. Look for cheaper ones that are 2400mAh or 3200mAh.

Even if your setup draws 0.5A it stays on for >4 hours without a power supply on the 2400mAh batteries.

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #27 on: April 26, 2025, 10:20:00 pm »
These say 9900mAh right on the battery.  It's okay anyway, I just checked them right out of the box, the voltage reads 4.0, 4.1, and 4.9.  I suppose this is to be expected until I can charge them.  They won't be pulling that much current anyway, just until the generator kicks on.  The only reason I need them is because I'm not good enough with my code (Arduino) to get the slave device to check the master for the condition of the reed switch (Garage Door open or closed). If these end up being a problem I can return them.  By the way, do these get hot?  After all, the master unit is getting mounted in the garage.  I've attached the new schematic even though it's still a mess to read.  I think you can import it into EasyEDA just to make life easier.  Sorry so messy.
« Last Edit: April 26, 2025, 10:23:29 pm by gkraniske »
 

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #28 on: April 26, 2025, 10:24:51 pm »
I suppose it would help if I actually attached the schematic lol.  :-DD
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5139
  • Country: nl
Re: Need help with a schematic
« Reply #29 on: April 27, 2025, 05:24:54 am »
These say 9900mAh right on the battery.  It's okay anyway, I just checked them right out of the box, the voltage reads 4.0, 4.1, and 4.9.  I suppose this is to be expected until I can charge them.  They won't be pulling that much current anyway, just until the generator kicks on.  The only reason I need them is because I'm not good enough with my code (Arduino) to get the slave device to check the master for the condition of the reed switch (Garage Door open or closed). If these end up being a problem I can return them.  By the way, do these get hot?  After all, the master unit is getting mounted in the garage.  I've attached the new schematic even though it's still a mess to read.  I think you can import it into EasyEDA just to make life easier.  Sorry so messy.

A lithium ion battery should not have a higher reading than 4.2V. The nominal voltage is 3.7V. See the attached datasheet for more information on this.

Lithium ion batteries can get hot when misused. To protect them a BMS comes into play. It will monitor separate cells and make sure they don't go above 4.2V or below ~2.7V. More advanced BMS can also monitor the temperature of the cells and cut the load when needed.

You still need a dedicated charger for the batteries, because the BMS does not regulate this part of the process.

Tomorrow, I will see if I have some time to look at your schematic.

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #30 on: April 28, 2025, 03:48:25 am »
Thanks!  :)
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5139
  • Country: nl
Re: Need help with a schematic
« Reply #31 on: April 28, 2025, 12:13:10 pm »
Ok, I looked at your schematic and redrawn it. There are still some issues that need to be addressed though.

The relays you used in the schematic are listed as 3V instead of 5V, so if these need to be used a separate 3V supply needs to be created. 12V relays would be better though.

What is the voltage of the wall wart you are using. I know you wrote 12V, but it could be a non stabilized supply that has a higher output voltage when not loaded, or a switched power supply.

Then there is the issue of the power switch. What does it need to control? Just the Arduino Nano system, or also the charging of the battery?

I fixed your RGB led setup. The anode needs to be connected to a positive supply, and current limiting resistors need to be separate per LED due to different forward voltages. It might be needed to trim these resistors to get a uniform brightness of the LED's. To turn the LED's on the digital outputs on the Arduino have to be set low.

I changed the ground symbol to be the more common one used in electronics. The one with the multiple lines is more used in electrical installations.

Based on the input voltage it might be needed to reduce the input voltage to the Arduino Nano, so for that a buck converter can be used if needed.

For the battery backup you did not put in a charging option, and connecting the output of a buck converter directly to the 12V input is not good practice. Diodes will be needed there.

I did not directly found a module for charging as series string of three lithium ion batteries, but it is needed depending on some conditions. If the input voltage is 12V a current limiting resistor could be sufficient, as long as the current into the battery does not exceed the allowed charge current. Once the voltage of the battery matches the input voltage the charging will stop.

But I'm no expert on lithium ion batteries and would like to hear from others if the above is true, or that it is better to look for a proper lithium ion charger board.

The PCB, I did not look into, as it has to be redrawn any way.

Offline WattsThat

  • Frequent Contributor
  • **
  • Posts: 818
  • Country: us
Re: Need help with a schematic
« Reply #32 on: April 28, 2025, 12:51:08 pm »
Why have Q3 at all? You can effect a reset without external hardware by executing the instruction

  asm volatile ("  jmp 0");
 
The following users thanked this post: gkraniske

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5139
  • Country: nl
Re: Need help with a schematic
« Reply #33 on: April 28, 2025, 12:54:44 pm »
Why have Q3 at all? You can effect a reset without external hardware by executing the instruction

  asm volatile ("  jmp 0");

True, but it was in the original schematic and I left it in without questioning.  :)

Noticed that I screwed up the component numbering of the transistors due to this one.  :palm:

Offline WattsThat

  • Frequent Contributor
  • **
  • Posts: 818
  • Country: us
Re: Need help with a schematic
« Reply #34 on: April 28, 2025, 01:10:42 pm »
Sorry for any confusion, it was a question for the OP, not you, whom I thank profusely for taking the time to redraw the schematic. I couldn’t follow the original so I hadn’t bothered to comment.

One big issue I see are the relay drivers, no way a 2N2222 can drive ~120ma (assuming 3v relays) with less than 2 ma of base current as beta doesn’t matter when a transistor is saturated. A rule of thumb is use a gain of 10 if the datasheet doesn’t provide info for switching use. Haven’t considered the power dissipation which should be checked as I suspect it’s too high for a to-92 device.

IMO, forget the transistor, a proper logic level mosfet would do much better here.
 
The following users thanked this post: gkraniske

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5139
  • Country: nl
Re: Need help with a schematic
« Reply #35 on: April 28, 2025, 02:41:49 pm »
Sorry for any confusion, it was a question for the OP, not you, whom I thank profusely for taking the time to redraw the schematic. I couldn’t follow the original so I hadn’t bothered to comment.

One big issue I see are the relay drivers, no way a 2N2222 can drive ~120ma (assuming 3v relays) with less than 2 ma of base current as beta doesn’t matter when a transistor is saturated. A rule of thumb is use a gain of 10 if the datasheet doesn’t provide info for switching use. Haven’t considered the power dissipation which should be checked as I suspect it’s too high for a to-92 device.

IMO, forget the transistor, a proper logic level mosfet would do much better here.

And that is what the result of a more proper schematic brings. Sound questions on it.

I have not looked at that bit either, and also doubt the use of those transistors. Seeing that everything else is done with modules, I would have done the same for the relays, as I wrote earlier.

The LED thing being the wrong way round was a thing I discovered when doing the redraw. Part numbering and naming were mixed up, so basically a bad attempt at creating a schematic. Hopefully the OP learns a lot from this exercise, for when he plans to continue playing with electronics.

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #36 on: April 28, 2025, 10:40:26 pm »
Wow!  Sure looks cleaner that the original.  All of you ROCK!  8)  Thanks for taking the time to do that.  The relays are 5VDC, not 3 VDC as the schematic shows.  Sorry about that.  My wife is already aggravated with me for spending so much money on all my projects, so I have to work with the parts I have.  So I have some questions, if it's okay.  Hopefully they haven't already been answered and I'm just not understanding, but here goes.

1.  How is the battery circuit integrated?  I see that the output / input has the BAT symbol on it, but I'm not sure how that works.
2.  What size / type of mosfet, and do I need one for each relay (I assume I do)?
3.  My wall wart outputs 12.6 volts steadily when checked with a multimeter, so is it appropriate to go from the wall wart directly into the buck converter to level it out a bit more?
4.  I was under the impression that I could tie the output of the other buck converter in with the 12v input from the wall wart.  If not, what's the best way to accomplish this?

And to answer questions:

The relays you used in the schematic are listed as 3V instead of 5V, so if these need to be used a separate 3V supply needs to be created. 12V relays would be better though.
I have an abundance of 5VDC relays, so if at all possible, I'd like to stick with these.

What is the voltage of the wall wart you are using. I know you wrote 12V, but it could be a non stabilized supply that has a higher output voltage when not loaded, or a switched power supply.
Steady at 12.6v according to a multimeter

Then there is the issue of the power switch. What does it need to control? Just the Arduino Nano system, or also the charging of the battery?
The power switch should turn everything other than the charging system on or off.  If I plug the wall wart in, the batteries should charge.  I purchased two boards to accomplish this, wasn't sure which one to use so I got them both.
https://www.amazon.com/dp/B0C6DNMKS7?ref=ppx_yo2ov_dt_b_fed_asin_title
https://www.amazon.com/dp/B08M36F6XD?ref=ppx_yo2ov_dt_b_fed_asin_title

And the batteries I purchased are as follows.
https://www.amazon.com/dp/B0CLY68D5L?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1

For the battery backup you did not put in a charging option, and connecting the output of a buck converter directly to the 12V input is not good practice. Diodes will be needed there.
I thought the charging option would come from the 12v wall wart.  What type of diodes should I use for this, and how should I make the connections?  During storms my power almost always goes out.  I have a 13Kw generator that kicks on automatically but there is lag time from mains to generator.  A little background on why I made this unit.  My garage is detached from the house and sits to the south of the main entrance way, which means that if I want to know if the garage door is open, I have to step outside and look.  So I came up with a device that uses a reed switch to detect the door being open or closed.  If the LED is red, the door is open, if green then it's closed.  The problem is when the unit loses power, it switches to red even though the door may be closed.  I have no way of knowing unless I either look outside at the door, or press the open / close button to trigger a change in the code.  You all probably didn't really need to know all that, but I wanted to explain it so you understood what I was doing.  Again, I just want to thank you all from the bottom of my heart for helping me, and yes, I'm learning a lot by your questions and examples.  Enough to know that I completely botched the schematic.  :-DD
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5139
  • Country: nl
Re: Need help with a schematic
« Reply #37 on: April 29, 2025, 06:29:56 am »
The cleaned up schematic is not yet finished, so the battery, the 12V input and the Vrelay for that matter, are not yet connected.

In a schematic one can use power supply symbols to connect the power. This is done with the T shaped symbol with a name above it. The name determines which net it is, and all the supply symbols with the same name are tied together.

For the mosfet it is needed to know the model and make of the used relays. There is the need to know the current that flows when the relay is activated.

The wall wart outputting a steady 12.6V is closer to the battery pack max voltage, but with a diode in series it will drop enough to not fully charge the batteries, which is better for them.

When there are multiple power sources you can't just connect them together without making sure it won't cause issues. In this case the highest voltage might win and start pushing current where it should not flow. Most buck converters don't like feedback through the output and can die due to this. So a diode in series mostly does the trick.

But in your case there is no need for the second buck converter. If I feel up to it later today, I will update the schematic to reflect the needed changes. As I have a wife too, and we have a new piece of land that needs to be worked on, I'm a bit occupied with that.

The boards you bought on Amazon are only for protecting the batteries, not for regulating the charge current/voltage. The 4S one is for a four in series battery pack and is not suited in this case. The 3S one is what you need.

For connecting the battery and the input supply to the buck converter the 1N4007 diodes are fine.

The issue with the door being open or closed depends a bit on where the reed switch is mounted if it can be used on power on to determine if the door is closed or not. Best position would be near the ground in such a way that when the door is closed the reed switch is activated.

Feedback of this information to the remote control might also be possible, but it depends on what you are using for the transmission. Probably best to address later.

Edit: I modified the schematic to show a possible supply setup. The charging of the batteries is not optimal, but I don't think it will be problematic. Worst case the batteries are drained to cutoff point of 2.7V per cell will lead to about 260mA through R4 and while charging the current will drop to zero when the batteries are charged to the same voltage as the supply. The BMS protects them from overcharging, but with a supply of 12.6V and the series diode this won't happen.

The Arduino Nano is supplied via two diodes making the voltage below 12V, which also should be fine. The buck converter is used to make the 5V for the relays. It could also be used for the other 5V in the circuit, but it depends on the current being drawn by the extra modules connected to this 5V from the Arduino Nano.

For the MOSFET's more input is needed to decide which ones could be used. So I left the transistors for now.
« Last Edit: April 29, 2025, 12:02:50 pm by pcprogrammer »
 

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #38 on: April 30, 2025, 12:16:33 am »
Hello again, and thanks so much for your help with my schematic.  Here are the relay's I'm using https://www.amazon.com/dp/B09J23B9WJ?ref_=ppx_hzsearch_conn_dt_b_fed_asin_title_2 I'm terribly sorry to take you away from your family.  I'll look at your design and most likely use it.  Again, thank you.  I'll let you know how it goes.  Until later, my friend.
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5139
  • Country: nl
Re: Need help with a schematic
« Reply #39 on: April 30, 2025, 05:56:07 am »
I'm terribly sorry to take you away from your family.

That is my own choice, so no worries.

The relays, according to the datasheet, have a nominal current of 71.4mA. The transistors can handle this and the 2k7 Ohm base resistor is fine for this. The only problem may be that the relay is getting a to low voltage due to Vce, but if it is higher than 0.3V you can lower the base resistor value to maybe 470 Ohm, but this increases the current drawn from the Arduino Nano.

Another option is to switch to the 2N7000, which is a n-channel mosfet. With these there is almost no current drawn from the Arduino Nano. The gate resistor can be lowered to 47 Ohm.

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #40 on: April 30, 2025, 12:15:25 pm »
The only change I made was to add 7v to the top relay so the fan turns on when it's supposed to.  Otherwise there is no power source for it.  I also noticed that the NANO looks like the VIN pin is being supplied with 12v.  Is that correct?  I was just wondering if you meant to take the power from the input of the buck converter rather that the output. 
« Last Edit: April 30, 2025, 12:18:23 pm by gkraniske »
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5139
  • Country: nl
Re: Need help with a schematic
« Reply #41 on: April 30, 2025, 03:29:39 pm »
The Arduino Nano can be supplied on Vin up to 12V. With the two diodes in series and an input voltage of 12.6V the voltage on Vin of the Arduino should be ~11.4V.

I forgot about the 7V for the fan, but what is the fan actual working voltage of the fan. If this is 12V you can use the voltage present on the input of the buck converter that makes the 5V.

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #42 on: April 30, 2025, 06:15:52 pm »
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5139
  • Country: nl
Re: Need help with a schematic
« Reply #43 on: April 30, 2025, 06:53:28 pm »
Then you best use the 5V output from the buck converter to run it.

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #44 on: May 11, 2025, 08:18:52 pm »
Hello again,

I'm back lol.  So I ordered the new boards and they came in about a week ago.  I built one of them up and it seems to work great, except for one thing, it doesn't charge the batteries.  I used your schematic with no modifications so I was just wondering if you had any ideas on what it might be.  Thanks again.  :)
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5139
  • Country: nl
Re: Need help with a schematic
« Reply #45 on: May 12, 2025, 06:31:07 am »
Did you measure the voltages. If the batteries are at the same level of the supply voltage they won't charge any higher, and that is a good thing.

Just for fun, show us some pictures of the finished board.

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #46 on: May 12, 2025, 02:08:30 pm »
Sure thing!  I just kind of put everything into place for the pictures.  I have a few bugs to work out before I put it all together.  Once completed I'll be sure to post a video of it in action.  Yeah I'm charging it with 12.6 volts and it doesn't appear to be charging at all.  It went all the way down to 11 volts.  So I cut a small slice in the insulation and charged it straight from the wall wart, and that charged it all the way up.  By the way, on the PCB, the footprint for the 18650 3S BMS is wrong and I can't seem to locate the correct one on EasyEDA's list of parts.  Does anyone have any ideas on how to resolve this?  I soldered jumper wires to it as a temporary fix, but in the completed project this won't work.  Also, the HC05 bluetooth module is going to be relocated to the top of the board.  I accidentally designed it wrong which is why I had to put it on the bottom of the board.
« Last Edit: May 12, 2025, 02:16:54 pm by gkraniske »
 

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #47 on: May 12, 2025, 02:09:57 pm »
Here are some more photos
« Last Edit: May 12, 2025, 02:13:30 pm by gkraniske »
 

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #48 on: May 12, 2025, 02:10:56 pm »
And some more  :box:
 

Offline gkraniskeTopic starter

  • Contributor
  • Posts: 32
  • Country: us
Re: Need help with a schematic
« Reply #49 on: May 12, 2025, 02:11:41 pm »
Almost to the last ones lol
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf