Control the LCD ST7735 Backlight Brightness Using PWM With Arduino

by RonFrtek in Circuits > Arduino

359 Views, 1 Favorites, 0 Comments

Control the LCD ST7735 Backlight Brightness Using PWM With Arduino

Control the LCD ST7735 Backlight Brightness Using PWM With Arduino

In this tutorial we are going to change the ST7735 SPI LCD Backlight brightness using a potentiometer & Arduino.

Watch the video!

What You Will Need

st7735-.jpg
pctdetail.775-114.1.jpg
breadboard.png
VisuinoAdvrtisemenESPNowESP32C3-1.jpg
jumper-wires.jpg
arduino.jpg
68 ohm Resistor.jpg
  • Arduino UNO (Or any other Arduino)
  • LCD Display TFT 7735
  • Potentiometer module
  • 68 ohm Resistor (LCD Backlight draws around 30mA)
  • Jumper wires
  • Breadboard
  • Visuino program: Download Visuino

Brought by PCBWay

2022-08-26_13-41-18.jpg

Thank you PCBWay for supporting this tutorial and helping users learn more about electronics.

What I like about the PCBWay is that you can get 10 boards for approximately $5 which is really cost effective for professional made boards, not to mention how much time you save!

Go check them out here. They also offer a lot of other stuff in case you might need it like assembly3D printingCNC machining and a lot more.

The Circuit

2022-10-20_9-34-26.jpg

LCD TFT ST7735

Connect:

  • Arduino PWM Digital PIN [3] to 68ohm Resistor
  • 1.8 TFT Display PIN [LED] to 68ohm Resistor
  • 1.8 TFT Display PIN [SCK] to Arduino PIN [13]
  • 1.8 TFT Display PIN [SDA] to Arduino PIN [11]
  • 1.8 TFT Display PIN [A0 or DC] to Arduino PIN [9]
  • 1.8 TFT Display PIN [RESET] to Arduino PIN [8]
  • 1.8 TFT Display PIN [CS] to Arduino PIN [10]
  • 1.8 TFT Display PIN [GND] to Arduino PIN [GND]
  • 1.8 TFT Display PIN [VCC] to Arduino PIN [5V]

NOTE: Some Arduino boards have different SPI pins so make sure you check your board documentation.

  • Connect potentiometer pin [DTA] to arduino analog pin [A0]
  • Connect potentiometer pin [VCC] to arduino pin [5V]
  • Connect potentiometer pin [GND] to arduino pin [GND]

Start Visuino, and Select the Arduino UNO Board Type

FD9ZV5DKU43CVCH.jpg
Visuino-Select-Board-UNO.jpg

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino Add & Set Components

FLT0YE1L7UHNFCS.jpg
2022-10-13_16-02-57.jpg
2022-10-13_16-03-18.jpg
2022-10-13_16-03-54.jpg
2022-10-13_16-04-14.jpg
  • Add "TFT Color Display ST7735" component

Note: In case the display would not work try changing the Type under the properties window

  • Double click on the "Display1" and in the "Elements" window 
  • Drag "Draw Text" to the left side and in the properties window set "Size to 3, "Text" to HELLO and "Y" to 20
  • Drag "Draw Bitmap" to the left side and in the properties window set "Y" to 50 and select "Bitmap" and click on the 3 dots button
  • In the "Bitmap Editor" click on the "Load" button and load the bitmap file in this case it was Visuino-logo.png
  • Click "Ok" button to Close the "Bitmap Editor" window 
  • Close the "Elements" window 


In Visuino Connect Components

2022-10-20_9-42-58.jpg
2022-10-20_9-42-42.jpg
  • Connect "Display1" component pin [Out] to Arduino pin SPI [In]
  • Connect "Display1" component pin [Chip Select] to Arduino Digital pin[10]
  • Connect "Display1" component pin [Reset] to Arduino Digital pin[8]
  • Connect "Display1" component pin [Data Command] to Arduino Digital pin[9]
  • Connect Arduino Analog pin [0] to Arduino digital pin [3]

Generate, Compile, and Upload the Arduino Code

2020-10-30_13-20-50.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Arduino UNO module, and change the potentiometer the LCD will start to change its brightness.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here and open it in Visuino: https://www.visuino.eu