PMS5003 and FIPY powered by VIN



  • I use the PMS5003 and taking UART readings, for a Indoor Air Quality project, when I have the FIPY connected with the USB port, it works and take readings, but when I power the FIPY(I am using the expansion board V3), it doesn´t take readings from PMS5003, I am using this code:

    TXP = 'P21'
    RXP = 'P20'
    
    uart1 = UART(1, baudrate=9600, pins=(TXP,RXP))
    pycom.heartbeat(False)
    buffer = []
    while True:
        data = uart1.read(32)  
        print(data)
        print("a")
        while (data == None):
            
                data = uart1.read(32)
                print("b")
                pycom.rgbled(0x7f0000)#RED COLOR RGB
    
        if data:
            data = list(data)
            buffer += data
            pycom.rgbled(0x007f00) #GREEN COLOR RGB
            time.sleep(1)
    

    I use the FIPY RGB to know if the PYCOM is taking data or not, RED is when is not taking data, and GREEN is when you take data. PYCOM just take data when is connected by USB port instead of VIN.


Log in to reply
 

Pycom on Twitter