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

DIY Interactive Robot Using REKA:BIT With Micro:bit
BLTouch Installation for Ender 3 with 32-bit V4.2.2 Board
Pick and Send Random Meal’s Option and Locations through Telegram Bot Using Grove WiFi 8266 on micro:bit
DIY Automated Vacuum Cleaner Using REKA:BIT With Micro:bit
Rainbow Spark in Mini House using Maker Uno.
Tutorials of Cytron Technologies Scroll to Top