Tag Archives: Data Logging

Portable GPS Data Tracker Using the Raspberry Pi Pico W

In today’s video we show how to run your GPS tracker remotely by saving the program as main.py, and powering from the Sunfounder Breadvolt power supply.  We also show how to prevent the problem of main.py locking up the serial port. We do this by adding a ‘kill switch’, that terminates the main.py program, so the log file can be transferred to your PC.

This is the schematic used for today’s lesson.

GPS Tracker
Schematic for Controlling GPS Tracker from the Breadvolt

For your convenience, this is the code we developed in today’s video.

 

Transfer Data Log Files from the Raspberry Pi Pico W to Your Desktop PC

Many Raspberry Pi Pico W project in microPython require the logging of sensor data. With these log files, we need a convenient way to transfer the data from the Pi Pico to a desktop PC. In earlier lessons, we showed how to log data to the Pi Pico flash memory. In today’s lesson we show how to transfer those log files to your PC. This is the code we developed in the video lesson.

 

Logging Data On Your Raspberry Pi Pico Using Flash Memory

In this video lesson, We show you how to log sensor data on your Raspberry Pi Pico W. We will start with simple read and write functions, and then show you how to write and read files line by line, and keep a log of your sensor data.

Our first program is very simple, and just shows how to write a line of data, and read a line of data the the Pico’s flash memory. Here is the code we used in the video for the first simple example.

In the second example, we show greater complexity by writing and reading a file, line by line. Each line contains comma delimited sensor data.

In these first two examples, when we open the file as ‘w’, the existing data is erased and a new file is created. In the example below, we open an existing file, and show how to append new data to the existing file without erasing the old data.