Micropython code for SEN0322 I2C Oxygen Sensor (ESP32)

userHead Arrows04 2022-08-13 01:39:16 1878 Views4 Replies

I am using an ESP32 and I would like to read data from the SEN0322 sensor with Micropython. Unfortunately I am new to coding and I only know Python. SEN0322 sensor doesn't come with a micropython code for ESP32, just for C++ and Raspberry Pi Python only. Can anyone link me if there's an available library?

 

Thank you!

2024-02-05 19:06:50

There are libraries now, and I was able to get them working with my ESP32 running Micropython, the only issue is the program only puts out 0 values.  And if I read the raw data into the REPL, it also just displays 0 values.

Raw Data: b'\x00\x00\x00' Factored Data: 0.0 Oxygen Concentration: 0.00 %vol Key Register Data: 0.255 Raw Data: b'\x00\x00\x00' Factored Data: 0.0 Oxygen Concentration: 0.00 %vol Key Register Data: 0.255 Raw Data: b'\x00\x00\x00' Factored Data: 0.0 Oxygen Concentration: 0.00 %vol

It displays when scanned…the LED can be turned on with the reset button, and it communicates back and forth, so I'm not sure what my issue is.  Possibly my sensor is broken or defective?  I'm able to use a DHT11 sensor just fine.

Let me know if I should post the Micropython library I've tweaked to get this far.  I was able to find almost workable solutions on GitHub by searching for SEN0322.

 


 

userHeadPic Drake.Cousins
2023-04-21 22:26:24

I have been working with someone on the forum at Adafruit to develop CircuitPython code for this (which should work on MicroPython just as well).  We have it almost working - we are communicating with the device, but currently the issue is that the register that should contain Oxygen Data (0x10) is returning all ones (b'\xff\xff\xff') all the time, yielding an oxygen concentration reading of 283.05 lol…  

 

Were you ever successful in getting your unit to work on MicroPython?   Anybody?

 

Happy to share the code we have so far if anyone might be able to help with it.  You'd need to be pretty good with CircuitPython/MicroPython, understand classes…  unless you have a method of calling the registers in this thing that doesn't involve building classes… :)

 

userHeadPic David.Xanatos
Xavier.Panamito wrote:

Hi, I'm trying to get this sensor to work on a raspberry pi pico, but still haven't found a micropython library that works with this sensor. Did you get it to work?

I would really help me if you did :)

2023-10-13 13:27:24
1 Replies
2022-11-04 09:43:28

Sorry, there is no Micropython library for this product.

userHeadPic jenna