Uploaded February 2026 | Updated September 2026, 2 weeks ago
This tutorial covers how to use Inter-Integrated Circuit (I2C) communication in embedded Rust on the Raspberry Pi Pico 2. I2C is one of the most widely used protocols in embedded systems, enabling microcontrollers to communicate with sensors, displays, memory chips, and countless other peripherals using just two wires. We'll build on our USB serial template to create a temperature monitoring application that reads data from a TMP102 I2C sensor and displays it over USB serial when you press a button.
The written guide for this episode can be found here: digikey.com/en/maker/tutorials/2026/intro-to-embedded-rust-part-5-reading-from-an-i2c-temperature-sensor
The GitHub repository containing the Docker image and example code for this series can be found here: github.com/ShawnHymel/introduction-to-embedded-rust
We’ll explore how to configure GPIO pins for their alternate I2C functions using the rp235x-hal, initialize the I2C peripheral with the proper clock speed (100 kHz standard mode), and perform write-read operations to communicate with I2C devices. We explain I2C addressing and how to access device registers. The tutorial walks through reading the TMP102's datasheet to understand its register layout, performing combined write-read transactions, and converting raw binary sensor data into meaningful temperature values in degrees Celsius. You'll see practical bit manipulation techniques including shifting and masking to extract 12-bit signed temperature values from the sensor's two-byte response.
The project also introduces important embedded Rust patterns beyond just I2C. We demonstrate button input handling with pull-up resistors and implementing edge detection to trigger readings only on button press. You'll see how to use the heapless crate to work with fixed-size strings without heap allocation (essential for no-std embedded development where heap usage is often avoided). We show how to format floating-point temperature values into strings using the write! macro and core::fmt::Write trait, providing formatted output without the standard library. The tutorial also covers practical error handling for I2C operations using Rust's Result type, showing how to gracefully handle communication failures and display error messages over USB serial.
The demo used in this tutorial provides a reusable template for interfacing with I2C devices that you can adapt for accelerometers, gyroscopes, displays, EEPROMs, and thousands of other I2C peripherals.
Related Link:
digikey.com/en/maker/tutorials/2026/intro-to-embedded-rust-part-5-reading-from-an-i2c-temperature-sensor
Links:
Getting Started with STM32 and Nucleo: youtube.com/watch?v=hyZS2p1tW-g&list=PLEBQazB0HUyRYuzfi4clXsKUSgorErmBv
Introduction to Real-Time Operating Systems (RTOS): youtube.com/watch?v=F321087yYy4&list=PLEBQazB0HUyQ4hAPU1cJED6t3DU0h34bz
Raspberry Pi Pico 2: digikey.com/en/products/detail/raspberry-pi/SC1631/24627142
Learn more:
Maker.io - digikey.com/en/maker
DigiKey’s Blog – TheCircuit digikey.com/en/blog
Connect with DigiKey on Facebook facebook.com/digikey.electronics
And follow us on X: https://x.com/digikey
Product:
digikey.com/en/products/detail/raspberry-pi/SC1631/24627142
digikey.com/en/products/detail/raspberry-pi/SC1632/26241102
digikey.com/en/products/detail/raspberry-pi/SC1633/25862735
digikey.com/en/products/detail/raspberry-pi/SC1634/26241087
digikey.com/en/products/detail/sparkfun-electronics/13314/6797646
digikey.com/en/products/detail/lite-on-inc/LTL-4224/217584
digikey.com/en/products/detail/stackpole-electronics-inc/CF14JT220R/1830334
digikey.com/en/products/detail/te-connectivity-alcoswitch-switches/1825910-6/1632536
digikey.com/en/products/detail/dfrobot/FIT0096/7597069
digikey.com/en/products/detail/adafruit-industries-llc/1957/6827090
digikey.com/en/products/detail/cvilux-usa/DH-20M50055/13175849
Chapters:
0:00 Intro
0:45 Overview of TMP102 Temperature Sensor
3:14 Dependencies
4:00 Initialize Input Pin and I2C
13:11 Read and Print Temperature Value on Button Press
23:44 Build and Flash
25:24 Challenge and Reading Assignment
26:18 Conclusion
This tutorial covers how to use Inter-Integrated Circuit (I2C) communication in embedded Rust on the Raspberry Pi Pico 2. I2C is one of the most widely used protocols in embedded systems, enabling microcontrollers to communicate with sensors, displays, memory chips, and countless other peripherals using just two wires. We'll build on our USB serial template to create a temperature monitoring application that reads data from a TMP102 I2C sensor and displays it over USB serial when you press a button.
The written guide for this episode can be found here: digikey.com/en/maker/tutorials/2026/intro-to-embedded-rust-part-5-reading-from-an-i2c-temperature-sensor
The GitHub repository containing the Docker image and example code for this series can be found here: github.com/ShawnHymel/introduction-to-embedded-rust
We’ll explore how to configure GPIO pins for their alternate I2C functions using the rp235x-hal, initialize the I2C peripheral with the proper clock speed (100 kHz standard mode), and perform write-read operations to communicate with I2C devices. We explain I2C addressing and how to access device registers. The tutorial walks through reading the TMP102's datasheet to understand its register layout, performing combined write-read transactions, and converting raw binary sensor data into meaningful temperature values in degrees Celsius. You'll see practical bit manipulation techniques including shifting and masking to extract 12-bit signed temperature values from the sensor's two-byte response.
The project also introduces important embedded Rust patterns beyond just I2C. We demonstrate button input handling with pull-up resistors and implementing edge detection to trigger readings only on button press. You'll see how to use the heapless crate to work with fixed-size strings without heap allocation (essential for no-std embedded development where heap usage is often avoided). We show how to format floating-point temperature values into strings using the write! macro and core::fmt::Write trait, providing formatted output without the standard library. The tutorial also covers practical error handling for I2C operations using Rust's Result type, showing how to gracefully handle communication failures and display error messages over USB serial.
The demo used in this tutorial provides a reusable template for interfacing with I2C devices that you can adapt for accelerometers, gyroscopes, displays, EEPROMs, and thousands of other I2C peripherals.
Related Link:
digikey.com/en/maker/tutorials/2026/intro-to-embedded-rust-part-5-reading-from-an-i2c-temperature-sensor
Links:
Getting Started with STM32 and Nucleo: youtube.com/watch?v=hyZS2p1tW-g&list=PLEBQazB0HUyRYuzfi4clXsKUSgorErmBv
Introduction to Real-Time Operating Systems (RTOS): youtube.com/watch?v=F321087yYy4&list=PLEBQazB0HUyQ4hAPU1cJED6t3DU0h34bz
Raspberry Pi Pico 2: digikey.com/en/products/detail/raspberry-pi/SC1631/24627142
Learn more:
Maker.io - digikey.com/en/maker
DigiKey’s Blog – TheCircuit digikey.com/en/blog
Connect with DigiKey on Facebook facebook.com/digikey.electronics
And follow us on X: https://x.com/digikey
Product:
digikey.com/en/products/detail/raspberry-pi/SC1631/24627142
digikey.com/en/products/detail/raspberry-pi/SC1632/26241102
digikey.com/en/products/detail/raspberry-pi/SC1633/25862735
digikey.com/en/products/detail/raspberry-pi/SC1634/26241087
digikey.com/en/products/detail/sparkfun-electronics/13314/6797646
digikey.com/en/products/detail/lite-on-inc/LTL-4224/217584
digikey.com/en/products/detail/stackpole-electronics-inc/CF14JT220R/1830334
digikey.com/en/products/detail/te-connectivity-alcoswitch-switches/1825910-6/1632536
digikey.com/en/products/detail/dfrobot/FIT0096/7597069
digikey.com/en/products/detail/adafruit-industries-llc/1957/6827090
digikey.com/en/products/detail/cvilux-usa/DH-20M50055/13175849
Chapters:
0:00 Intro
0:45 Overview of TMP102 Temperature Sensor
3:14 Dependencies
4:00 Initialize Input Pin and I2C
13:11 Read and Print Temperature Value on Button Press
23:44 Build and Flash
25:24 Challenge and Reading Assignment
26:18 Conclusion

