• @Gordon, quite interesting thought...

    Had forgotten to mention that putting the resistor in the low side, the voltage sensor ADC input pins have to be put on voltage divider resistor-pair to make sure nothing bad can happen to the chip an make it work for any Espruino board (voltage test point - 2.2k - Espruino pin - 3.3k - GND for save 5V max / 0.9mA @ 5V ; 1.8k instead of 2.2k, 1mA @5V can work. For lesser 'side-load', use 4k7 and 6k8 or 9k1 and 12k - to stick w/ E12 value series. Precision resistors come though in many different ways).

    Not having precision resistors at hand is no problem at all, because that's where software can kick in and make it work: with multi-meter of decent sensitivity and precision - and practically all digital multimeters qualify for that - you measure the components and adjust the calculations for each of the four circuits.

    Back to the idea of putting a DRV3388 to work, add a diode in charge direction on the high side of each charge circuit to prevent any challenges.

    One single DRV3388 can actually drive 4 circuits with only one caveat: switching on and off goes only for pairs... after a pair has switched off, the fully charged one has to be taken off to complete the remaining one. Software can sense an 'occupied' slot.

    Here the schema for one charging device. The R_on min is specified as 180 mOhm but doing some experimenting over the range of charge current has to be measured and taken into account in voltage / charge current calculation.

    One could also use a full DRV8833 H-Bridge for a single charge circuit and add option of 3 different charge currents by putting diodes into the low side / drain path. This makes the calculation more difficult because of the current dependent voltage drop of diodes, but it is still manageable. With 3 of the four output options and two different current limiting resistors 3 different charge currents can be established, of which - of course - two are dependent, like 10%, 90% and 100%. As useful a the DRV8833 is, a low gate threshold NMOS FET array (TI TPL7407LA or ULN2004 Darlington Transistor Array - or even just 4 standalone low threshold NMOS FETs - can do the job equally well since software has to 'compensate' anyway for the components' dependent behavior (@MaBe, what are your double-targeted thoughts/comments?)

    var s=`
                                         5V  
                                         ^   
                                         |   
                                       .---. 
                                        \ /  
                                         V   
                                        -+-  
                                         |   
                       .-----------------+   
                       |                 |   
                       |     .----.      |   
                       |     |    |      |   
                      .-.   .-.   |      O + 
                      | |   | |   |      _   
                 9k1  | |   | |   |   .-' '-.
                      '-'   '-'   |   |     |
                       |     |    |   |  C  |
    ADC_#H in ---------+     |    |   |  e  |
                       |     |    |   |  l  |
    ADC_#L in ---------------+    |   |  l  |
                       |     |    |   |     |
                      .-.   .-.   |   '-----'
                      | |   | |   |      O - 
                 12k  | |   | |   |      |   
                      '-'   '-'   '------+   
                       |     |           |   
                       |     |          .-.  
                       |     |     R    | |  
                       |     |      lim | |  
                       |     |          '-'  
                       |     |           |   
    DRV8833_XY out ----------------------' . 
                       |     |              |
                       |     |          R  < 
                       |     |           On |
    GND ---------------+-----+------------ ' 
    
    `;
    
About

Avatar for allObjects @allObjects started