Wednesday, July 6, 2022

Friday, April 1, 2022

PCA9535 GPIO Expander

PCA9535 is a GPIO expander with 16 IO lines which has I2C bus interface. It provides additional IOs for I2C bus master such as SBC or MCU that can be used to read push button or sensor, to control LED, etc. PCA9555 is identical to PCA9535 except the presence of internal pull-up resistor which increases power consumption when the IOs are low. PCA9535C is another variation of PCA9535 with open drain outputs. Its operating supply voltage range is 2.3V to 5.5V. There are 3 hardware pins which allow to use 8 different I2C bus addresses, from 0x20 to 0x27.

Tuesday, October 5, 2021

16 Channel RS485 Modbus Relay Board

Controlling a 16 channel RS485 Modbus relay board is discussed in this post. The board needs to be powered with a 12V power supply. It has has a DIP switch to set its ID. If only the switch 1 is on and others are off, its ID will be 1. To communicate the board from a PC, a USB to RS485 converter can be used. The setup is illustrated in the following figure.

Figure 1. RS485 relay board using 12 V power supply, and a USB converter.

Alternatively, you can use a USB UART adapter together with a UART to RS485 converter. Wire connection for this setup is shown below.

Figure 2. Wire connection for UART to RS485 converter.

Unlike conventional RS485 devices, these devices do not have the control line for transmit or receive. They use autoflow control as shown below.

Figure 3. RS485 autoflow control.

Friday, September 17, 2021

V4L2 Capturing as Bitmap Image

V4L2 (Video for Linux 2) consists of drivers and API for video capturing on Linux [1]. In this article, we will discuss about using the library and analysis of video capture example. There are utilities for controlling media devices on Linux called v4l-utils [2]. We will explore about using and testing webcam with them also.

Wednesday, July 7, 2021

Wednesday, April 7, 2021