• 5 Posts
  • 130 Comments
Joined 3 years ago
cake
Cake day: July 2nd, 2023

help-circle
  • In any case, pending your reply, I would suggest the following circuit for reliable operation. This will require a P-channel MOSFET, which is different from the two MOSFETs you tried earlier, which are all N-channel. This will also use two resistors. I am making an assumption that your speaker module simply requires two wires at feed it 4 volts, and does not care whether we add a switching circuit to either wire, the positive or negative wire.

    suggested circuit 1

    This type of circuit would be described as an inverting, low-side MOSFET switching circuit. The inverting part means that when the MOSFET is fed a lower voltage, that causes the transistor to become active, whereas a non-inverting circuit would require feeding the MOSFET with a higher voltage to make the transistor become active.

    Low-side switching refers to the fact that the load (ie the speaker module) is permanently attached to the higher voltage (the high-side) and we are manipulating the low-side. Not all electronic loads can be used with low-side switching, but this is the easiest mode to implement using a single MOSFET transistor. As a general rule, to do low-side switching always requires a P-channel MOSFET. WARNING: a P-channel MOSFET has its drain/source reversed from how an N-channel MOSFET is usually wired up. Observe the schematic very carefully.

    As for why we cannot do high-side switching (which would use an N-channel MOSFET), it is because a typical N-channel MOSFET requires that the gate be a few volts higher than the source. But consider that when the transistor turns on, the drain and source become almost-similar voltages. So if the drain is attached to 4 volts, and as the transistor becomes active, the source rises to something like 3.95 volts, then what gate do we use to keep the transistor active? If we give 4v to the drain, then the gate-to-source voltage is a mere 0.05 volts, which is insufficient to keep the transistor on. We would need an external source to provide more gate voltage, relative to the source pin. If we tried such a high-side switching circuit anyway, it would quickly oscillate: the transistor tries to turn on, then turns itself off, then back on, and so forth. Or it would sit comfortably at some half-way gate voltage, where the transistor is barely-on, barely-off. This is not useful as a switching circuit.

    The way that my suggested circuit works is as follows: when the tripwire (marked as SW3) is in place, then R4 and R2 will form a voltage divider. Given that the battery supplies 4v, we can show that the voltage at the MOSFET’s gate will be 91% of 4v, or 3.64 volts. This should be just enough to prevent the P-channel MOSFET from becoming active. Note: a P-channel MOSFET becomes active when there is a low gate-to-drain voltage, with 0v causing the transistor to become active. In this way, with the trip-wire, the transistor will not allow current to pass through the speaker.

    When the tripwire is pulled out, this breaks the connection to R4. That leaves the gate connected to only R2, which is connected to the negative side of the battery. Thus, any charge in the gate will seep away through R2, meaning that the voltage across R2 will equalize at 0v. This means the gate-to-drain voltage will be 0v, which means the MOSFET will activate. And that allows current to power the speaker module.

    Note: one end of the tripwire (labeled #1 in the diagram) will still have 4v on it. If the tripwire is cleanly detached from the whole circuit, using your loop-of-wire and nails idea, then there is no problem. But if the tripwire is still hanging onto the 4v side of the circuit, then be careful that the tripwire doesn’t make contact with another part of this circuit. The R4 resistor will still be there, so there won’t be a short circuit or anything bad like that. But if that tripwire reconnects to the gate, then the transistor will deactivate again, stopping the music.

    I wish you good luck in this endeavor!


  • I’m going to try to answer your situation, but although time appears to be of the essence, I need to first understand exactly what you’ve already tried. So bear with me for a moment.

    The examples I found were very simple, involving an NPN transistor (2n2222), 10KΩ resistor, battery, and DC Piezo speaker.

    With my initial attempt, I wired +4V from the switch to the transistor’s collector and then separated the collector from the base with a resistor. I connected the emitter to the pin that, when the switch is engaged, would send 4V through and power the module.

    Does this diagram correctly describe what you tried as a first attempt?

    schematic diagram of attempt 1

    Someone suggested that what I actually needed was a MOSFET …

    I have the resistor connected between Gate and Drain, +4V going to drain, and the load from the module on Source.

    With an RFP30N06LE, I get about 2V output to Source. With an IRF840N, I’m only getting 0.9V.

    Do these diagrams match your circuits with each MOSFET?

    schematic diagram of attempt 2

    schematic diagram of attempt 3

    What I am not able to understand, in your last photo with the MOSFET, is where the blue wire is going.




  • Automation would have made this quicker, but I didn’t have on-hand any stepper motors nor microswitches to rig up a machine to try all combinations. Perhaps the greatest outstanding issue was how to actually press down the lever to “try” each combination. That would require some sort of solenoid, and at that point, I figure this will just be a passive manual activity, to do when watching TV or winding down before bed.

    As for carpal tunnel, the design is meant to reduce that risk, because this wheel minimizes finger manipulations. Indeed, without using any fingers, I could turn this wheel using a pen, Cruella De Ville’s cigarette holder, or any number of other instruments that replaces a finger. If nothing else, because the diameter is 180 mm, turning this thing is more of a forearm exercise. I actually considered adding a spinner knob, like those used on an automobile steering wheel.





  • I see. Given those constraints then, I don’t see any option besides a new heater. Ideally, the new heater would be built with less circuitry, so there would be fewer things to break.

    Looking at the Adax Clea product description, it seems overly complicated for a radiator, IMO. I’m not sure I’d want triac switching for something like a heating appliance. Resistive heating doesn’t strictly require silicon switches, when a relay should work. But I suspect an equally-svelt radiator that’s also simple may be hard to find.



  • My experience is mostly with repairing lower voltage devices (eg 12v to 54v PoE). In your case, a phase to phase short has made quite the mark on that PCB, and being a much higher energy event than low-voltage DC, its possible that some delamination has occurred, with downstream effects on expected trace resistance, capacitance, and leakage/creepage.

    Were this a low-voltage board, I personally wouldn’t be worried about those downstream effects. But for AC line voltage, I’d rather buy myself the peace of mind. Do keep parts from the dead board that are salvageable, but IMO, a thermal event on the AC side of a 400vac board would disqualify it from continued service.

    P.S. does that circuit not have an onboard fuse? I’m not seeing one and I’m kinda surprised. Presumably an upstream circuit breaker or fuse was what tripped to stop this turning into a fire?


  • I’m taking a guess that perhaps the fridge makes similar assumptions that automobiles make for their lamps. Some cars that were designed when incandescent bulbs were the only option will use the characteristics resistance as an integral part of the circuit. For example, turn signals will often blink faster when either the front or left corner bulb is not working, and this happens to be useful as an indicator to the motorist that a bulb has gone bust.

    For other lamps, such as the interior lamp, the car might do a “soft start” thing where upon opening the car door, the lamp ramps up slowly to full brightness. If an LED bulb is installed here, the issues are manifold: some LEDs don’t support dimming, but all incandescent bulbs do. And the circuit may require the exact resistance of an incandescent bulb to control the rate of ramping up to fill brightness. An LED bulb here may malfunction or damage the car circuitry.

    Automobile light bulbs are almost always supplied with 12 volts, so an aftermarket LED replacement bulb is designed to also expect 12 volts, then internally convert down to the native voltage of the LEDs. However, in the non-trivial circuits described above, the voltage to the bulb is intentionally varying. But the converter in the LED still tries to produce the native LED voltage, and so draws more current to compensate. This non-linear behavior does not follow Ohm’s Law, whereas all incandescent bulbs do.

    So my guess is that your fridge could possibly be expecting certain resistance values from the bulb but the LED you installed is not meeting those assumptions. This could be harmless, or maybe either the fridge or the LED bulb have been damaged. Best way to test would be installing a new, like-for-like OEM incandescent bulb and seeing if that will work in your fridge.



  • To start, the idea of charging in parallel while discharging in series is indeed valid. And for multicell battery packs such as for electric automobiles and ebikes, it’s the only practical result. That said, the idea can sometimes vary, with some solutions providing the bulk of charging current through the series connection and then having per-cell leads to balance each cell.

    In your case, you would have a substantial number of cells in series, to the point that series charging would require high voltage DC, beyond the normal 50-60 VDC that constitutes low-voltage.

    But depending on if charging and discharge are mutually exclusive operations, one option would be to electrically break the pack into smaller groups, so that existing charge controllers can charge each group through normal means (ie balancing wires). Supposing that you used 12s charger ICs, that would reduce the number of ICs to about 9 for a pack with a nominal series voltage ~400vdc. You would have to make sure these ICs are isolated once the groups are reconstituted into the full series arrangement.

    Alternatively, you could float all the charging ICs, by having 9 rails of DC voltage to supply each of the charging ICs. And this would allow continuous charging and battery monitoring during discharge. Even with the associated circuitry to provide these floating rails, the part count is still lower than having each cell managed by individual chargers and MOSFETs.

    It’s not clear from your post what capacity or current you intend for this overall pack, but even in small packs, I cannot possibly advise using anything but a proper li-ion charge controller for managing battery cells. The idea of charging a capacitor to 4.2v and then blindly dumping voltage into a cell is fraught with issues, such as lacking actual cell temperature monitoring or even just charging the cell in a healthy manner. Charge IC are designed specifically designed for the task, and are just plain easier to build into a pack while being safer.


  • I can accept the premise that LLMs are being used to write Commons speeches – MPs are also people, I’m told – but these graphs suggest that LLMs are overusing certain stock phrases which have existed in the business world and apparently in Commons speeches since at least 2007.

    What puzzles me is why LLMs are more prone to using these particular phrases. Does this happen for all users of LLMs, or only when British MPs in particular are requesting a speech?

    I’d be interested to know if the same trend for the same phrases can be found in the Canadian House of Commons, since although they also follow much of the same procedures, North American English should skew the frequencies of certain words. So if the same trend can be found, then that suggests that the common LLMs do lean towards certain phrases. But if the trend is not statistically significant in Canada, then perhaps British MPs issue different prompts than their Canadian counterparts.

    What I’m saying is that I rise today to highlight additional avenues of intrigue, as MPs and citizens alike are navigating a world where AI supposedly streamlines daily activities. That certain trends may or may not exist underscores the gravity of this seemingly bustling industry that we call AI.

    [just to be clear, that last paragraph is entirely in jest]


  • If only one side of the switch/points remain, depending on the type of crossing and condition of the wheels, there’s a chance that the trolley’s right side wheels can jump over the switch and continue straight forward, even as the switch is set to diverge onto the non-existent siding.

    Or it could derail but continue barreling forward anyway. But trolleys don’t tend to be going that fast.


  • I did indeed have a chuckle, but also, this shouldn’t be too foreign compared to other, more-popular languages. The construction of func param1 param2 can be found in POSIX shell, with Bash scripts regularly using that construction to pass arguments around. And although wrapping that call with parenthesis would create a subshell, it should still work and thus you could have a Lisp-like invocation in your sh script. Although if you want one of those parameters to be evaluated, then you’re forced to use the $() construction, which adds the dollar symbol.

    As for Lisp code that often looks like symbol soup, like (= 0 retcode), the equal-sign is just the name for the numerical equality function, which takes two numbers. The idea of using “=” as the function name should not be abnormal for Java or C++ programmers, because operator overload allows doing exactly that.

    So although it does look kinda wonky for anyone that hasn’t seen Lisp in school, sufficient exposure to popular codebases and languages should impart an intuition as to how Lisp code is written. And one doesn’t even need to use an RPN calculator, although that also aids understanding of Lisp.

    Addendum: perhaps in a century, contemporary programmers will find it bizarre that C used the equal-sign to mean assignment rather than equality, when the <= arrow would more accurately describe assignment, while also avoiding the common error of mixing up = and == in an if-conditional. What looks normal today will not necessarily be so obvious in hindsight.



  • But could this comparison not be done with some hysteresis?

    It can, but analog design is also not my forte.

    The part count is not important as long as the parts aren’t terribly expensive, since this is exclusively for my personal use

    In that case, the original suggestion of using an ADC and an op-amp would be the most flexible for software. You would, however, need to do some research on wiring an op-amp to amplify the sense voltage to something your microcontroller’s ADC is capable of resolving.



  • Ah, I entirely missed the sense pin when skimming the datasheet.

    That said, using a shunt for an inductive load like a motor may have to contend with the corresponding spikes caused when switching the motor. This just means the thing doing the sensing needs to tolerate the spikes. Or mitigate them, with either a snubber or a flyback diode (is this actually doable with an H bridge?).

    As for the op-amp and ADC, if we already accept the additional of the op-amp part, it is also feasible to instead use a comparator with a reference voltage set for the max safe current. The digital output of the comparator can then be fed directly to the microcontroller as an interrupt, providing fast reaction without the sampling time of an ADC. But this would be so quick that the spikes from earlier could get picked up, unless mitigated. It also means software will not know the exact current level, other than that it’s higher than the threshold set by the reference voltage.

    Still, these solutions are adding to the part count. If that’s a concern, then I’d look for a motor driver with this functionality built in.