1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics LED colour dependant on voltage (temperature sensor)?

Discussion in 'Modding' started by Ending Credits, 27 Sep 2008.

  1. Ending Credits

    Ending Credits Bunned

    Joined:
    4 Jan 2008
    Posts:
    5,321
    Likes Received:
    244
    For my GCSE electronics coursework I want to make a bar of LEDs change from Blue to Red dependant on the temperature using a thermistor. Obviously some Dual colour LEDs are in order here but I don't know how to fade the colours from one to the other dependant on voltage.

    I seem to remember this being done before here (a tap temp sensor) but I can't find it.

    Thanks!
     
  2. TAKTAK

    TAKTAK I R Pandi

    Joined:
    2 Jul 2008
    Posts:
    29
    Likes Received:
    0
    bi-colour LEDs just depend on which direction the current is flowing.

    so all you would need is a circuit that changed the current flow direction when a certain temperature is reached ( when the thermistor reaches a certain resistance) to do that the easiest way is probably by using a potential divider connecting into a comparator...
     
  3. Ending Credits

    Ending Credits Bunned

    Joined:
    4 Jan 2008
    Posts:
    5,321
    Likes Received:
    244
    I was thinking tri colour with a continuous transition from one color to another.
     
  4. logan'srun

    logan'srun following the footsteps of giants

    Joined:
    22 Apr 2008
    Posts:
    553
    Likes Received:
    42
  5. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    eh, there has to be a sweet analog way to do this.

    something like the thermistor sensor driving the base current of a transistor.

    or a current to voltage converter to drive a mosfet, using the mosfet as a resistor in the linear region.

    if you use a bicolor, a resistor would have to increase the base current or gate voltage at the same rate that the other resistor decreases, making them fade in and out equally.
     
  6. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    With a bicolor you can use PWM, with the output sinking & sourcing. Not too dissimilar to a logic probe. :idea:

    A 555, or maybe LM324
     
  7. Ending Credits

    Ending Credits Bunned

    Joined:
    4 Jan 2008
    Posts:
    5,321
    Likes Received:
    244
    Is there a 555 circuit which can variate high time versus low time to any ratio including where it's high for longer than it is low? (Poorly phrased but I can't think how else to write it)


    I cound wire the LEDs different way rounds so that one diode is off when it's high and one is on and vice versa for low eliminating the need for two transistors.

    EDIT: would this be a good circuit to use (minus the stuff past the transistor)?

    [​IMG]

    EDIT: I presume the ratio is controlled by the second potentiometer which could be replaced by a mosfet?
     
    Last edited: 28 Sep 2008
  8. Salgat

    Salgat What's a Dremel?

    Joined:
    30 Sep 2008
    Posts:
    2
    Likes Received:
    0
    If you're willing to go to the microcontroller route, a single micro can cover an unlimited number of colors using Pulse width modulation (along with preprogrammed color routines). Combine that with a Analog-to-Digital Converter and you have your whole setup done with one 20 pin micro, a 3 lead temperature sensor, and a couple of transistors/resistors.
     
  9. mcg1sean

    mcg1sean What's a Dremel?

    Joined:
    5 Apr 2006
    Posts:
    56
    Likes Received:
    0
    The easiest way that I can think of doing what you want is to use an Arduino micro-controller. Basically its a prototyping micro-controller that has a USB-Serial connection, 8 analog inputs, and 13 outputs (mix of analog and digital supporting PWM). All you need is a temperature sensor plugged into the analog in and your LED's plugged into the outputs. Then you just need to tell it what you want to do which involves some programming in C but its all very easy. All of the supported syntax for the special Arduino C library are on the Arduino site (arduino.cc).
     
  10. Ending Credits

    Ending Credits Bunned

    Joined:
    4 Jan 2008
    Posts:
    5,321
    Likes Received:
    244
    This is a GCSE project so most of the stuff suggested is a bit too complicated.

    I've managed to do this via a PWM circuit with a 130K resistor for the astable and a 100K at 50deg, 30K at 20deg thermistor for the monostable and then wired this with a comparitor with a 2.5V reference.

    I have one problem; I want the LED to extremele close to red at 60 degrees celcius and extremely close to BLUE at 20 but at the moment it's only about 80% blue at 20 and perhaps 90% red at 60.
     

Share This Page