24VAC to DC - Page 1
Forum section: electronics / beginners

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 19, 2020, 12:04:30 am
content: I'd like to build a controller board for automating some HVAC. Unfortunately, I'm not able to find quite a few different components of the "easy route".High level requirements:- Open-source support (esphome, tasmota, etc) (Sonoff comes close)- Powered by 24V AC- Using reliable components (writes off a few AliExpress)So, I think I'll build my own - a fun project no doubt! Low voltage and low loads (these are all control signals), but I'll need to design for reliability.I'd like to use a transformer to go from 24VAC to something a lower for efficiency, but mainly isolation from the power supply which is shared by other components. I'll use a linear regular afterwards, so the output voltage would be dependent on the headroom needed - probably not much with an LDO, so to hit 3v3DC, I could probably head to 4-5VAC, rectify and filter.I figured this would be an exercise in picking winding ratios on the transformer. But when I head to digikey's Power Transformer section, it's a bit more confusing then that. Mouser's search reveals a few more goodies (Wurth 750313441) but I'd rather know what I'm looking at first to pick something. Component cost is a bit of a factor as well.

author: james_s
author_rank: Super Contributor
timestamp: January 19, 2020, 12:22:03 am
content: Why do you need isolation?Years ago I built a controller to select between my heat pump and gas furnace depending on outdoor temperature. I used a buck regulator made from one of the SimpleSwitcher ICs, I think LM2567. It runs cool and has been working for something like 14 years now. Bridge rectifier, filter, buck regulator, it goes from the 24VAC transformer in the furnace to 5VDC. It's not isolated but that didn't matter for what I was doing.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 19, 2020, 12:25:01 am
content: I figure, worst case, I build something that fails. I'll do the best to make sure it doesn't, but in the event it does, probably best not to take out other things.I guess I could also just put a fuse inline as well to do as you suggest. But I'm wondering if an LM2567 would up the BOM costs or complexity significantly? I know I don't want to use those premade LM2567's, as I'm worried about reliability. Rather use genuine components.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 19, 2020, 01:09:09 am
content: Guessing you don't need three friggin' amperes to run things, a little SOT23-6 part should do, for example.Why isolate the input? Why not isolate the output? It's just a contact closure (relay or optoisolator), no?Tim

author: james_s
author_rank: Super Contributor
timestamp: January 19, 2020, 01:38:44 am
content: A genuine LM2567 costs a few dollars at most, these days you can get smaller parts but 14 years ago there were a lot fewer easy to use switching regulator ICs on the market and I think I got the part I used as a free sample. Since the existing equipment already uses 24V I'm not sure how you'd damage it, if I remember correctly, I used opto-isolators on the input from the thermostat, I don't recall exactly why I chose that approach but it has worked. BOM cost should be a non-issue unless you're mass producing something. Certainly a switching regulator is going to be much cheaper than a custom 60Hz power transformer.This is one of those cases though where if you're not certain you know what you're doing, you probably shouldn't be doing it. You don't want your heat to get stuck running for a week solid while you're out of town or something when something malfunctions.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 19, 2020, 03:52:07 am
content: Quote from: T3sl4co1l on January 19, 2020, 01:09:09 amYup a relay. Unsure on optoisolators yet driving the relays since it's signalling, no real load, hopefully no real noise.If I assume every other device on that circuit is designed well, then isolating input I can't affect it with my circuit. I'm switching those "good" devices with a relay. Need to read up on failure modes more, but for the time being the worst would be fan staying on.If something bad happens without input isolation, I could take down other devices, which worst case might mean blowing the fuse on my furnace, which means no more heat.I did find a Micrel lm2574 which is 40V->3v3 step down with 1 coil 1 diode and 2 caps. Pretty nice. I could just have a 1:1 isolation transformer if I can't figure that part out.

