#Hi all How can I read the Raspberry Pi

1 messages · Page 1 of 1 (latest)

atomic basin
#

For MicroPython, it’s something like
sensor_temp = machine.ADC(4)
conversion_factor = 3.3 / (65535)

lunar zinc
#
import microcontroller
sensor_temp = microcontroller.cpu.temperature
#

it's in C

atomic basin
#

Thanks! That code works, but the number (38) is higher than I got with the MicroPython code.

lunar zinc
#

eh temperature varies depending on the activity and whatnot, dunno if the calibration is different

bold yacht
#

I monitor temp on-board my nrf52840 and it varies depending on how much you're working with the board, saving files to it, etc..

#

if you let it idle and cool down for a while you'll see the temp drop after a while of not using it.

atomic basin
#

Is that cpu.temperature sensor the only temp sensor on the pico w?

bold yacht
#

so i'd say that's pretty normal, keep an eye on the temp deviation though, if you think it's way off then bring that up to someone. give it time to get used to its behavior.

atomic basin
#

I’m looking for ambient air temperature.

bold yacht
#

well that's completely different than an on-board temp monitor.

#

you'll want an external temp sensor module for that.

atomic basin
#

OK. I’ve done that before, with a not-pico raspberry pi, so I’m familiar. I got the wrong idea that the temp sensor on the pico was ambient air. Thanks!

bold yacht
#

i did the same thing with my NRF52 😉

atomic basin
bold yacht
#

the on board cpu's generate a good amount of heat, usually off by up to 10F from ambient temp. they do not make good ambient temp sensors 😉

#

oh that's neat.

#

yeah i think you can handle hooking up a simple I2C temp sensor. GL!