Electrical circuit help

I have a home automation controller that has an analog input. It works by putting out 5VDC and whatever voltage it sees coming in on one of the input ports it converts it to a value between 0 and 255 to be used in its programming. I want to connect the output of a current transformer that has the power cord of my air conditioner going through it, so the automation controller can know the state of the AC. Its output is between 0 and 18VAC.

I know enough about this to believe this can be done with a trip to RadioShack, but I’m not sure exactly how. I think I need to convert the AC from the transformer to DC [rectifier?] and then use some sort of amplifier to vary the 5V coming from the controller. Am I on the right track here?

So each port works off of 5VDC and changes state based on whether there is continuity, right? If it’s that simple, then attach a relay to the transformer’s output and use that to tell the controller whether the AC is running.

So each port works off of 5VDC and changes state based on whether there is continuity, right? If it’s that simple, then attach a relay to the transformer’s output and use that to tell the controller whether the AC is running.

First, you’ll need to convert the AC form your current transformer into DC. You can probably use a single-wave rectifier for this - basically, a single diode on one of the leads coming off the transformer. Depending on the sampling rate of your home controller, you will probably need a capacitor filter to smooth out the half-wave ripple into DC. At that point you will have a 0-9VDC signal. If the controller is looking for a 0-5VDC input, you can use a voltage divider made from a pair of resistors to generate it.

cornflakes,

That was my original thought, but then I would only know if the A/C was on or off. Whereas if I can convert the 0-18VAC to 0-5VDC I’ll should be able to tell not only its on/off state, but also the fan setting (Hi, Med, Low) and the compressor state. All of those different combinations will draw a different amount of power.

** AndrewL**,

What size capacitor should I be looking for?

Depends on the smapling rate of your controller, and how much lag you want in the response. You’d probably be best off getting a handful of values and playing around with the circuit until you get the behavior you need.

I think the 0-18 V input is artificial because according to the data sheet you linked to you can adjust the resistor to provide whatever output voltage you want.

This is extremely easy and basic to do but you will have to give me the max amps the AC draws.

You do realise the transformer goes over only one of the wires and not both?

Assume 20 A RMS max. That’s about 28 A peak. Divide by 3100 and you get 9 mA peak. A 560 ohm resistor will give you 5V PP but you can provide a 1K pot and adjust the output voltage according to your real max amps.

Here’s what I would do:

1- Rectify the secondary of the sensing transformer with a full wave rectifier (you have to rectify both semicycles or redesign the whole thing, do not use just one diode).

2- Across the output of the bridge place the resistor and a 100 - 150 uF capacitor and you should get a smooth DC voltage in proportion to the AC current being consumed.

3- If you make the resistor an adjustable pot (in fact, it is a good idea in any case) protect your circuit input with a diode to the +5V VCC so that the input voltage can never swing above 5V

Do you need the max amps the A/C can draw, or the max amps it will ever draw? It’s a 15,100 btu/hr unit and calls for a dedicated 15 amp circuit, so that would be the most it would ever be able to draw (for any length of time). I don’t know what the most it ever draws in reality is. I could measure it I guess.

I didn’t see a resistor, although I didn’t really look. Could they be referring to an external resistor that I need to add myself?

I do have the transformer just over one of the conductors of the power cord. The construction of the cord is like a zip wire and I pulled the conductors apart and just clamped it over one of them.

