That Was Quick

A project log for D1 Mini Analog Shield

Add 12 analog pins to the D1 Mini ESP8266 board

ꝺeshipuꝺeshipu 05/28/2017 at 06:242 Comments

At last a project that went smoothly for a change. The MAX1238 chips arrived, and I soldered them to the PCBs and they seem to be working just fine at first sight. I was a bit worried about the chips being too small when I saw them, but they are fine.

I wrote a very simple MicroPython library to handle this shield:

class MAX123x:
    def __init__(self, i2c, address=0x35):
        self.i2c = i2c
        self.address = address

    def reset(self):
        self.i2c.writeto(self.address, b'\x80')

    def read(self, channel):
        if not 0 <= channel <= 11:
            raise ValueError()
        data = self.i2c.readfrom_mem(self.address, 0x61 | (channel << 1), 2)
        return ((data[0] & 0x0f) << 8) | data[1]


Dave's Dev Lab wrote 05/28/2017 at 07:19 point

"a project that went smoothly".... i think you are writing fiction now... "Shirely" you are joking.....

(nice work btw...)

  Are you sure? yes | no

ꝺeshipu wrote 05/28/2017 at 18:06 point

Well, I'm sure there are problems that I'm not seeing that will manifest themselves down the road at some point, of course. I did it too many times already to really believe I got everything right at the first try. And of course preparing this for the semi-mass production required for Tindie is going to take some more work. But so far so good.

Thank you for your kind words.

  Are you sure? yes | no