(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?
Temperature of your CPU? If it's that, I would write a soft and I wouldn't control those LEDs with the parallel port.
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.
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.
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?
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... Temp-controlled PWM duty-cycle is one answer
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 )
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.
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.
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?
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
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.
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
I don't see no schematic & code that a piccy n00b like me could use... 1 LM324 7 resistors (inc 2 led resistors) 1 trimpot 2-3 caps (inc smoothing) 1 thermistor bicolor led or 2 leds
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.
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.