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.

CCS/EK-TM4C123GXL: interface TM4C123G6PM with soil moisture sensor and relay

Part Number: EK-TM4C123GXL

Tool/software: Code Composer Studio

I am trying to interface tm4c123g6pm with  soil moisture sensor and cc31000 module. i am done with the cc31000 module code and output but not able to interface it with soil moisture sensor. could you please guide me regarding the code and pin no of tm4c123g6pm i should use to interface it correctly.

Also soil moisture sensor needs power supply of 5v and tm4c gives 3.3v. so can i use 3.3v of tm4c to give power supply to soil moisture sensor?

Like soil moisture sensor i am also using a 5v relay to drive a pump. Can i drive 5v relay with tm4c output?

  • 5295309 said:
    Also soil moisture sensor needs power supply of 5v and tm4c gives 3.3v. so can i use 3.3v of tm4c to give power supply to soil moisture sensor?


    No, you cannot do it. 
    If your soil moisture sensor has digital output, a voltage logic translator should help. 
    In case of an analog output, an interface should be designed. Resistor voltage divider could be enough however, an OpAmp solution would be better.

    5295309 said:
    Like soil moisture sensor i am also using a 5v relay to drive a pump. Can i drive 5v relay with tm4c output?


    Your MCU provides 25 mA as maximum current per output pin.
    Is it enough for your relay?
    What about an inductance and the current spikes when switching the relay on?
    If you decide to use a transistor to drive the relay, you would need to eliminate the voltage spikes turning the relay off.

    5295309 said:
    could you please guide me regarding the code and pin no of tm4c123g6pm i should use to interface it correctly.


    Please, refer to the blinky example form TivaWare_C_Series on how to swith on/off a gpio port.