author: james_s
author_rank: Super Contributor
timestamp: January 19, 2020, 04:19:47 am
content: Quote from: blueskull on January 19, 2020, 02:53:23 amFor a single quantity from a retail supplier? I mean how poor do you have to be before a few bucks for a part you need for a hobby project is expensive? An FPGA or an ARM9 isn't much use if the part you need is a voltage regulator.Sure you can gamble on insanely cheap parts and modules direct from China, I've used them many times and a lot of that stuff is quite good but none of the LM2567 modules I've got have been genuine, they work ok but the operating frequency is wrong and they blow up if you try to draw the full rated current. If I'm building something critical that could burn the house down, cost me a fortune in wasted energy or damage expensive equipment if it fails, I'll splurge and buy a name brand part from Digikey, Mouser or other reputable supplier that is considerably less likely to send me a fake.

author: AVGresponding
author_rank: Super Contributor
timestamp: January 19, 2020, 10:05:12 am
content: Why not just make a simple linear reg using a power resistor on the input to limit the volts drop on the reg?That way if it somehow does fail sc, the current will be limited by the power resistor below damaging levels.I'd still fuse the input anyway, that's just good practice.

author: james_s
author_rank: Super Contributor
timestamp: January 19, 2020, 04:28:35 pm
content: That was what I tried first, but I was getting well over 30VDC after rectifying and filtering and the regulator got scorching hot. A resistor would move some of that heat to it but doesn't get around making the heat. Buck regulators are common and cheap now and this is a perfect place to use one.The LM2576 was only an example, it's the part I happened to use many years ago with success, one of the first easy to use monolithic buck regulators on the market. Also it comes in a big chunky novice/prototype friendly package. Lots of other parts out there now that are similarly easy to use.

author: AVGresponding
author_rank: Super Contributor
timestamp: January 19, 2020, 05:12:45 pm
content: If you're getting 30VDC you're clearly using full wave rectification. Try half wave, that should give you a more manageable 17VDC or so.

author: AVGresponding
author_rank: Super Contributor
timestamp: January 19, 2020, 05:34:12 pm
content: If you have a point to make, please do so. Try to do it without personal insults, please.

author: mariush
author_rank: Super Contributor
timestamp: January 19, 2020, 05:34:30 pm
content: You could combine a basic 10-20 cents LDO (to bring voltage down to 18v..24v) or a zener diode then use a switching regulator for 3.3vex ap63301 :https://www.digikey.com/product-detail/en/diodes-incorporated/AP63301WU-7/31-AP63301WU-7CT-ND/1049223832v max input , 0.8v min output, 500kHz switching, synchronous (no diode needed), small inductor... 50-60 cents and SOT-23-6 packagel78l24 is 17 cents if you buy 100 of them :https://www.digikey.com/product-detail/en/stmicroelectronics/L78L24CD-TR/497-7284-1-ND/1883403

author: james_s
author_rank: Super Contributor
timestamp: January 19, 2020, 05:43:24 pm
content: The nature of the question suggests a novice, so I was suggesting parts available in prototype friendly through-hole packages. If I were designing something like this today I would have no trouble using a tiny surface mount part but a beginner who is still in the development phase is probably going to want something they can easily wire up on perfboard.OP, if you can clarify whether this is a one-off hobby project, possibly mass produced, whether you intend to hack together a prototype or make a PCB that will reduce the irrelevant answers.Either way, full wave rectifier and switching regulator is absolutely the way to go. You can very efficiently drop 30+V down to 3.3 or 5V with a simple and cheap circuit. Pretty much every commercial product does it this way, no sensible design uses a linear regulator for such a large delta.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 19, 2020, 06:33:35 pm
content: I plan on making a PCB for this and using SMT when possible.It's a one off to start but I prefer to keep the BOM low (when possible) and have the option to produce/sell on Tindie if needed. All electronics sourced from DigiKey, wago blocks might be elsewhere since it's low current.Here's what I came up with so far with a few notes

