Electronics Temperature dependent bicolor LED

Discussion in 'Modding' started by Risky, 8 Jul 2004.

  1. Risky

    Risky Modder

    Joined:
    10 Sep 2001
    Posts:
    4,386
    Likes Received:
    113
    (Well actually it might be two seperate LEDs but shouldn't matter).

    I've got myself a res that could be lit, but I like my lights to mean something so I wondered if I could bet it temperature dependent so, say, Blue was full-on below 25C and Red over 35C with Blue off and a corresponding variable level between them.

    In other words, for a given temp range can I have one output voltage proportional and one inverse and, um, how? My only thought was using sepeate circuits with NTP and PTC thermistors but I'm not sure I'm heading the right way yet.

    There seems to have been some threads in the past on temp-dependent LED brightness but I couldn't quite find anything that ended up with a circuit?
     
    Last edited: 8 Jul 2004
  2. Skylined

    Skylined Minimodder

    Joined:
    3 May 2003
    Posts:
    1,146
    Likes Received:
    0
    Temperature of your CPU?
    If it's that, I would write a soft and I wouldn't control those LEDs with the parallel port.
     
  3. Xiachunyi

    Xiachunyi What's a Dremel?

    Joined:
    3 Nov 2003
    Posts:
    1,404
    Likes Received:
    0
    A comparator with inverting logic to one and non-inverting to another would do nicely.
     
  4. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    Yes google op-amp comparator.

    If you find its toggling back n forth too fast between your threshold temp state, you could use a schmitt trigger.
     
  5. Risky

    Risky Modder

    Joined:
    10 Sep 2001
    Posts:
    4,386
    Likes Received:
    113
    Nope, water temperature, I thought.

    I'm having a google now but I think I have some learning to do.

    I'm not going for a toggle at the threshold level but hoping for variable voltage to the diode within a range.
     
  6. Skylined

    Skylined Minimodder

    Joined:
    3 May 2003
    Posts:
    1,146
    Likes Received:
    0
    I have an idea.

    Get a thermistor, put it at the temp you want, measure its resistance.
    Then get a resistor with that resistance and use a comparator to compare between that fixed resistance and thermistor's resistance. :)

    Think about the rest of the circuit, but do you get my idea?
     
  7. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    It's very near to a simple logic probe layout, with the leds in series across the power lines and an opamp or logic output to the middle. But getting
    is a 3-pipe problem... :confused:

    Temp-controlled PWM duty-cycle is one answer :idea:
     
  8. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
    use a PIC? one of the 12 series should be more than enough... (they don't have PWM though..)

    16F628 should have what you want i think...

    (ah! i need to get around learning assembler in near future! No time :wallbash: )
     
  9. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    the 628 assuming u used it's comparitor (had an external veriable resitor say).

    But the 675 would be what i would go for (and therefore un-questionably better), using the internal ADC.
     
  10. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    LM324 costs less than a packet of crisps and you don't have to be a Mekon to use them. :p
     
  11. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    Certainly the 675 would be my tool of choice. And creating your own PWM code is very simple. £1.50 or whatever is hardly breaking the bank either, considering you're not really going to need any other components.
     
  12. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
    hmm.. i thought the PIC must have some special function to ba eble to use PWM... therefore i suggested something else...

    what's the "bulidt in PWM" ting all about then? :confused:
     
  13. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    if you want to do PWM in code, you end up taking up proccessor time.
    you either use a TMR interupt, or have a

    loop
    sleep/do somthing
    pulse
    goto loop

    both of which in a complex project are not desirable. As such microchip have the PWM feature of the CCP module. This means you can just set the value in the register and it automatically PWM's it for you, nice n lazy :)
     
  14. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    If you end up really struggling with trying to fit PWM code in with a complex project, another easy option is to have a separate PIC dedicated to PWMing all the outputs and use serial communications between the main PIC and your PWM PIC. That way you could have 30+ different PWM channels without using very much processor power at all. Though really, it shouldn't be too difficult to get everything onto one PIC if you plan your code properly.
     
  15. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
    ah... i see... so it's just basicly to save resources if you have a complucated code? nice... mabye i can make my nice little RGB program with a 675 after all then :D
     
  16. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    Yep. That was my first use for the 12F629 :thumb:
     
  17. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    indeed stevey, i think its for the C lovers.
     
  18. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    I don't see no schematic & code that a piccy n00b like me could use... :worried:

    [​IMG]

    1 LM324
    7 resistors (inc 2 led resistors)
    1 trimpot
    2-3 caps (inc smoothing)
    1 thermistor
    bicolor led or 2 leds
    :hip:
     
  19. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    only 15 components + LCD.

    PIC way is just one PIC12F675 + bi colour LED.

    A tantilum bead decopoling capacitor oculd be added, but same is true with cp's circuit.

    If you have access to a PIC programmer i will nock up code.

    But i might not be available the next week as i am helping out with a summer school.
     
  20. acrimonious

    acrimonious Custom User Title:

    Joined:
    8 Nov 2002
    Posts:
    4,060
    Likes Received:
    3
    Wouldn't you get a better effect by using 2 leds, either in one package or merged with a 'light-pipe' (bit of clear plastic). Two thermistors, each hooked up to two transistors in opposite actions, one transistor fades its LED in as it gets hot, the other one fades its LED in as it gets colder.

    Would draw a schematic but i'm shattered, maybe tommorow.
     

Share This Page