I need a way to detect whether or not a solenoid is attached to an i/o port as well as detect a fault (short) on the solenoid wiring. The solenoids run off of 24VAC. There are several ports to which a solenoid could be connected. A microcontroller would sequentially turn on each port (a triac is used as the AC switch) and if the current sense output met a certain threshold, the microcontroller would know that a solenoid was connected. If it passed another threshold, it would know that a short was present and shut the triac off.
I'm hoping for a simple design since there are only two levels I'm concerned about - solenoid is/isn't connected and a short condition.
The basic idea would be to connect a sense resistor in the current path and feed the voltage across the resistor to an ADC input of the microcontroller via a current-limiting resistor. The microcontroller can then decide what the state of the solenoid is.
You'll need to specify the threshold currents also to be able to calculate the sense resistance and the ADC threshold values/counts.
And it might also need short protection, ie some type of current limiting that will save the components while the TRIAC turns on to test the solenoid current etc.
What is the nominal AC current that it takes to operate a solenoid?
If no solenoid is connected to a given channel, can we assume that nothing else is connected, i.e. the TriAC will not stay turned on for the rest of the AC cycle?
And it might also need short protection, ie some type of current limiting that will save the components while the TRIAC turns on to test the solenoid current etc.
Good point. If the 24VAC is capable of high current that would be advisable.
If the 24VAC is coming from a low power transformer (like the ones used in some 4 channel automatic watering timers), then the current is already limited by the transformer and everything in the path. The microcontroller can switch off the power before the transformer dies of thermal failure, and the TRIACs should be safe.
Here's a rough schematic. The 24VAC supply is regulated through a half wave rectifier and linear regulator to supply Vcc. I'm also planning on inserting a PTC on the 24VAC input for protection.
I thought of putting the current sense resistor on the low-side and then using a peak detector. Would that suffice? A hall-effect IC seems like overkill.
What is the nominal AC current that it takes to operate a solenoid?
If no solenoid is connected to a given channel, can we assume that nothing else is connected, i.e. the TriAC will not stay turned on for the rest of the AC cycle?
You have a fundamental flaw with how you propose to trigger the triac. Either you need a level shifter, a trigger transformer, or you need to put the triac on the low side of the load.
You have a fundamental flaw with how you propose to trigger the triac. Either you need a level shifter, a trigger transformer, or you need to put the triac on the low side of the load.
Here's one possibility:
OutA pulses low if the solenoid (load) is connected (current ~250mA). OutA and OutB both pulse low if the load resistance is < ~75Ω (current > ~400mA). View attachment LoadSense.asc
Checking for a solenoid connected might be more problematic. Checking the current at a reduced supply voltage would work.
As an example, if you could reduce the total supply and use a single hall effect or current sense amp, and turn on each solenoid one by one, that's one way.
If your able to look at the incremental current as drivers turn on, that's another. i.e. State: system drawing x amps. Turn on solenoid. System still draws X amps +-10%. Solenoid defective.
So in one case, you actually can tell before the solenoid is activated and in the second you can't.
Using a real solenoid driver you may even be able to reduce overall energy usage. Solenoids just generally have to "kick" and then resort to a holding current.