3 Conclusion

The MSSP peripheral on PIC® microcontrollers can be configured in I2C mode to create a water monitoring system. Although this system consists of one master and two slaves, additional sensors can be easily added to the project. A new slave project can be added for each sensor and the master project files can be updated to add the new slave address, as well as any necessary calculations. This project also provides the technique required to convert a 24-bit floating-point variable into three integer bytes that can be transmitted over the I2C bus, and then back into a floating-point variable for display.

Figure 3-1. Complete Application