• 0 Posts
  • 30 Comments
Joined 2 years ago
cake
Cake day: July 2nd, 2023

help-circle
  • Based solely on this drawing – since I don’t have a datasheet for the PWM controller depicted – it looks like the potentiometer is there to provide a DC bias for the input Aux signal. I draw that conclusion based on the fact that the potentiometer has its extents connected to Vref and GND, meaning that turning the wiper would be selecting a voltage somewhere in-between those two voltage levels.

    As for how this controls the duty cycle of the PWM, it would depend on the operating theory of the PWM controller. I can’t quite imagine how the controller might produce a PWM output, but I can imagine a PDM output, which tends to be sufficient for approximating coarse audio.

    But the DC bias may also be necessary since the Aux signal might otherwise try to go below GND voltage. The DC bias would raise the Aux signal so that even its lowest valley would remain above GND.

    So I think that’s two reasons for why the potentiometer cannot be removed: 1) the DC bias is needed for the frequency control, and 2) to prevent the Aux signal from sinking below GND.

    If you did want to replace the potentiometer with something else, you could find a pair of fixed resistors that would still provide the DC bias. I don’t think you could directly connect the Aux directly into the controller.


  • are not audio drivers but PWM drivers

    They can be both! A Class D audio amplifier can be constructed by rendering an audio signal into a PWM or PDM output signal, then passed through an RC filter to remove the switching noise, yielding only the intended audio.

    That said, in this case, using the unfiltered PWM output would work for greeting cards, where audio fidelity is not exactly a high priority, but minimal parts count is.

    This made me wonder if normal PWM controllers could be used to drive more power full LEDs.

    What exactly did you have in mind as a “normal PWM controller”? There’s a great variety of drivers that produce a PWM signal, some in the single watt category and some in the tens of kilowatts.

    Whether they can drive “more powerful” LEDs is predominantly a function of the voltage and current requirements to fully illuminate the LEDs, plus what switching frequency range the LEDs can tolerate. Some LED modules that have built-in capacitors cannot be driven effectively using PWM, as well as anything which accepts AC rather than DC power. You’d need a triac to dim AC LED modules, and yet still, some designs simply won’t dim properly.

    My idea was to just remove the potentiometer and feed in music from Aux at that point.

    You’ll have to provide a schematic, as I’m not entirely sure where this potentiometer is. But be aware that the output current needed to drive a small speaker is probably insufficient to light up a sizable LED, nevermind the possibility of not even having enough voltage to meet the required forward voltage drop of the LED.

    Is there a chance of this working?

    It might, but only if everything just happens to line up. But otherwise, it’s likely that it won’t work as-is, due to insufficient drive current.



  • (sorry for the long delay)

    From your description, I’m wondering if the internal pull-up from the bike computer might actually be an active output, and that the open-drain buffer is causing the bike computer to give up sourcing that pull-up voltage. That is to say, if a larger-than-expected current is drawn from the bike computer, it might trigger a protection mechanism to avoid damage to its output circuitry.

    To that end, I would imagine that either: 1) an inline resistor to limit drain current, 2) a push-pull buffer, or 3) both, would help rectify the issue.

    My suspicion is based purely on the fact that getting stuck low for an open-drain device could be an issue “upstream”. If it were stuck high, I wouldn’t normally suspect this path.

    If you still have the original configuration, measurement of the drain current would be valuable info, as well as the current when the buffer is omitted (when the motor and bike computer are directly attached, a la factory configuration). That would indicate if perhaps the currents are too mismatched.






  • The datasheet for the IRF1404Z does indeed show that the TO-220 package variant has a limit of 120 A continuous at 25 C. It should be noted that the junction temperature is rated for up to 175 C, which might provide a lot of headroom for, but we’ll see.

    The minimum dimensions for the drain and source leads are 0.36 mm by 1.14 mm. This gives us some 0.41 mm^2 cross sectional area. Assuming the leads are made of aluminum – I’m on mobile and can’t quickly check the composition for the generic TO-220 package – which has a resistance of about 60 Ohm per km, and with the lead being a maximum length of 14.73 mm, the resistance of either lead will be some 0.88 mOhm.

    At 120 Amps, the resistance heating would be about 12.6 Watts. That’s quite hot for a short lead, and there’s two of them. But the kicker is that these aluminum leads are also thermally conductive, either into the package towards the junction, or away and into a generous PCB layer or to suitably-sized copper wires.

    Either way, that will sink a fair amount of heat, although the thermal resistance for the package legs is not given in this datasheet. It may be defined for generic TO-220 packages though.

    As a practical matter, to operate a MOSFET ar 120 A would likely require active cooling, and their test jig plus all reasonable implementations will have a fan. Moderate airflow over the leads will also wick temperature away, which might bring the leads down to a “hot but not fire-inducing” levels. But an EE or thermal engineer would need to sit down to do that simulation.

    It’s worth keeping in mind that metals can get quite hot and still maintain their structure, although the NEC (electrical code in the USA) ampacity charts would suggest that 14 AWG (~2.5 mm^2) is only good for 15 A. Building wiring is a different beast, and those charts are written by fire engineers, whose job is to avoid the preconditions for house fires. Hence, extremely conservative for temperature rise. Whereas electronics in a metal box with active airflow can take substantial liberties with metal’s current carrying ability.


  • To start, it might be worth reviewing the recommended antenna traces for wireless ICs, since vendors often provide precomputed and validated reference designs in their data sheets. These are often what are made into breakout boards, and there’s a lot which can be learned by what these reference designs take into consideration.

    I’ve not specifically done PCB designs with antennas, but I have done my own designs for high-speed differential signals, where the impedance of two traces have to be consistent along their length, whether side-by-side or on opposite sides of the PCB. As you observed, KiCAD can do a lot of this computation but good antenna design means even the pads that attach to the IC also need to be impedance-matched. And that requires both an understanding of where problems arise (eg when traces turn a corner), how to compute the effects (using KiCAD’s features), and whether the issue might not even make a big difference in overall performance.


  • I had the bright idea

    Haha, I enjoyed that. Although you’re pursuing using parts from a flashlight, I wish to point out that LEDs are now fairly straightforward to put together into a full lighting solution. Generally, it would be an LED module, an optic, and the driver circuit. Maybe a heatsink too. Ok, maybe this is somewhat complicated lol

    I’m not affiliated with that supplier, but I’ve bought from them before to build a custom headlight for a bicycle.


  • My assumption with this PCB is that it switches the GND, meaning 12v is always provided to the LEDs. So the trick is to find somewhere that has a permanent GND and then connect all the LED leads to that. But I don’t see a large enough spot to land three new leads, except maybe where R6 is.

    You’ll have to verify if my assumption is accurate, although I do wonder if you could just get a different PSU outright. This sounds like a 12v LED strip, so any sufficiently sized 12v wall-wart would also suffice.

    Can you also clarify: you want this strip to be always-on and all-white, but the strip uses RGB LEDs? While it does produce white, it might not have a very high CRI and thus may be unpleasant for certain lighting applications. There are dedicated white LED strips which will perform a bit better for color rendition, and that could potentially be an issue if food needs to look appetizing under these cabinets.


  • commercial appliances didn’t take any stand-by measures to avoid “keeping the wires warm”

    Generally speaking, the amount of standby current attributable to the capacitors has historically paled in comparison to the much higher standby current of the active electronics therein. The One Watt Initiative is one such program that shed light on “vampire draw” and posed a tangible target for what standby power draw for an appliance should look like: 1 Watt.

    A rather infamous example of profligate standby power was TV set-top boxes, rented from the satellite or cable TV company, at some 35 Watts. Because these weren’t owned by customers, so-called free-market principles couldn’t apply and consumers couldn’t “vote with their feet” for less power-hungry set-top boxes. And the satellite/cable TV companies didn’t care, since they weren’t the ones paying for the electricity to keep those boxes powered. Hence, a perverse scenario where power was being actively wasted.

    It took both carrots (eg EnergyStar labels) and sticks (eg EU and California legislation) to make changes to this sordid situation. But to answer your question in the modern day, where standby current mostly is now kept around 1 Watt or lower, it all boils down to design tradeoffs.

    For most consumer products, a physical power-switch has gone the way of the dodo. The demand is for products which can turn “off” but can start up again at a moment’s notice. Excellent electronics design could achieve low-power consumption in the milliwatts, but this often entails an entirely separate circuit and supply which is used to wake up the main circuit of the appliance. That’s extra parts and thus more that can go wrong and cause warranty claims. This is really only pursued if power consumption is paramount, such as for battery-powered devices. And even with all that effort, the power draw will never be zero.

    So instead, the more common approach is to reuse the existing supply and circuitry, but try to optimize it when not in active operation. That means accepting that the power supply circuitry will have some amount of always-on draw, and that the total appliance will have a standby power draw which is deemed acceptable.

    I would also be remiss if I didn’t mention the EU Directives since 2013 which mandate particular power-factor targets, which for most non-motor appliances can only be achieved with active components, ie Active Power Factor Correction (Active PFC). While not strictly addressing standby power, this would be an example of a measure undertaken to avoid the heating caused by apparent power, both locally and through the grid.


  • How were you measuring the current in the power cable? Is this with a Kill-o-watt device or perhaps with a clamp meter and a line splitter?

    As for why there is a capacitor across the mains input, a switching DC power supply like an ATX PSU draws current in a fairly jagged fashion. So to stabilize the input voltage, as well as preventing the switching noise from propagating through the mains and radiating everywhere, some capacitors are placed across the AC lines. This is a large oversimplification, though, as the type and values of these capacitors are the subject of careful design.

    Since a capacitor charges and discharges based on the voltage across it, and because AC power changes voltage “polarity” at 50 or 60 Hz, the flow of charge into and out of the capacitor will be measurable as a small current.

    Your choice of measuring instrument will affect how precisely you can measure this apparent power, which will in-turn affect how your instrument reports the power factor. It can also be that the current in question also includes some of the standby current for keeping the PSU’s logic ICs in a ready state, for when the computer starts up. So that would also explain why the power factor isn’t exactly zero.




  • This isn’t quite an ELI5, but ARRL has a 2004 article on FM fundamentals; it’s five pages intended for a beginner ham radio operator, but applicable to all FM applications nevertheless. It also discusses four different ways to receive FM.

    But to answer your question directly:

    The frequency of the FM signal at any instant in time is called the instantaneous frequency. The variations back and forth around the carrier frequency are known as deviation

    FM can also be detected by a PLL. As shown in Figure 6, the PLL’s natural function of tracking a changing input frequency can be employed to generate a voltage that varies as the input frequency change

    In a nutshell, FM only ever has one instantaneous frequency at a time, which dances around the nominal center frequency (aka carrier). So the receiver has to detect the instantaneous frequency, relative to the carrier.

    To actually recover the original signal, the receiver must also account for the modulation index used by the transmitter, which describes how much the output will deviate for a given input frequency. The modulation index is usually standardized for the application, such as FM broadcasting, amateur radio FM, walkie talkie FM, etc.

    Because a larger modulation index means the same input signal will result in wider deviations, more RF bandwidth is used, spreading the signal wider and generally improving noise immunity.


  • When it comes to what insurance does or doesn’t cover, the best answer will come from the text of the policy itself. This is, unfortunately, very dry reading and most people – although instructed to keep a copy handy – don’t have the full text nearby. That said, because of the regulated nature of insurance in the USA, standardized forms of policies exist, and homeowner policies are no exception.

    The common homeowner policies are numbered HO-1 to HO-8. HO-1 only pays out only for the ten listened “perils”, and is thus the most barren policy available. Not all HO-1 policies are verbatim identical, but the gist usually matches.

    We can look at this sample text from a random HO-1 (issued by American Family Insurance). Page 5 shows that “fire or lightning” is covered, so that’s a good start.

    On page 6, we find the exceptions to the coverage, so if any of these apply, the policy will not pay out. Nothing in Part A would seem to apply to a DIY LED project, unless you tell me your LEDs are radioactive. Part B also doesn’t apply, unless you’re somehow perpetuating a fraud using LEDs.

    Part C reads like it could apply, because it mentions “construction”, “design, workmanship or specification”, and “maintenance”, but this section only applies to the dwelling and so refers to those things which are permanently affixed to the house. That would include things like ceiling fans and light fixtures, but wouldn’t include stuff that is attached to the walls using thumbtacks or 3M Command strips. It even says that:

    However, we do cover any resulting loss to property described in Coverage A - Dwelling and Dwelling Extension not excluded or excepted in this policy.

    This clause basically means the exceptions on Page 6 should be interpreted narrowly, not broadly.

    The point is, in the entire policy, there isn’t a clause that requires listed equipment, and remember that this is the most bare bones policy commonly available. If such a requirement did exist, then building your own PC wouldn’t be possible, since the standards bodies do not test individual computer parts – except the PSU, because that plugs into the mains.

    If a fire that damages the house does occur, the most probable causes would be due to: 1) an unlisted power supply or power brick feeding the ESP32 or the LEDs, or 2) no current limiting (eg a fuse) to cut out the power supply. Other failures like a shorted LED are unlikely to actually cause a house fire, and the insurance companies and UL know this; they’re more focused on preventing arc-faults that contribute to an estimated 50% of electrical house fires every year.

    Good design and clean installation on your part, and using properly listed low-voltage power supplies, will mitigate the major fire risks, leaving just software bugs and lighting snafus for you to deal with.

    As a matter of completeness, if there is an unlikely fire, be it from an LED project or from a candle falling over, the insurance company will still pay. But big or small, the claim will be recorded in the CLUE database along with the payout amount. This often reflects negatively on homeowners, so future rate increases may occur. But that varies by state. In any case, though, the insurance policy has still done its job: cover a non-intentional loss.

    I would nevertheless advise you to have a look at what sort of homeowner policy your dwelling is covered under. Everything beyond HO-1 is nicer, and some even include limited claim forgiveness of some kind (for a price). Also consider talking to your insurance agent, who should be able to help interpret how the policy applies.


  • My first thought for a compact, air-blower would be the inflater for air mattresses. They’re already fairly small, have a high flow rate, and exist in forms which accept 12 VDC.

    Another option is a small tank of compressed air, but that option is either heavy (steel tank) or stores air at inefficient, low pressures (plastic tank).

    I suppose a third option is to rig a can of air-duster so that it blows through the whistle. That would be mechanically simple to implement a solenoid to press the valve, although there is a small environmental cost to using cans of air-duster regularly.