multiple LEDs/ multi ports

Status
Not open for further replies.

MrDEB

Well-Known Member
Planning on constructing a simple tempeture module that measures 4 refergerator temps.
wanting to add some spice to the mix. if say ref 1 temp is too cold a green LED flashes. If too warm, a red LED flashes.
thinking there's got to be a better way than using two ports for each ref. not that I don't have the room but ??
thinking an NPN and a PNP transistor connected to one port. port goes low or high thus lighting desired LED.
sounds like too much trouble, just use 8 ports?
even wondering if chariliplexing would work??
 

Attachments

  • temperature1.PNG
    36.4 KB · Views: 140
You can use direct drive from an I/O pin to light an LED so transistor drivers aren't really necessary.

You could use one pin to drive a red and green LED (four pins total for your 8 LEDs). Charlieplexing eight LEDs would require four pins so there's no advantage there.

You might also multiplex some of the LCD lines (D4 through D7 for example) with two I/O pins to drive eight LEDs...
 
Last edited:
Looking forward to actually connecting an LCD to a PIC. most of the schematics show 16 x 2 LCDs not 20 x 4
and what is pins 15 and 16 marked A and K?
in my schematic I connected the display as per 16 x 2 LCD. Need to configure for 20 x 4. pretty sure they are wired differently??
 
The A and K represent Anode and Kathode for your back light.
The 16 x 2 and 20 x 4 are wired the same way. They both have the same buffer size, and the 16 or 20 wide is only like a 'window' into the buffer. This 'window' shows the first 16 or 20 characters in the buffer.
You will have to look at the data sheet to find the address for line 3 and 4...
 
Last edited:
schematic progress

here is proposed power supply, all 4 sensors and 8 LEDs
the 7805 might be overkill but why skimp?
 

Attachments

  • temp pic sheet 2.PNG
    32.1 KB · Views: 132
  • temp pic sheet 1.PNG
    41.4 KB · Views: 152
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…