• Analog CO2 Sensor for LoPy, can 5v pin power it?

    LoPy co2 lopy adc 5vdc sensor
    15
    0 Votes
    15 Posts
    5k Views
    bmarkusB
    @ledbelly2142 said in Analog CO2 Sensor for LoPy, can 5v pin power it?: @bmarkus The COZIR sensors look nice. Are they in the sub $100 range? First hit of Google search gives $109 USD https://www.co2meter.com/products/cozir-0-2-co2-sensor As an indication you can visit the webshop of ChipCAD, a Hungarian distributor https://shop.chipcad.hu/Welcome/Default.aspx?scenarioID=360&pid=1878 Prices are in HUF (Hungarian Forint), VAT not included. At the moment 1 USD = 262.6 HUF But it may vary by distributor, quantity, shipping conditions, custom, etc. and model. You can ask GSS to advice where to buy it, they are good.
  • I2C sensor with WiPy2

    WiPy 2&3 wipy2.0 i2c sensor
    28
    0 Votes
    28 Posts
    11k Views
    C
    @chumelnicu @JasonTimmins , @iotmaker Any update with VL53L0X library ? Thank you !
  • 1 Votes
    25 Posts
    11k Views
    P
    @jmarcelino @livius @robert-hh Hey all, thx a lot for helping me this last days with this driver. This is the code i have until now... it's a shame that i didn't make it, but i think that i could have broken the sensor when i plugged CS to 5v instead of 3V3. I think i will buy another one, that will take some weeks until it gets to Uruguay :P Anyway, this is the code we've made until now, maybe it's useful for someone else. It's not throwing the ugly i2c bus error anymore, but the device id registry is returning always zero, and that's bad... not sure if the device is broken or what, but comparing this code with the implementation @livius has referenced, and with other implementations i found on google for other languages, it looks like the retrieval of the device id is the first action almost everyone does, so... i dont know. from machine import I2C from machine import Pin from machine import Timer import time def DelayUs(us): Timer.sleep_us(us) #i2c slave address SLAVE_ADDRESS = 0x1D #registers REG_POWER_CTL = 0x2D REG_BW_RATE = 0x2C #connected to SDO and CS of MMA7455 CS = Pin("P23", mode=Pin.OUT) CS.value(1) CS.hold() DelayUs(1000) #main i2c = I2C(0, I2C.MASTER, baudrate=100000) print(i2c.scan()) def setPowerCtrl(measure, wake_up=0, sleep=0, auto_sleep=0, link=0): power_ctl = wake_up & 0x03 if sleep: power_ctl |= 0x04 if measure: power_ctl |= 0x08 if auto_sleep: power_ctl |= 0x10 if link: power_ctl |= 0x20 i2c.writeto_mem(SLAVE_ADDRESS, REG_POWER_CTL, bytes([power_ctl])) #***************************** #******* main logic ********** #***************************** data = i2c.readfrom_mem(SLAVE_ADDRESS, 0x00, 1) print("DEVID: " + str(bin(data[0]))) #set power characteristics setPowerCtrl(1, wake_up=0, sleep=0, auto_sleep=0, link=0)
  • ADXL 345 (from Adafruit)

    Discussion adxl345 accelerometer sensor adafruit sensors
    14
    0 Votes
    14 Posts
    4k Views
    D
    @Lokefar Can you post the final working code for this sensor with lopy 4?