Products PayPal provides a safe and secure way to purchase online. We never see your credit card number or store it on our server. You can use your PayPal account or major credit card to process your order online safely. Featured Project This project walks through the steps we followed to get the AI framework PyTorch to run on a Raspberry Pi 4 |
![]() |
Raspberry Pi Temperature Logger
Here are the instructions to build a simple temperature logger using a $5.00 I2C temperature sensor. The data is stored to the SD card and can be easily imported into excel. Simply by changing or adding other sensors other types of data can also be collected. Solderless Breadboard Step 1: Wire up the Temperature SensorFirst, solder header pins or lead wires on to the sensor. We used headers so it would be could simply plug the sensor into a breadboard. Make the following connections to the Raspberry Pi GPIO port. The ADD0 connection to ground determines the device I2C address. More than one sensor can be connected to the I2C bus, but they must each have a unique address. Step 2: Enable the I2C Bus*** Newer version may not require this step. If the file doesn't exist, move on to the next step. First the I2C bus must be enabled. There are two ways to enable the I2C bus.
The first and easiest is to do it with the raspi-config utility. Use the command sudo raspi-config to start the utility. Select Advanced Option to enabled the bus. The second, but more complex way is to do it manually. To do this, edit the configuration file /etc/modprobe.d/raspi-blacklist.conf
Step 3: Update the config.txtRun the following command to update the config.txt sudo nano /boot/config.txt Add the following lines to the file: dtparam=i2c1=on dtparam=i2c_arm=on Step 4: Set I2C Module to Load at BootThe I2C module should be set to load when the Raspberry Pi starts up. Do this by editing the /etc/modules file. Step 5: Install I2C packagesInstall the i2c-tools and python-smbus packages to complete the I2C setup: Step 6: Datalogger ProgramLoad and run the example program using the following command:
Step 7: Viewing DataUse the following command to view the raw data file: Step 8: Background LoggingTo run the logger in the background (it will keep running after you log out). Use the following command:
|
![]() |
|