• Using one of these DC-DC converters:

    http://www.ebay.com/itm/DC-to-DC-Converter-Boost-Buck-Step-Up-Step-Down-Module-constant-current-voltage/251405700250

    The Voltage adjust pot has been removed, and replaced with pinheader. The pot is used as a rheostat, between the output voltage and the voltage sense, which is also connected to ground with a 500 ohm resistor. The power supply tries to keep the voltage on that sense line at 1.2 volts.

    The original plan was to simply replace that pot with an MCP41HV51-103. Those seem to be unobtainium at the moment, so I had to settle for an MCP41HV31-103. This is a high voltage digital potentiometer (up to 36 volts on the analog pins), with 128 taps.

    Unfortunately, when this is at it's lowest setting, it's resistance is still close to 500 ohms, preventing the supply from being set to a low voltage. I needed a way to raise or lower the value of that 500 ohm resistor between sense and ground. Enter an MCP4131-502 SPI digital potentiometer. Since this is just between the sense and ground, we didn't need a high voltage pot. It has 129 taps (not 128).

    The MCP41HV31 pot between Out+ and sense will be hereafter known as the "upstairs" pot.
    The MCP4131 pot between sense and gnd will hereafter be known as the "downstairs" pot.

    Connections:

    +12v from external PSU -> In+ on DC-DC converter
    GND from external PSU -> In- on DC-DC converter, V- and DGnd on upstairs pot, GND on Espruino, P0B, Vss on downstairs pot.

    Out+ (from header where pot was) on DC-DC converter to V+, P0B, and P0W on upstairs pot.

    +3.3v on espruino to VL on upstairs pot, Vdd on downstairs pot.

    B13,B14,B15 -> SCK,SDO,SDI on upstairs and downstairs pots

    SDWN on upstairs pot to +3.3v
    WLAT on upstairs pot to GND

    SPI2.setup({sck:B13,miso:B14,mosi:B15});
    digitalWrite(C4,1);
    digitalWrite(C5,1);
    
    var us=require("MCP4xxx").connectSPI(SPI2,C4,1,128);
    var ds=require("MCP4xxx").connectSPI(SPI2,C5,1,129);
    

    It works!

    I can change the voltage over the whole range, and get decent resolution over all of that range by adjusting the upstairs and downstairs pots. The next step is to write an algorithm to choose the right settings on the two pots, and maybe add some sort of feedback to the espruino so it can nudge the pots a bit up or down if the voltage isn't right.

    Pics:


    The next steps:
    Order the MCP4231-103 to replace the constant current adjustment pot.
    Some way for the Espruino to read the voltage (maybe just a voltage divider)
    Make a PCB to hold everything
    Find something to do with this thing.

About

Avatar for DrAzzy @DrAzzy started