3. After Hour 2021
Internet of Things
How does this all work?
• The devices expose a set of pins that you can program with eletrical pulse.
• Support for various protocols:
• GPIO
• PWM
• Serial protocols: SPI, I2C, I2S
• Device and sensor can be read and written to one or multiple of these devices and
associated protocols.
• Protocols support / required different numbers of wires/pins, daisy chaining,
communication speed and duplex options. Some are hardware-only and some come
written in software.
• .NET has APIs to drive these and interact with devices that reqire theme.
5. After Hour 2021
Internet of Things
Goals for .NET and IoT
• Enable .NET Developers to create IoT applications with existing skill
and code.
• Enable companies to build IoT hardware and attract .NET developers.
• Enable the Azure team to be succesful building IoT services.
• Primary commercial scenario
• Edge gateway
• Web Api in small places
• LED dashboard
6. After Hour 2021
Internet of Things
What we have in the .Net (Core/5/6)
• Full integration with Azure services (IoT Hub, IoT Edge)
• ARM32 and ARM64 Runtime and SDK build:
• Ubuntu 16.04+, Debian 9+, Alpine 3.9+
• Windows 1809+
• Docker images
• API for all the major IoT Device protocols: GPIO, PWM, SPI, I2C, …
• Device binding for a growing set of peripherals
7. After Hour 2021
Internet of Things
Libraries
• GPIO APIs: System.Device.Gpio
• Device bindings: IoT.Device.Bindings
• Source: dotnet/iot
8. After Hour 2021
Internet of Things
System.Device.Gpio library and
tests which is the main library that
has the implementation for
protocols such as: GPIO, SPI, I2C,
PWM. This library is fully
supported by the dotnet team
since it has the same level of
support that dotnet/corefx does.
IoT.Device.Bindings device
bindings library. This is a
collection of types which work as
wrappers (or bindings) for devices
and sensors which are able to talk
to a microcontroller unit (or MCU
like a Raspberry Pi for example)
using the protocols supported by
System.Device.Gpio.
9. After Hour 2021
Internet of Things
Analog/Digital converters
•Adafruit Seesaw - extension board (ADC, PWM, GPIO expander)
•ADS1115 - Analog to Digital Converter
•INA219 - Bidirectional Current/Power Monitor
•Mcp3428 - Analog to Digital Converter (I2C)
•MCP3xxx family of Analog to Digital Converters
Accelerometers
•ADXL345 - Accelerometer
•BNO055 - inertial measurement unit
•LSM9DS1 - 3D accelerometer, gyroscope and magnetometer
•MPU6500/MPU9250 - Gyroscope, Accelerometer, Temperature and Magnetometer (MPU9250 only)
•Sense HAT
Gas sensors
•AGS01DB - MEMS VOC Gas Sensor
•BMxx80 Device Family
•CCS811 Gas sensor
•MH-Z19B CO2-Sensor
Liquid sensors
•Digital liquid level switch
•μFire ISE Probe - pH, ORP and temperature sensor
Light sensor
•Bh1745 - RGB Sensor
•BH1750FVI - Ambient Light Sensor
•MAX44009 - Ambient Light Sensor
•TCS3472x Sensors
Barometers
•BMP180 - barometer, altitude and temperature sensor
•BMxx80 Device Family
•LPS25H - Piezoresistive pressure and thermometer sensor
•Sense HAT
Altimeters
BMP180 - barometer, altitude and temperature sensor
BMxx80 Device Family
Thermometers
AHT10/15/20 - Temperature and humidity sensor modules
BMP180 - barometer, altitude and temperature sensor
BMxx80 Device Family
Cpu Temperature
DHTxx - Digital-Output Relative Humidity & Temperature Sensor Module
HTS221 - Capacitive digital sensor for relative humidity and temperature
LM75 - Digital Temperature Sensor
LPS25H - Piezoresistive pressure and thermometer sensor
MCP9808 - Digital Temperature Sensor
MLX90614 - Infra Red Thermometer
MPU6500/MPU9250 - Gyroscope, Accelerometer, Temperature and Magnetometer (MPU9250 only)
OpenHardwareMonitor client library
Sense HAT
SHT3x - Temperature & Humidity Sensor
SHTC3 - Temperature & Humidity Sensor
Si7021 - Temperature & Humidity Sensor
μFire ISE Probe - pH, ORP and temperature sensor
Gyroscopes
BNO055 - inertial measurement unit
LSM9DS1 - 3D accelerometer, gyroscope and magnetometer
MPU6500/MPU9250 - Gyroscope, Accelerometer, Temperature and Magnetometer (MPU9250 only)
Sense HAT
Compasses
BNO055 - inertial measurement unit
HMC5883L - 3 Axis Digital Compass
Lego related devices
BrickPi3
Motor controllers/drivers
28BYJ-48 Stepper Motor 5V 4-Phase 5-Wire & ULN2003 Driver Board
DC Motor Controller
Explorer HAT Pro (Pimoroni)
MotorHat
Servo Motor
10. After Hour 2021
Internet of Things
Inertial Measurement Units
BNO055 - inertial measurement unit
LSM9DS1 - 3D accelerometer, gyroscope and magnetometer
MPU6500/MPU9250 - Gyroscope, Accelerometer, Temperature and Magnetometer (MPU9250 only)
Sense HAT
Magnetometers
AK8963 - Magnetometer
BNO055 - inertial measurement unit
HMC5883L - 3 Axis Digital Compass
LSM9DS1 - 3D accelerometer, gyroscope and magnetometer
MPU6500/MPU9250 - Gyroscope, Accelerometer, Temperature and Magnetometer (MPU9250 only)
Sense HAT
Hygrometers
AHT10/15/20 - Temperature and humidity sensor modules
BMxx80 Device Family
DHTxx - Digital-Output Relative Humidity & Temperature Sensor Module
HTS221 - Capacitive digital sensor for relative humidity and temperature
Sense HAT
SHT3x - Temperature & Humidity Sensor
SHTC3 - Temperature & Humidity Sensor
Si7021 - Temperature & Humidity Sensor
Clocks
Realtime Clock
Sonars
HC-SR04 - Ultrasonic Ranging Module
Distance sensors
HC-SR04 - Ultrasonic Ranging Module
VL53L0X - distance sensor
Passive InfraRed (motion) sensors
HC-SR501 - PIR Motion Sensor
Motion sensors
HC-SR501 - PIR Motion Sensor
Displays
Adafruit Seesaw - extension board (ADC, PWM, GPIO expander)
APA102 - Double line transmission integrated control LED
Character LCD (Liquid Crystal Display)
Max7219 (LED Matrix driver)
RGBLedMatrix - RGB LED Matrix
Segment display driver (HT16K33)
Sense HAT
Solomon Systech Ssd1306 OLED display
Solomon Systech Ssd1351 - CMOS OLED
TM1637 - Segment Display
Ws28xx LED drivers
GPIO Expanders
Adafruit Seesaw - extension board (ADC, PWM, GPIO expander)
Mcp23xxx - I/O Expander device family
NXP/TI PCx857x
Pca95x4 - I2C GPIO Expander
CAN BUS libraries/modules
Mcp25xxx device family - CAN bus
SocketCan - CAN BUS library (Linux only)
Proximity sensors
MPR121 - Proximity Capacitive Touch Sensor Controller
Touch sensors
Adafruit Seesaw - extension board (ADC, PWM, GPIO expander)
MPR121 - Proximity Capacitive Touch Sensor Controller
Wireless communication modules
nRF24L01 - Single Chip 2.4 GHz Transceiver
Radio Receiver
Radio Transmitter
Joysticks
Sense HAT
11. After Hour 2021
Internet of Things
Color sensors
TCS3472x Sensors
LED drivers
Adafruit Seesaw - extension board (ADC, PWM, GPIO expander)
APA102 - Double line transmission integrated control LED
Explorer HAT Pro (Pimoroni)
On-board LED driver
Segment display driver (HT16K33)
Ws28xx LED drivers
RFID/NFC modules
PN5180 - RFID and NFC reader
PN532 - RFID and NFC reader
RFID shared elements
Media libraries
Buzzer - Piezo Buzzer Controller
Still image recording library
USB devices
SPI, GPIO and I2C drivers for FT4222
GPIO or bit operating devices
Charlieplex Segment binding
Digital liquid level switch
Generic shift register
MBI5027 -- 16-bit shift register with error detection
Quadrature Rotary Encoder
SN74HC595 -- 8-bit shift register
Multi-device or robot kit
GoPiGo3
GrovePi
Sense HAT
Protocols providers/libraries
1-wire
Adafruit Seesaw - extension board (ADC, PWM, GPIO expander)
MotorHat
Pca9685 - I2C PWM Driver
Software PWM
Software SPI
SPI, GPIO and I2C drivers for FT4222
12. After Hour 2021
Internet of Things
Sample
GpioController controller = new GpioController(PinNumberingScheme.Board);
var pin = 37;
var lightTime = 300;
controller.OpenPin(pin, PinMode.Output);
try
{
while (true)
{
controller.Write(pin, PinValue.High);
Thread.Sleep(lightTime);
controller.Write(pin, PinValue.Low);
Thread.Sleep(lightTime);
}
}
finally
{
controller.ClosePin(pin);
} LibGpiodDriver
SysFsDriver
14. After Hour 2021
Internet of Things
Who I am
Mirco Vanini
Microsoft® MVP Windows Development
myContactInfo:
{
“e-mail”: “mirco.vanini@proxsoft.it”,
“web”: “www.proxsoft.it”,
“twitter”: “@MircoVanini”
}
.NET
your platform for building anything