71. AT Command System via UART

Connect a potentiometer and an LED to the microcontroller as shown in the image below.

Example using Arduino UNO:

 

Build a system where the microcontroller communicates over UART and responds to specific AT commands received from a serial terminal (e.g., PuTTY, Arduino IDE Serial Monitor).

The microcontroller should:

  • Continuously listen for AT commands via UART.
  • Perform actions based on the received commands (e.g., read potentiometer value, turn LED ON/OFF).
  • Send appropriate responses back to the serial terminal, as defined in the AT command table.

Refer to the AT command table below for the list of supported commands and their corresponding actions/responses.

AT-command table

Sr.NoAT CommandsActionResponse to command
1.AT-OK
2.AT+LED=ONTurn ON LED+LED:”ON”
3.AT+LED=OFFTurn OFF LED+LED:”OFF”
4.AT+SYS_ON_TIME?The Arduino was powered on.+SYS+ON+TIME:”HH:MM:SS”
5.AT+LED_STATUS?Check LED is ON or OFF and respond

+LED_STATUS:”ON”

or

+LED_STATUS:”OFF”

6.AT+ADC_VALUE?Read ADC value & respond

+ADC_VALUE: <value>

range of <value> is 0 to 1023 (adc value)

7.AT+ADC_VOLTAGE?Read Voltage on ADC pin and respond

+ADC_VOLTAGE: <value>

range of <value> is 0 to 5

 

Submit Your Solution

Note: Once submitted, your solution goes public, helping others learn from your approach!