author: james_s
author_rank: Super Contributor
timestamp: January 19, 2020, 08:05:40 pm
content: That looks good at a glance, although you should be able to eliminate one of the two capacitors between the rectifier and regulator. It's not hard to find low ESR electrolytics these days, or you could use something like a 1uF ceramic close to the regulator IC, refer to the datasheet to see if there are any specific requirements.The capacitor can be calculated like this:https://electronicbase.net/smoothing-capacitor-calculator/Admittedly I typically just choose a value based on intuition, likely ending up with a bit larger cap that is really required but that hasn't let me down yet. I'd probably slap in 330 or 470uF then scope it under load to see how much ripple there is and verify that the ripple isn't present on the output of the regulator.

author: mariush
author_rank: Super Contributor
timestamp: January 19, 2020, 08:11:11 pm
content: You have to go backwards, from the output voltage and current.Let's say you want maximum 3.3v at 500mA, for safety go +10%, to 550mA . That's 3.3v x 550mA = 1815 mWYou look in the datasheet and try to determine how efficient that regulator will be converting ~30v to 3.3v at that current amount, with the inductor you choose (again specified in datasheet).Let's say you determine the efficiency determined is 70% : that means 1815 mW were 70% of the total amount consumed by the regulator, so 100% is 100 * 1815 / 70 = 2592 mW ... let's round it up to 2600 mW.So if you assume your voltage will be between 24v and 30v... let's go with 24v, then your input current will be 2600 mW / 24 = 108.33 mA=> the switching regulator needs 24v+ 108mA+ to output 3.3v 500mA with around 70% efficiencyNow, the switching regulator may pulls energy in bursts or whatever, so let's say you design the input for at least 150 mAThis means the input capacitor must be sized so that the voltage will not go lower than your desired voltage.In your circuit you have a bridge rectifier rectifying 24v AC to DC ... so you'll get peak voltage of Vdc peak = sqrt(2) x Vac - 2 x Vdiode.For a generic bridge rectifier, you'd have Vdc peak = 1.414 x 24v - 2 x 0.8v = ~ 32vBecause you may have less than 110v / 230v on the mains, lowering the output on the secondary, assume a lower peak DC voltage, let's say your maximum will be 30v DC.0.8v is a fairly good value for the voltage drop on an internal diode at around 0.1-0.2A ... for around 1-2A, you may want to choose around 1vSo you can use a formula to approximate capacitance required : C (Farads) = Current / [ 2 x AC Frequency x (Vdc peak - Vdc min desired) ]Let's say you're in US where AC frequency is 60Hz and you want minimum 24v and at least 150mA (0.15) and your peak voltage is 30v, not 32v (for big margins)=> C = 0.15 A / ( 2 x 60 x (30-24)) = 0.15 / 120 x 6 = 0.00020833 Farads or around 208uF ... this means you could use next value up like 270uF or 330uF and you'll be safe.You can go with much bigger values but that only means the voltage will be closer to 30-32v for longer periods of time.Also, bigger capacities are not so good when you start the circuit cold... the empty capacitors act almost like a short sucking in energy, so for a short moment, there's very high current through the transformer, and that can cause the fuse to pop... that's why you often see time delay fuse before the transformer.Anyway... you have 3.3v up to 550mA , determined about 110mA at 24-30v on input of regulator but used 150mA to determine capacitor, so let's continue to use that.If you output 24v 150mA on the secondary, that's 3.6 watts (24x0.15).If your input is 110v, then the primary should take 3.6w / 110 = 0.0327 A or 32 mA ... so in theory, a 50mA fuse would be plenty. But it would probably make more sense to use a 100mA time delay fuse.You don't need 2 capacitors , if the switching regulator is close to that first capacitor. A single one is plenty.It may help to have a ceramic 0.1uF right by the input pins of the regulator.Also you may find cheaper to go with individual diodes for the bridge rectifier... you lose a bit of board space but not much.Cheapest rectifiers on Digikey are something like 19 cents if you buy 25+, while single diodes are much cheaper.But you can get much cheaper parts from lcsc.com or tme.eu or other distributors that do less known manufacturers.

