[Pysense] How can I connect a sensor to the external IO Header



  • @crumble

    This is only in regards to the ADC, it is not available via the external IO header so to use it you would need to solder to the bottom side of the module socket:
    0_1518100404236_fc4bd35c-1642-437c-baa6-04ff636c4586-image.png



  • @seb said in [Pysense] How can I connect a sensor to the external IO Header:

    You can however solder a wire to the bottom side of the module header and connect to your sensor that way.

    Can you please explain why we shall solder the wires on the bottom side. I solderd my update switch on the top side. This was much more convenient. Are digtial values OK or shall they be soldered at the bottom side, too?



  • @pierrot10 said in [Pysense] How can I connect a sensor to the external IO Header:

    link text

    Hi,

    The following pins on the external header are connected to the module:
    EXT_IO0 = P2
    EXT_IO1 = P9
    EXT_IO2 = P10
    EXT_IO3 = P11
    EXT_IO4 = P4 (Cannot be used if SD card is being used)
    EXT_IO5 = P8 (Cannot be used if SD card is being used)

    The ESP32 module used on all the Pycom modules can map I2C to any of these pins. Please see the example for using non default pins in our docs: https://docs.pycom.io/chapter/firmwareapi/pycom/machine/I2C.html

    Unfortunately none of these pins are connected to ADC1(P13-P20) (we do not support using ADC2 in our firmware) so you cannot access the ADC via the external header. You can however solder a wire to the bottom side of the module header and connect to your sensor that way.



  • @crumble Hello, that great, Could give me hints to configure those pin as I2C or analog input? I supposed I should be interrested on this?
    ADC and I2C?



  • @pierrot10

    Yes, you can use the pins. (I assume, because I did that on a pytrack, which shall be similar enough) I solderd a switch and a DHT-22 onto this connector.

    You can use other I2C devices as well. There exist analog/digital converter and I2C hubs. So you can expand the I/O pins of the LoPy. But this will not be plug and play.

    The PIC is a small low power microcontroler which will send your *Py into deep sleep and will wake it up again. I think it will do much more, but this is the feature I know of ;)



Pycom on Twitter