As described in the previous post, the heatsink for the Flash is only designed to keep the temperature at a safe level for a few minutes. Since the LED will only be lit for a few seconds every few minutes that’s all that’s needed. The problem is that if a problem occurs with the Arduino, such as a program bug or a hardware failure, the Flash could be turned on but not off. This would cause the LED and heatsink to get very hot, possibly destroying the LED or damaging the artwork.
So, I decided to build some additional hardware to shut off the power to the LED if the heatsink gets too hot. In fact, I also decided to add a second feature – to reduce the power requirement the hardware needs to disable the Flash if any are candles lit.
In the previous post I designed this circuit for temperature sensing. It’s not bad, but now I want it to also disable the Flash when any candles are lit. So I started looking at logic ICs. The idea was to use some logic gates to make a controller that could do both tasks.
So I looked on the RS components website and discovered that the lowest cost logic gates were NAND gates, so I bought those and then sat down to design a circuit using them. Probably not the easiest approach…
There are two main types of logic ICs, TTL (transistor-Transistor Logic) and CMOS (Complementary Metal–Oxide–Semiconductor Logic). Of the two, TTL is the older technology. A big difference is that TTL need a 5 V power supply whereas CMOS works fine with 3-18 V. There are lots of subtle differences too, such as TTL is faster and CMOS uses less power, but for the purpose of this project the main differences are that the CMOS version of a 4×2-input NAND was less expensive (unusually) and CMOS can be damaged by static electricity, so has to be handled carefully.
I went for a TC4093BP, which is a CMOS IC with four x 2-input NAND gates. This table shows a NAND gate works. Each input can be HIGH (over 2/3 of supply voltage) or LOW (less than 1/3 of supply voltage). The output is only HIGH when both inputs are HIGH.
The TC4093BP also has a Schmitt Trigger function, which means that if the inputs hover around half supply voltage the output is always HIGH or LOW (as opposed to oscillating or partially changing state). This is useful for this application because the temperature sensor is an analogue device and we want the logic to be decisive about when the temperature has reached the maximum allowed.
Because it’s a CMOS device, I could run it at either 5 Volts (from the Arduino’s internal regulator) or the full supply voltage (12 Volts). However, one of the gates will be receiving input from the Arduino’s digital outputs, which have a HIGH output of 5 Volts. If the NAND gates ran at 12 Volts then 5 V would be less than half and would not trigger them, so they were powered with 5V from the Arduino.
This is the circuit I came up with. NAND2 outputs HIGH (which turns on the Flash via a MOSFET) when one of its inputs is LOW (the other is always HIGH as it’s connected to +ve).
There are three things that could make that input HIGH and keep the Flash turned off:
- When the Arduino turns the Flash off the input of NAND1 goes LOW, causing the output to go HIGH, making one input of NAND2 HIGH.
- The 150k thermistor (attached to the Flash heatsink) has a low resistance when hot. This causes the other input of NAND1 to go LOW, causing the output to go HIGH, making one input of NAND2 HIGH.
- The five Arduino outputs for the candle LEDs also connect to in(puts) 1-5. If the Arduino turns any of them on then the voltage will make the input of NAND2 HIGH
The logic IC can only output a maximum of 1 mA, so the Flash output connects to the MOSFET switch via a 5k resistor to limit the maximum current to 1 mA. (Although MOSFETs don’t take any perceptible current when they’re in a static state, the gate acts as a capacitor, so when switching there is a brief current as it charges. Brief it may be, but it can be very high, in the order of several amps if not limited.)
Next, building the actual electronics.