• Right to repair and historical perspective

    5 days ago 0 comments

    Thank you Steve !

    I mean, the other Steve ;-)

    At least, one of the Apple founders lives in reality ;-)

  • What's a "typical relay" ?

    06/29/2021 at 23:41 0 comments

    While discussing with Paul Falstad about a new feature of circuitjs, came the question of which default parameter to propose to the users.

    For basic simulations, the contact's resistances can be pushed to the limits (on: 1m Ohm - off: 1G Ohm) because this does not affect the results much. Beware however because you'll get nanoamperes of leakage here and there.

    I like how you can configure the number of poles, the position of the coil, the appearance of the box, but there are more critical parameters. And we're back to the question: "what is a typical relay ?" There are so many types, sorts, models, brands, uses and characteristics that we can't tell what the user has in mind. But while exploring my parts bins, I found a good candidate that is an interesting compromise:

    The Finder type 40-52 is an average size, mains-capable DPDT relay so it's a good basis. Someone might want to integrate one or a few to control mains-powered devices with a microcontroller, for example I suppose that most circuitjs users will not consider AC-driven coils (which it doesn't handle).

    Rated at 12V, the coil resistance is about 200 ohms. I have 5 of them so here are the measured values :

    208 211 211 205 207

    Inductance is about a third of a Henry:

    0.359H 0.362H 0.371H 0.364H 0.365H

    I also tested one unit :

    Von: 7.15V  Ion: 33mA
    Voff: 2.2V Ioff: 10mA

    Note that this is only one unit and the values move with temperature, which also depends on self-heating, meaning that the above values will drift a bit if left powered.

    Also note that each contact can handle 8A of 220Vac so the magnetic circuits is pretty solid, with a strong spring, which also creates a high hysteresis and draws more current to action the contact.


    I also found a small bag of smaller relays (1/3 the volume of the above type), still 12V but PCB-mount and can only handle 1Aac (so we can expect a softer spring). The coils average 720 ohms within some percents but the inductances are less clustered: 0.663H 0.619H 0.544H 0.675H 0.620H 0.656H 0.565H

     (one unit/sample only)
    Ion:  9.7mA Von: 7.15V
    Ioff: 12mA Voff: 1.45V

    Whereas a similarly-rated but 5V only version has only 28mH and 122 ohms


    So no, there is no "typical" relay just as there are no typical resistors or capacitors... At this point, it doesn't make sense to sample all my parts, but the above two references are "reasonable", as they are not guesses.

    And concerning the switching time, I'll simply quote Paul:

     I will change the switching time to 5ms.  it's working great.

    This parameter is useful in the context of the whole circuit but all the bounces and affecting conditions make this parameter almost irrelevant at this level of simulation. Bounces can have very complex patterns, the inductor will slow the rise of the current and delay the magnetism, oh and the speed might also be affected by the input current's slope so it is waaayyyy simpler to just give an approximate delay. @matseng has explored this with #ReTest - Relay timing tester  and this is "another can of worms", as shown in an old log:

    So this log does not answer the initial question but brings some interesting data to the debate :-)

  • Measure the potentiometer's position with Arduino

    06/25/2021 at 15:23 0 comments

    I happen to have a low-value pot whose position I should measure. It has a total resistance of 100 ohm: under 5V, that would draw 50mA ! That's ridiculous. Using a bridge would not be practical either because I need to read the position with the Arduino's ADC pin(s). I want to decrease the current by at least 10 folds yet preserve the 10-bit resolution and range.

    Then I had the idea to combine the pot with a classic differential amplifier, but not where it is usually plugged.

    It took a while to find the "right" version because resistor values matter. It's a matter of balance as well :-) I have chosen 2K2  (and one multiple) so the overall current draw is 1/10th of 50mA but the values can be tuned (but check the output range). The biggest issue though was that the base bias has a significant influence (must be tuned so the output swing is maximised but current does not increase too much) and under certain conditions the swing "plateaus" in the middle position...

    In the end, the circuit has 6 resistors of identical value and 4 identical NPN, that provide about 5V of peak-to-peak swing between the two outputs, which then go to an individual ADC pin (some integration and subtraction will do the rest of the magic). https://tinyurl.com/yeuvbcxq is where you can play at home !


    I built the circuit with 3K resistors and the output swing is within 2% of the simulation, or the tolerance of the parts and lab equipment. Good job :-)