Pages: [1]   Go Down
Author Topic: Backlight control by PWM help  (Read 1081 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys i have a 20x4 LCD which i am matching with a web4robot serial backpack

i want the LCD backlight to be controlled by my pin 3... can anyone help me out here with the code? i can post the code or something maybe you guys can review it and see how to add the backlight control
any volunteers ?  smiley-grin
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think the code is going to be a big problem -- basically just call analogWrite() with the value that you want.

The bigger question is what hardware you had in mind for interfacing pin 3 with the backlight LED. Here is our suggestion:

http://ruggedcircuits.com/html/circuit__30.html

--
The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Really? i didnt know controlling the backlight led would require such a circuit
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well now i guess i have a diffferent question, as for the pins from the backpack that go into the 16 pins of the LCD.. do i remove the 15 and 16 and wire them for the PWM control from pin 3 or do i leave them in and solder wires of the back or something ? does the backpack need the pins ? im a little confused as why they wouldnt have a backlight pin on the backpack

http://www.web4robot.com/files/SerialLCDCtrl.pdf
Logged

ca
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://forums.adafruit.com/viewtopic.php?f=25&t=16478

Code:
                               LCD Pin 16          +5V
                                |                   |     
                                |                   |     
                       1k      /               LCD Pin 15         
Arduino digital pin -/\/\/\---| npn
                               \
                                |
                                |
                               GND
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

okay so basical a 1k from pin 3 to pin 16 on the display and the must be grounded...put the pin 16 on 5v

but still doesnt answer the question of does the head pins need to be removed from 15 and 16 on the backpack?
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I used the same circuit with 2K resistor.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what do i do with the headers for those pins? pull them out ?
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

what do i do with the headers for those pins? pull them out ?

A picture of the module would be nice.

I assume you meant the headers on the LCD module. Pulling them out will be very difficult if the entire row is soldered on and then the LCD is soldered on to a backpack or PCB. You can try this if you want:

User a desoldering iron or solder wick to remove solder from the LCD side and the back pack side. Then use pliers to squeeze the pins up and pull them up until they come out. The plastic holding the pins is not very strong so you can use the pliers to squeeze the pins if all solder is removed.

A back up plan is to seek the trace on the PCB and see if you can cut them. Chances are that one of them probably is connected to a ground plane, a bit hard to cut.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nothing is in place or soldered, im just not sure if the backpack will function with out the pins and or if i should leave them in...the backpack states The LDC backlight and contrast may be adjusted under program control to compensate for
differing lighting conditions and viewing angles. so im guessing it can be but im not sure how
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm glad I read that manual. On page 8 it has two commands to set back light brightness and set contrast so there is no need for external circuit to do either, just use commands.
Logged


Pages: [1]   Go Up
Jump to: