This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: RELAY CONTROL USING GPIO

Part Number: MSP432E401Y

Tool/software:

Dear TI Members,

I'm using MSP432E401Y micro controller in my customised board and trying to control the 12V relay by connecting the Micro controller's GPIO pin to the relay.

I want to control the relay by keeping the GPIO either in Ground state or in High impedance state.

Sample connection diagram is as shown in the below picture.

For keeping the GPIO to ground state, i'm using the  GPIO_write(Board_GPIO_PK0, GPIO_CFG_OUT_LOW);


and now i want to know how to keep the GPIO in high impedance state so that GPIO can be disconnected from the relay.


Regards
Kalyan.
  • Hi,

      Sorry for the delayed response as I'm currently out of office. Please beat in mind that the MCU can only drive 3.3v output. You need to have an external pull-up resistor to 3.3V and configure the GPIO in open drain mode. When the MCU drives a low state on the pin it will pull the pin to ground. At other times it is in high impedance and pull-up to 3.3V by the external resistor. 

  • Hello Charles,

    Thank you for the response.

    Unfortunately i don't have pull up resistor in my customized board. If i keep the GPIO in Oen drain with pull up resistor, will it work by using the functions

    GPIO_write(Board_GPIO_PK0, GPIO_CFG_OUT_LOW)

    &

    GPIO_write(Board_GPIO_PK0, GPIO_CFG_OUT_HIGH).

    Thanks & Regards

    Kalyan.

  • What does your relay input require? If it requires higher than 3.3V then it will not work. You will need a level shifter to shift the voltage from 3.3v to whatever the relay input requires.

  • Realy operates on 12V. However i have connected only the ground pin of the relay to GPIO so that the GPIO can be configured to etiher GND or Open.