An 8 Bit Inter Integrated Circuit ( I2c )

876 WordsDec 6, 20154 Pages
The PCF8574AN is an 8-bit inter-integrated circuit (I2C) bus input/output (I/O) expander. This chip allows more I/O in the system. The I2C bus is a network which contains a master and slave. For this project the master is the Raspberry Pi and the slave is the I/O expander chip. The two communicate via the data and clock lines. The slave has an additional address so that the master can identify it in the network if there were more slaves. The HC-SR04 module is a distance sensor which utilises ultrasonic signal to conduct its readings. From the datasheet, it has range of 2cm to 400cm and it uses 40kHz sound waves2. The ‘Trig’ pin (input) is used to trigger an ultrasonic pulse, while the ‘Echo’ pin (output) produces a signal when the pulse is detected. The ‘Vcc’ pin is connected to 5V and the ‘GND’ is connected to the ground pin. The module was connected as shown in Figure 1b and ran the python program ‘project D’ to test the distance measurement. This program outputs the distance detected by the HC-SRO4. The voltage signal from the ‘Trig’ and ‘Echo’ pins were connected to an oscilloscope through different channels and the amplitude and timing were compared. It could be seen that signal for the ‘Trig’ has amplitude of 5V and occurs immediately before the ‘Echo’, which had an amplitude of ≈ 2V. The ‘Echo’ pin normally produces a voltage of 5V, but with the addition of the 1k resistor, the output voltage is lowered to about 2V. The resistor is there to protect the GPIO pins
Open Document