This project is used to verify the module design of the Lichuang Mall analog-to-digital conversion chip/MCP3221A5T-I/OT ([Mall No. C36310](https://item.szlcsc.com/37288.html)).
There is an ALS-PT19-315C/L177/TR8 ambient light sensor onboard ([Mall No. C146233](https://item.szlcsc.com/157565.html)).
Compatible with MCP3221A0T-E/OT ([Mall No. C150795](https://item.szlcsc.com/162135.html)), the IIC address is different.
When the jmp pad is short-circuited, AIN is connected to the onboard PT19. When jmp is disconnected, AIN is connected externally. If only external AIN is used, R4, R5, H2, and H3 can be soldered without air. Or do not solder PT19, short-circuit the solder at R4 position, and use R5 to adjust the AIN input voltage.
After testing, when PT19 is connected, the read voltage is consistent with the test reading of the multimeter, but it is greatly affected by the internal resistance of the multimeter.
### [nadavmatalon’s arduino library](https://github.com/nadavmatalon/MCP3221)
Part of the content is translated as follows
## I2C address
Each MCP3221 has 8 possible I2C addresses (can be determined by the component model and package Tag identification):
| Model | Binary | Hex | Decimal | Tag |
| --- | --- | ---- | --- | --- |
| MCP3221A0T-E/OT | 01001000 | 0x48 | 72 | GE |
| MCP3221A1T-E/OT | 01001001 | 0x49 | 73 | GH |
| MCP3221A2T-E/OT | 01001010 | 0x4A | 74 | GB
|
| MCP3221A4T-E/OT | 01001100 | 0x4C | 76 | GD |
| MCP3221A5T-E/OT | 01001101 | 0x4D | 77 | GA |
-E
/ OT | 01001111 | 0x4F | 79 | GG |
## The test program
included with the test program uses the Arduino platform, the development board is nodemcu, and uses the serial port to output AIN to read data. If you use the original MCP3221 library, you will be prompted that it can only run on the avr chip. Delete the prompt statement and it will not affect the use.
The modified library files are already included in the project folder and do not need to be installed. If a file name conflict occurs, please modify the header file name and corresponding include settings in the project folder.
![209ED08CCF1EB6440F5F02B20CD88B21.jpg]