author: janoc
author_rank: Super Contributor
timestamp: January 19, 2020, 08:29:29 pm
content: Quote from: ThickPhilM on January 19, 2020, 05:34:12 pmHave a look at a half-wave rectified sine wave and what is its peak voltage (because that's what the filtering cap gets charged to). Then you maybe will understand that "smoking" comment.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 19, 2020, 08:50:12 pm
content: Quote from: mariush on January 19, 2020, 08:11:11 pmThis is great! Thanks for walking through it.For the time-delay fuse, something like this?https://www.digikey.ca/product-detail/en/bel-fuse-inc/RST-100-BULK/507-1166-ND/809310

author: Yansi
author_rank: Super Contributor
timestamp: January 19, 2020, 08:55:58 pm
content: Quote from: ThickPhilM on January 19, 2020, 05:34:12 pmPoint is, that with half-wave rectification of 24V, you still get a the same 33V peak voltage.

author: AVGresponding
author_rank: Super Contributor
timestamp: January 19, 2020, 09:53:41 pm
content: With 0 capacitance, and 0 load, yes.Is that likely? No.

author: Yansi
author_rank: Super Contributor
timestamp: January 19, 2020, 09:57:07 pm
content: Does not depend on capacitance.halfwave or fullwave, peak voltage is the same. Regardless if there is some or none capacitance.

author: mariush
author_rank: Super Contributor
timestamp: January 19, 2020, 11:13:09 pm
content: Quote from: joeyjoejoe on January 19, 2020, 08:50:12 pmIf you want to be more user friendly, consider fuse holdersSee what sizes are most common and have the most different values in stock.For example* 5mm / 5.1mm / 5.2mm x 20mm and* 6.35mm x 22mm / 25 mm/25.4mm (0.25" x 0.875"..1" - same distance between 2 holders can be used for all three sizes, the holders are wide enough to accept 3mm of play)seem to be plentiful and easy to buy in local shops by someone.There's also 6.3 x 32mm (0.25" x 1.26") that's very common... and the 6.3x25 fits within the footprint of one of these ... so you can make footprints for 3 holders on circuit board but populate only 2, depending on which fuse you end up using.example of 5mm x 20mm fuse holder (2 of these needed per board) :https://www.digikey.ca/product-detail/en/bel-fuse-inc/FC-211-22/507-1415-ND/622587example of fuses~530 results: 5mm or 5.1mm (metal is flexible enough to accept either) :https://www.digikey.ca/products/en/circuit-protection/fuses/139?FV=46%7C13837%2C46%7C14314%2C-8%7C139&quantity=10&ColumnSort=2088&page=1&pageSize=25~3080 results (919 in stock) : 5.2mm x 20 mm fuses (should fit in 5mm fuse holders just fine) :https://www.digikey.ca/products/en/circuit-protection/fuses/139?k=&pkeyword=&sv=0&pv46=14397&sf=1&FV=-8%7C139&quantity=10&ColumnSort=2088&page=1&pageSize=256.3 / 6.35 mm fuse holder example:https://www.digikey.ca/product-detail/en/bel-fuse-inc/FC-102-22/507-1702-ND/6225856.3 x 22-25mm fuses:https://www.digikey.ca/short/z71rr8With bigger currents, you can make footprints on board for 6.3/6.35 x 22-25mm and an extra footprint for 6.3 x 32mm distance, so basically 3 holders but only solder 2 holders. If you happen to be "out of stock" of 6.3 x 25 you could solder holder on 6.3x32 footprint and use 6.3 x 32 fuse.The fuse you chose may work just fine and it has the benefit of being tight package (4.35mm x 8mm) but there's no visual indication if the fuse is blown (user may not have a multimeter) while with a glass fuse user may see the wire blown ... also, user may not buy that fuse on amazon or local store instead you may force him to buy it from you or digikey or other distributor and he may be forced to pay a few dollars in shipping.In contrast, 5x20mm fuses are easily available on amazon for example :https://www.amazon.com/s?k=fuse+5+x+20+mm&ref=nb_sb_noss_2The bigger footprint would also allow you to put a sticker (or print on pcb) with current and speed ex "0.1A T / Slow"(slow blow is time delay more or less)

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 19, 2020, 11:19:29 pm
content: Good points. I am so used to designing size-constrained boards - no need to for this one. Fuse holders can be something easily sourced from China as well if needed!

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 20, 2020, 02:48:13 am
content: Here's the relay driver I came up with.These are dual mosfets (3v3 logic, 200mA continous) so I can get two to drive four relays. Relays are ~50mA. The pulldown is so we have a defined state in case anything happens to the MCU.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: January 22, 2020, 11:04:30 pm
content: Presuming K1_EN is a 3.3v output from a uC, watch out: that MOSFET has a Vgs(th) of up to 3.1volts. The threshold means that's when it just starts to turn on. Note that Rds(ON) is specified only down to a Vgs of 4.5 volts (3.3 ohms). Check out the pg 3 top left graph with drain current vs Vgs. Pretty marginal at 50mA eh? Especially if it gets cold? And what exactly is the voltage on K1_EN when loaded down with a LED there anyway?I'm pretty sure you can get a better part for less money. Sorting by quantity in stock is a quick way of turning up the good ones.The 10K resistor is presumably a pull down to keep the MOSFET switched off while K1_EN is booting up? Maybe LED1 is enough depending on it's colour and the Vgs of the MOSFET you select.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 22, 2020, 11:41:43 pm
content: Quote from: Paul Moir on January 22, 2020, 11:04:30 pmDamn, good catch! Something like the DMN63D8LDW-7 might be better? (3rd cheapest too)The 10k is indeed a pulldown during bootup/etc. Good point that the LED might take care of it. I think I'll go chinese on the LED's - I could always leave the footprint in place and see if the pulldown needs populating or not.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: January 23, 2020, 04:13:49 pm
content: All old is new again:MuntzingAnd I'm sure Muntz got it from somewhere.DMN63D8LDW-7 looks much better. Much better specified too. And a quarter million in stock.

author: Zero999
author_rank: Super Contributor
timestamp: January 25, 2020, 05:22:10 pm
content: Quote from: joeyjoejoe on January 22, 2020, 11:41:43 pmWhy not swap the MOSFET for a BJT and suitable base resistor?

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 25, 2020, 05:30:22 pm
content: Parts count mostly. 4 less resistors, 4 less manual placements.

author: Zero999
author_rank: Super Contributor
timestamp: January 26, 2020, 01:51:53 pm
content: Quote from: joeyjoejoe on January 25, 2020, 05:30:22 pmHow did you draw that conclusion? A BJT would use exactly the same number of parts and small BJTs are normally cheaper, than MOSFETs.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 26, 2020, 03:00:28 pm
content: Would the transistors not need pulldowns?

author: mariush
author_rank: Super Contributor
timestamp: January 26, 2020, 03:48:08 pm
content: There are transistors with resistors built in, some even have diodes in the package.Here's an example (first Digikey result, not saying it's cheapest or best):https://www.digikey.com/product-detail/en/diodes-incorporated/DRDNB16W-7/DRDNB16WDITR-ND/816539

author: Zero999
author_rank: Super Contributor
timestamp: January 26, 2020, 04:53:03 pm
content: Quote from: joeyjoejoe on January 26, 2020, 03:00:28 pmNo, especially with the LED. It's certainly less important, than with a MOSFET.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 26, 2020, 05:52:16 pm
content: It would only shave a few cents off, but I do have two BC817's already for programming. And it means a bunch more questionsSorted by price and still active components, I haveCurrently,DMN63D8LDW- N-channel mosfet (45 cents)Options (sorted by price)MBT3904DW1T3G - dual NPN (31 cents)MUN5213DW1T1G- dual NPN, prebiased (33 cents)I need 50mA for the coil. Will the MUN5213DW1T1G save me a pull-down resistor?Resistors/diodes/led's are basically free, but the labor to place them isn't. I'd take fewer parts over a 10cent BOM increase anyday - the relays themselves from a legitimate supplier are just over 2$ a pop in small quantities, ESP32 5$ and coil for the switching regulator is 2$.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 26, 2020, 05:54:57 pm
content: This might be useful as well.

author: mariush
author_rank: Super Contributor
timestamp: January 26, 2020, 07:10:12 pm
content: Here's a suggestionYou could use a switching regulator that runs at higher frequency, allowing you to save money on the inductor and other components.See for example :https://www.digikey.com/product-detail/en/monolithic-power-systems-inc/MP2456GJ-Z/1589-1894-1-ND/5292060https://www.digikey.com/product-detail/en/monolithic-power-systems-inc/MP2459GJ-P/1589-1121-1-ND/5298208If the relays are so expensive, what's stopping you from using cheaper 5v relays? Change to a 5v switching regulator and you can add a 10-20 cent 5v to 3.3v LDO for your microcontroller, but you can save money on the relays. You have 4 relays... you'd save around 1-2$ on relays alone if you go with 5v relays.example of 5v relay:https://www.digikey.com/product-detail/en/kemet/EE2-5NU-L/399-11017-1-ND/4506469Also, if you need let's say more than 50, consider other stores that have better prices than Digikey.For example, TME.EU in Europe stocks some brands less known in US, here's an example:https://www.tme.eu/ro/en/details/rs-5-l/miniature-electromagnetic-relays/rayex-electronics/But pay attention at the secondary, the AC and DC current rating... for ex. the one above is only rated for 1A and 120Vac or 24v DC.If you have multiple relays, you could use transistor relays like ULN2003A (7 transistors with resistors built in) :https://www.digikey.com/products/en/discrete-semiconductor-products/transistors-bipolar-bjt-arrays/277?FV=-8%7C277&quantity=0&ColumnSort=1000011&page=1&k=uln2003a&pageSize=25

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 26, 2020, 08:12:22 pm
content: I'll check out those regulators, hopefully they are simple and the part count is low.That 5v relay costs more then the 3v one I am using.https://www.digikey.ca/products/en?keywords=ec2-3nu

author: Zero999
author_rank: Super Contributor
timestamp: January 26, 2020, 08:15:30 pm
content: Quote from: joeyjoejoe on January 26, 2020, 05:52:16 pmThe dual BJTs seem sensible, but a base resistor of 47k is too high, so it won't saturate. You need around 1k, as per my schematic and there is no need for pull-down resistors, because the BJT will turn off, if there's no base current, so if the MCU's I/O ports are set to inputs, the BJTs will be off.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 26, 2020, 09:18:41 pm
content: I need to brush up on transistors/current, but I did find MUN5230DW1T1G with a 1k base resistor and 1k base-emitter.

author: thinkfat
author_rank: Unknown
timestamp: January 26, 2020, 10:45:03 pm
content: Quote from: blueskull on January 19, 2020, 06:18:01 amThe LM2676 is actually not half bad a choice. It is a step up from the LM2596, switching at 250khz instead of 150khz, works reasonably well with a 33µH coil which you can get in a 10mm square package. Of course it is not a synchronous buck converter and the diode you need is also relatively big, but it should be possible to cram it all into a 15mm by 30mm area.

author: Zero999
author_rank: Super Contributor
timestamp: January 26, 2020, 11:20:58 pm
content: Quote from: joeyjoejoe on January 26, 2020, 09:18:41 pmThat's more sensible. You need sufficient current to saturate the BJT.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 27, 2020, 02:37:17 am
content: So on the power side, I've found a more suitable component perhaps.Power section with reference from TI Power Designer.My question is on my inductor ( NRS4018T150MDGJ ) selection. It matches the impedance and inductance. On digikey, it lists the inductance frequency test at 100kHz. Does this mean it's not suitable for a 1.1MHz switching supply?Other options -SDEM25201B-150MS, 768mOhm @ 1MhzLQH3NPN150MMEL, 350mOhm @ 1MHz(Since this is powered from a 24VAC transformer off mains, I don't care too much about efficiency.)

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 27, 2020, 02:41:54 am
content: Test frequency is just what it's tested at. They tested at 100kHz and found 15uH +/- whatever, and Q = whatever.Doesn't mean anything about other frequencies.Self resonant frequency is more relevant, but switching at SRF isn't a problem in itself, as that's the frequency where the inductor's impedance is maximal (parallel resonance). It's the best filter it can be, eh? Not for harmonics, however, and there's usually a second resonance somewhat above SRF which is series resonant (low impedance) which makes some harmonics much worse. So you typically want SRF more than, say, 5 or 10 times Fsw. Which is probably fine here.Tim

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 27, 2020, 02:55:46 am
content: Thanks! Indeed, I notice on their sheet a bit further down the inductance is fine into the MHz.

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 27, 2020, 11:26:57 pm
content: Quote from: Zero999 on January 26, 2020, 11:20:58 pmI'm trying to learn how to figure out base resistor selection. Usinghttps://www.petervis.com/GCSE_Design_and_Technology_Electronic_Products/transistor_base_resistor_calculator/transistor_base_resistor_calculator.html, and populating an hFE of 3, 50mA load and 3.3Vcc/Vi, it spits out 200ohm.So don't I need to find a BJT with a higher hFE?Second, can I put an LED in series with the base resistor to light the LED when turned on as well as switch the relay? Would this be risky if I don't know the voltage drop of the LED (going the chinese route for LEDs), or there a good chance it falls in a standard range, and if there's enough overhead after the voltage drop we're good?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 28, 2020, 12:50:42 am
content: LED in series -- not recommended, even a red LED is 1.5-2V drop. Not much left for the 0.7V Vbe out of a 3.3V supply.China can't really screw up the voltage, but they might deliver parts that are fully shorted or open (a dark emitting diode).hFE(sat) is typically chosen as 20, where'd 3 come from?Or if you mean minimum required is 3 (but, based on what, I don't know?), then yes, and you can expect to find much better in real parts out there.So much better in fact that you can use a higher value for the resistor calculation.Quote from: Zero999 on January 26, 2020, 08:15:30 pmFYI, better to have them: faster turn-off, lower leakage, more noise immunity.BJTs aren't controlled by current so much as voltage, or charge; it just so happens the base is...rather leaky, in a rather predictable way in fact, so we can drive it as a current amplifier in certain situations. This does happen to be one of those situations, but that's no excuse to fully ignore the transistor's nature.Tim

author: joeyjoejoe
author_rank: Frequent Contributor
timestamp: January 28, 2020, 12:55:18 am
content: MUN5230DW1T1G says the hFE min is 3.https://www.onsemi.com/pub/Collateral/DTC113ED-D.PDF

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 28, 2020, 01:07:08 am
content: Yes, measured hFE will be very low at low currents and linear operation. Note Vce = 10V, so Vin has been controlled (to about 1.5V as it happens) to set Ic as specified. This doesn't affect the hFE of the transistor itself.Pretty sure I've seen prebiased transistors before, that are rated as the bare transistor (so, hFE ~ 200 at whatever currents). Which is actually more strange than this, as the resistors are monolithic (right on the transistor die itself), there's not really any way to measure that parameter apart from the resistors.Tim

author: Zero999
author_rank: Super Contributor
timestamp: January 28, 2020, 09:00:11 am
content: Quote from: T3sl4co1l on January 28, 2020, 12:50:42 amYes, base-emitter resistors are often a good idea, but I think they're superfluous in this application. The BJT is switches a relay and its base is driven from a CMOS output which is push-pull, so when it's low, the base will be pulled to the emitter anyway. The only time it could help is if the output goes into a high impedance state, but that's something outside of normal operation, it shouldn't last long and the leakage current will be tiny.Quote from: joeyjoejoe on January 28, 2020, 12:55:18 amYes, that does look low, but I think it will be fine at 50mA. Figure 6 shows IC= 50mA, when the input voltage is 3V and output voltage 0.2V.You might be better with a 10k base-emitter resistor, which will rob less base current from the BJT.https://assets.nexperia.com/documents/data-sheet/PIMC31.pdfhttps://au.mouser.com/datasheet/2/348/dtc113zebtl-e-1664170.pdf