Read and Log Internal Temperature Data in Raspberry Pi Pico to .txt file.

Introduction

Raspberry Pi Pico can store all the programs that we have been writing in it. It’s an equivalent function to the microSD card in your Raspberry Pi, or the hard drive or solid-state drive in your laptop or desktop computer, which means that whatever you save there stays in place even when you unplug your Pico’s micro USB cable?.

Video

In this video, we will read and log the internal temperature sensor data on Raspberry Pi Pico into a .txt file. Watch this video to know more about it.

Hardware Preparation

This is the list of items used in the video.

import machine
import utime
sensor_temp = machine.ADC(machine.ADC.CORE_TEMP)
conversion_factor = 3.3 / (65535)
file = open("temps.txt", "w")
while True:
reading = sensor_temp.read_u16() * conversion_factor
temperature = 27 (reading 0.706)/0.001721
file.write(str(temperature) + "\n")
file.flush()
utime.sleep(5)

view raw
DataLogger.py
hosted with ❤ by GitHub

Thanks for reading this tutorial. If you have any technical inquiries, please post at Cytron Technical Forum.

Please be reminded, this tutorial is prepared for you to try and learn.
You are encouraged to improve the code for better application.

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

Getting Started with Robotic Operating System (ROS) and JetRacer AI Kit
Barrier Gate with micro:bit and MakeCode
Play MP3 File on Maker Pi Pico Using CircuitPython
Remote Jetson Nano using SSH with Visual Studio Code
3.3V Serial LCD with Raspberry Pi Pico via SPI or I2C
Tutorials of Cytron Technologies Scroll to Top