Just to clarify, what I’d really like to do is vary the 5V that the controller is putting out rather than just get the transformers output into the 0-5VDC range and feed that to the controller. [I just realized **AndrewL**'s solution doesn’t do that. Although it will work if I need to do it his way.] The advantage would be improved accuracy in reading the value of the input, and I’d worry less about possible damage.

Yes, you have to provide the resistor and other components yourself. You can adjust the resistor to get any output voltage you want.

From your OP

it is not clear what the controller does but I am not sure it matters. If you want 0 - 18 VDC in response to 0 - 15 Amps RMS AC then R= 2K7 and you can bring the C down to 50 uF or even 30.

You can test all this with a regular voltmeter and adjust everything so that it is working correctly before you connect it to the rest of the circuit. Just connect the components and measure the voltage with a voltmeter.

sailor,

The controller has 8 analog inputs. When it sees a voltage (from 0-5V) on one of these it puts a value from 0-255 in a variable that it can then use to make decisions.

The controller also provides +5V to use when connecting your sensors to this port. They recommend using this +5V source to power your sensors as it increases accuracy. I thought I’d build a circuit that would connect this 5V to one of the input ports and vary it based on the voltage from the transformer. It’s not required, but it’s supposed to be better. I’ll try doing it the way you’ve described it tonight, and if it works I’ll be more than happy.

It should work fine. Just make sure you protect the controller input with a couple diodes to prevent the voltage from going below 0 or abouve 5 V and you should be fine.

sailor, thanks for your help.

I’ve got it working (I get 0-2.5VDC depending on the state of the A/C), but I’m a little confused about the protection diode. Does the diode go between the input port and the +5V of the controller? Which way does it go? Does it need to be a certain kind of diode?

Connect the cathode side of the diode (the side with the stripe) to the +5v on the controller, and the anode side (the side without the stripe) to the voltage input. That will protect the input from going above 5V. You shouldn’t need to protect against going below 0V, since you’re using the 0V line from the controller as your low end reference, but if you want to you can add a second diode with the cathode connected to the voltage in and the anode connected to the 0V side. 1n4148 or 1n4001 or other small signal diodes should work fine.

Servo, you can increase the voltage by increasing the resistor value proportionately. The diode goes as AndrewL says. Make sure you use this protection before increasing the resistor because the surge at startup can make the voltage spike above 5V.

Servo,
Although you may know this, I just thought that I would point out that Current Transformers can be potentially lethal. If you disconnect the leads of the CT, WHILE IT IS IN USE, a tremendous voltage is created at the leads (thousands of volts). If you get caught up in this voltage, it very well could kill you!

Good luck with your project,

THIM

Good advice SH_THIMN_SHA. I had thought of that and never posted it just because it seems obvious to me. How silly of me. Indeed you are very correct and it is the resistor which keeps the current from rising. If the resistor should fail you have the same situation. A 6V zenner would be a very good protection for people and for the controller circuit.

The controller has another set of inputs that are designed to be connected to relays. Integrated into these inputs are transient suppression diodes to handle the spike when the relay opens. I assumed the transformer would be similar. I’m not sure if this assumption is completely correct, but when I was swapping components on the breadboard to figure out the best values I did make sure that the A/C was off (I even waited for the cap to discharge) before I changed anything. I’ll add a zener diode today. (Cathode to the input [+ off the rectifier] and anode to ground?)

Aside from that, I put the circuit in a project box and connected it to the controller last night and everything works great. Now when it’s hot, my A/C turns on when I come home. :slight_smile:

I’m a little curious as to how the signal diode is keeping the voltage from going about 5V. (Does it have more to do with the 5V power supply of the controller than the diode?)

It could be that the controller inputs are internally protected. I have no idea but if you are not certain an external diode costs nothing.

The RC time constant should be under 0.1 sec so you should not have to wait for the C to discharge. At any rate the voltage will be under 5V so it really doesn’t matter.

Just remember the transformer is a source of current and can generate tremendous voltage if there is no resistor or protection. The first protection is the resistor. The second is the diode to +5V. That should suffice but if those components are on the board and the cables from the transformer are long and break then you can have a problemso you may want to consider a zenner diode at the transformer itself as a lst protection.

Personally I would have gone for a simpler solution as I do not think measuring the current is necessary. The compressor is on or off and you can detect that much easily. The fan would be running constantly and is really not important. A relay in parallel with the compressor would close a set of contacts when the compressor was running and that’s pretty much all you need. You could put another relay in parallel with the fan but I think it serves no purpose.

Sometimes simple solutions are the best. My boat has a sump pump which is turned on automatically by a float switch in the bilges. I want to know how much the pump works because any sudden rise indicates something needs attention. I have just wired a simple, cheap ($2), analog alarm clock which runs when energised and stops when not, integrating the total run time of the pump.

At home I did the same with the furnace. In parallel with the pump I wired a timer which intgrated up to 24 Hr. Simple and it works.

The protections diodes are documented in the manual, and the guy who designed the thing has mentioned them a couple of times, so I’m sure they’re there.

The board is at the transformer. The long wires to the controller carry the DC output.

I agree with you about simplicity, but one of the goals of this project was to be minimally invasive. The unit is still under warranty and I didn’t want to void it (possibly) by making modifications.

Why do I want to know the state of the compressor and fan independantly? I’m not using the internal thermostat to control the A/C. It’s the only means of cooling for the bedroom, living room, and to some extent the kitchen. So I’m using temperature sensors in each of the rooms connected to the automation controller. The controller sends IR commands to the A/C to turn it on and off, and switch between cooling mode and fan only. So I’m using the output from the transformer and circuit as feedback so the controller knows its IR command were sent succesfully and the A/C is in the correct state.

That alarm clock setup is pretty slick.