Control The Lcd St7735 Backlight Brightness Using Pwm

About the project

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

Project info

Difficulty: Easy

Platforms: ArduinoVisuino

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Through Hole Resistor, 68 ohm Through Hole Resistor, 68 ohm x 1
Breadboard (generic) Breadboard (generic) x 1
Jumper wires (generic) Jumper wires (generic) x 1
ST7735 Display ST7735 Display x 1
Potentiometer, Slide Potentiometer, Slide x 1

Software apps and online services

Visuino Visuino
Arduino IDE Arduino IDE

Story

Step 1: What You Will Need

1 / 6

  • 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

Step 2: 


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.


Step 3: The Circuit

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]

Step 4: Start Visuino, and Select the Arduino UNO Board Type

1 / 2

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

Step 5: In Visuino Add & Set Components

1 / 6

  • 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

Step 6: In Visuino Connect Components

1 / 2

  • 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]

Step 7: Generate, Compile, and Upload the Arduino Code

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.

Step 8: 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

Schematics, diagrams and documents

Visuino File

Code

Visuino File

Credits

Photo of Ron

Ron

Arduino Developer

   

Leave your feedback...