You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.6 KiB
Markdown

# I2C Component
- I2C Modules
| Item | Board | Chipset | Address |
| --------------------------------------- | ---------- | ----------- | ----------------------------------------- |
| 3-Axis Magnetic Electronic Compass | GY271 | HMC5883L | 0x1E |
| 3-Axis Magnetometer Acceleration Sensor | GY-LSM303C | LSM 303C | accelerometer : 0x1D, magnetometer : 0x1E |
| Infrared Temperature Sensor | GY-906 | MLX90614ESF | 0x5A |
| 0.91' OLED Display (128 x 32) | Generic | SSD1306 | 0x3C |
- Datasheet
- [HMC5883L](https://cdn-shop.adafruit.com/datasheets/HMC5883L_3-Axis_Digital_Compass_IC.pdf)
- [LSM303C](https://www.mouser.com/datasheet/2/389/lsm303agr-954987.pdf)
- [MLX90614ESF](https://www.melexis.com/-/media/files/documents/datasheets/mlx90614-datasheet-melexis.pdf)
* Schematic
- [LSM303C](https://www.tme.eu/Document/3efb39d16e2f2e2f9f16bb5c89784b47/POLOLU-2127.pdf)
- [Adafruit LSM303C](https://learn.adafruit.com/lsm303-accelerometer-slash-compass-breakout?view=all)
- Arduino Library
- [GY271](.\arduino-lib\Mecha_QMC5883L)
- [GY-906](https://github.com/adafruit/Adafruit-MLX90614-Library)
- Adafruit [SSD-1306](https://github.com/adafruit/Adafruit_SSD1306)
+ need to change below to `LED_BUILTIN` due to conflict with esp8266 i2c (Pin4 - sda / 5 - scl)
```
#define OLED_RESET LED_BUILTIN //4
```
- Tutorial
- [GY271](https://www.instructables.com/id/Tutorial-to-Interface-HMC-5833L-With-Arduino-Uno/)
- [GY-LSM303C](https://learn.adafruit.com/lsm303-accelerometer-slash-compass-breakout/coding)
- [GY-906](https://create.arduino.cc/projecthub/SurtrTech/contactless-temperature-sensor-mlx90614-1e7bc7)
- ESP8266
- Software controlled
- pin assignment defined
```
C:\Users\<user>\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.7.4\variants
```
- SCL / SDA pinout
| Description | SCL | SDA | Remark |
| --------------- | ------------- | ----- | ---------------------------------- |
| Official | MTMS (GPIO14) | GPIO2 |
| Try | GPIO0 | GPIO2 |
| generic esp8266 | GPIO5 | GPIO4 | Wire() Default for generic esp8266 |
- The change Wire default, update begin(SDA, SCL)
```
Wire.begin(2, 0)
```
- ESP32
- Hardware Controlled
- Pinout
| Description | SCL | SDA | Remark |
| ----------- | ------ | ------ | ------- |
| Official | GPIO22 | GPIO21 | Default |