Hi, I have been playing with the OpenMV for about six months and am really blown away by what this small low powered board can do. That said, my experience on the electronics side is more limited and I am stuck on what I suspect is a simple problem
I am attempting to get an OpenMV H7 to read data from an Atlas Scientific temperature sensor via P6 using ADC https://www.atlas-scientific.com/_files/code/ENV-TMP-Arduino-Sample-Code.pdf. The hookup is simple - three wires and after running issues I did try connecting the GND and V+ to an external power supply in case power over USB (as I am monitoring the output in the OpenMV IDE Serial Terminal) was causing the problems. I just get random fluctuating values. I am working from the logic in an Arduino script https://www.atlas-scientific.com/_files/code/ENV-TMP-Arduino-Sample-Code.pdf
import sensor, image, time, pyb adc = pyb.ADC("P6") # create an analog object from a pin while(True): time.sleep(5000) val = adc.read() adc_point = 3.3/1024 # Value of one adc point - voltage/1024 (have also tried /4095) val *= adc_point # Volts val *= 1000 # Convert to millivolts temp = 0.0512 * val - 20.5128 # Convert to temperature print(int(temp))
Any advice or guidance is appreciated.