![Bin Buddy [Maker Update] | Maker.io
This week on Maker Update: robots that glide, robots that walk, a bouncy bike, and a blade that’s bewitched.
This week on Maker Update: robots that glide, robots that walk, a bouncy bike, and a blade that’s bewitched.
+Show Notes [Maker Update Ep.462]+
=Project of the Week=
I Built a Robot to Organize My Workbench by Engineezy 0:25
https://www.youtube.com/watch?v=iarVef8tFiw
=News=
NEW Robotic Olaf Revealed! Inside Disney Imagineering R&D 2:18
https://www.youtube.com/watch?v=EoPN02bmzrE
Event Sensors Bring Just the Right Data to Device Makers 3:16
https://spectrum.ieee.org/event-sensors-to-the-edge
=More Projects=
The Magnet Suspension Bike by Colin Furze 4:12
https://www.youtube.com/watch?v=kxs3yNjlzkg
Creating Xalatath, Blade of the Black Empire from World of Warcraft by KamuiCosplay 4:46
https://www.youtube.com/watch?v=5-2P4Uox9dY
=Tips & Tools=
I Built a Three Ring Cycloidal Drive by Mishin Machine 5:27
https://www.youtube.com/watch?v=WMgny-yDjvs
Tested Teams Favorite Things of 2025! 6:05
https://www.youtube.com/playlist?list=PLJtitKU0CAeisMlQwIK5-lWkIrVAqPXwY
Christmas Gift Ideas for People Who Like to Work! by Essential Craftsman 6:31
https://www.youtube.com/watch?v=bwTfxh16E80
=DigiKey Spotlight=
MTCH9010 Evaluation Kit - Unboxing 6:46
https://www.youtube.com/watch?v=q_IKWY9d2KI
Find it on DigiKey:
https://www.digikey.com/short/bv1r9m8b
#makerupdate
Maker Update is a weekly video series covering news, projects, tips, and events that interest the maker and DIY community.
Find more online:
Blog: http://makerprojectlab.com
Instagram: https://www.instagram.com/makerprojectlab/ Bin Buddy [Maker Update] | Maker.io](https://i.ytimg.com/vi/RyRfIybAwIA/mqdefault.jpg)






![Keep Your Chin Up [Maker Update] | Maker.io
This week on Maker Update: a robot with a walking neck, accessories for your Q, dice that go pew, and illuminated noodles for your ears.
+Show Notes [Maker Update Ep.478]+
=Project of the Week=
Stewy V2 by JD Robotics 0:28
https://www.jdrobotics.net/
=News=
A new 3GB Raspberry Pi 4 and more memory-driven price increases 2:39
https://www.raspberrypi.com/news/a-new-3gb-raspberry-pi-4-for-83-75-and-more-memory-driven-price-increases/
Shop Raspberry Pi on DigiKey
https://www.digikey.com/en/supplier-centers/raspberry-pi
New Arduino Uno Q Accessories 3:12
https://blog.arduino.cc/2026/03/27/we-just-announced-seven-new-products-ready-to-expand-your-arduino-uno-q-board/
Shop Arduino Uno Q on DigiKey
https://www.digikey.com/en/product-highlight/a/arduino/uno-q-microcontroller-board
FreeCAD Version 1.1 released 3:52
https://blog.freecad.org/2026/03/25/freecad-version-1-1-released/
=More Projects=
Space Dice by Oskitone 4:12
https://buttondown.com/oskitone/archive/space-dice/
Glowing LED Noodle Earrings by snowbiscuit 4:49
https://www.instructables.com/Glowing-LED-Noodle-Earrings/
=Tips & Tools=
How to Waterproof Electronics by Manafish ROV 5:21
https://www.youtube.com/watch?v=ybv1qv0HQHk
The Only LED Strip Soldering Tutorial Youll Ever Need by Will Donaldson 5:48
https://www.youtube.com/watch?v=98t4NzqtD3E
=DigiKey Spotlight=
Analog vs Digital Sensors - Another Teaching Moment 6:22
https://www.youtube.com/watch?v=i37Z1W1gopM
#makerupdate
Maker Update is a weekly video series covering news, projects, tips, and events that interest the maker and DIY community.
Find more online:
Blog: http://makerprojectlab.com
Instagram: https://www.instagram.com/makerprojectlab/ Keep Your Chin Up [Maker Update] | Maker.io](https://i.ytimg.com/vi/Txd-ll6OPo8/mqdefault.jpg)
![Learn Arduino With Tinkercad Circuits [Maker Update #Shorts]
Learn Arduino With Tinkercad Circuits [Maker Update #Shorts] Learn Arduino With Tinkercad Circuits [Maker Update #Shorts]](https://i.ytimg.com/vi/U63yPooIXDo/mqdefault.jpg)
