Embedded Serial Buses

HackadayU course all about serial buses! Part 1 includes I2C and 1-Wire.

Instructors AlexanderAlexander
Wednesday, September 30, 2020 08:00 am PDT Local time zone:
Register for this course
Similar projects worth following

Course Overview

Attendees of this course will learn how serial communication works, as well as the most common standardised protocols for serial communication. In Part 1 of this course, we will be covering I2C and 1-Wire. Hardware is not required to succeed with this course, but students are encouraged to try out examples and/or play around with the material presented in class. Remember, using skills is what sharpens them!


I2C is an extremely common serial bus standard developed by Phillips in the 1980s. It is the most common bus used for communicating with sensors and EEPROMs. There is a lot more to the I2C bus than meets the eye. It's a multi-controller, multi-peripheral bus with in-built arbitration and signalling. Extensions to the original standard have allowed for faster transfer speeds and an increased address space. A derived standard called SMBus is widely used on computer motherboards for temperature sensors, fan sensors, and more. We will examine the differences between I2C and SMBus, but the focus of the course will be on I2C.


1-Wire is, as the name suggests, a bi-directional serial protocol that uses only one wire for communication. This single wire can also be used to power the device, meaning a sensor can be powered and communicated with over just 2 wires! The standard only allows for one controller, but a huge number of peripherals. Sensors and EEPROMs are also quite common. The hardware is similar to I2C, which is why these two have been grouped together in Part 1.

Goals of this course

We will be taking a close look at who developed these standards; why they were developed; why they became popular; how they work at multiple layers (hardware, protocol, software); and we will examine common use cases as well as example code. Example libraries will be briefly covered, as well as how to find more information if needed.

After completion of this course, you will be ready to tackle any project that uses these serial bus standards!

Hardware/Software Requirements

Though not necessary, a wide range of hardware can be used to implement the things you learn in this course. Almost any development board will work -- Arduino, BeagleBone, Adafruit Feathers/Trinkets, Teensy, MSP430, PIC32, ESP8266/ESP32. Any microcontroller will do, even those without hardware support for I2C or 1-Wire. This course will be providing sample code for the MSP430F5529 Launchpad, which you can get from Digikey for under $20. Adafruit has an ATMEGA 328p development board for just $12.95 which supports hardware I2C and SPI. It's programmable with Arduino, which makes getting up to speed quite easy. Or, if you want to support other hackers from around the world, Tindie has literally hundreds and hundreds of development boards that you can use! A personal favourite is the Ladybug STM32 Development Board.

Again, I would stress that it's not necessary to complete the course and succeed in using these skills in the future, but practical applications will boost your confidence and sharpen your skills!


Slides for week 3!

presentation - 481.43 kB - 09/24/2020 at 23:21


PulseView file for the week 2 SHT21 transaction example

session - 2.38 kB - 09/13/2020 at 17:34


PulseView file for the week 1 I2C EEPROM example

session - 5.48 kB - 09/13/2020 at 17:34



Slides for week 2!

presentation - 861.24 kB - 09/13/2020 at 17:34



These are the slides for the first week of the course!

presentation - 34.64 MB - 09/09/2020 at 20:35


  • Update for SHT31 Users!

    Alexander6 days ago 0 comments

    The suggested sensor add-on board for this course actually uses a different command set to the SHT21 and SHT11 (my bad, I shouldn't have assumed).

    So, there is a new branch on the Git repo called "sht31" that contains example code for use with the SHT31. I don't have an SHT31 handy to test with, so if you find any bugs, feel free to submit pull requests, or just file it as an issue and I will fix it!

    Apologies to those who were wondering why the code wasn't working - this is all on me.

View course log

Enjoy this course?



kirby.james wrote 09/18/2020 at 10:40 point

Hi Alexander, Are the C++ source files available for Lesson 2? ta Kirby

  Are you sure? yes | no

Alexander wrote 6 days ago point

Yes they are, at
The example code for week 2 is in the sht21 or sht31 branches, depending on which version of the sensor you got.

  Are you sure? yes | no

Alexander wrote 09/18/2020 at 00:17 point

If you have any questions at all, please post them here so everyone can see the questions and answers!

  Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates