I took a photo of my sub-project and also a schematic of it. My problem is I can not get the 24VAC power supply down to around 3 VAC to feed the FOD814A300. I was told that the FOD814A300 wants around 3 VAC. I tried using a range of R1’s from 1K to 20K. The voltage at pin 1 stays around 1 volt. I know the answer is probably simple but not to me! HELP
Datasheet for reference: https://www.onsemi.com/pdf/datasheet/fod814-d.pdf
Have a look at figures 18 and 19.
You have been misinformed
Here is the datasheet for your device.
https://www.mouser.com/datasheet/2/308/1/FOD814_D-2313902.pdf
The input to a opto-coupler is a photodiode. The critical parameter is not voltage but current. In the case of your specific device that value is +/- 50mA. With your 24 volt transformer a current limiting resistor value of 480 ohms minimum is required. If at any time you used a lower value or applied the 24 volts directly you have damaged your device.
My next question is about the “Sperry Meter”. What type of input are you trying to drive with the optocoupler? The output of the FOD814A300 is an NPN transistor. Its capabilities are described in the datasheet at the top of page 3.
The 2.2K should be 1/2W
If you are expecting to see an AC voltage at the output you won't. It will just be a little spike that occurs at the zero crossing. Your meter will probably show less than 1V
Why not regular 1/4W?
Power Rating = (24 - 0.7)/2200 * (24 - 0.7)/2200 * 2200 W
===> ~= 0.25 W (= 1/4 W)
-
A 1/4 W resistor running at 1/4 W will get quite hot, probably turn a PCB brown in time.
-
A rule of thumb is to double the calculated rating, especially when running at a maximum.
-
OP might find 5mA is adequate.
-
There are 1/2 W resistors in 1/4 W size form factor available.
-
Also, 24v is the RMS value not peak.
I want to thank you all for such a quick response to my cry for help! So let me start at the beginning. I want my arduino project to know when my house A/C is running. So basically when the yellow wire from my 5 wire thermostat is hot (24VAC) the A/C is running and when the yellow wire is cold (0 VAC) the A/C is off
So I am going to use that yellow wire (A/C) from the 5 wire thermostat as the input signal for my arduino project. The yellow wire is 24 VAC so it can’t be used directly. So I need some method of changing that 24VAC or 0 VAC to a HIGH or LOW signal. From there that output result will just go to an INPUT_PULLUP pin and a ground pin on an arduino.
To be honest I have no real knowledge of electronics. Programming yes, 40 years of it. Don’t assume I know anything! I don’t know what a NPN transistor is. That schematic I provided for this thread was something someone provided me. But I can follow directions!!
I can tell you the ¼ watt resistor got VERY hot. So a ½ watt sounds like a good idea. Seeing that I have to go out and get one of these resistors anyway how about going to a 1 watt? It was real HOT.
That will work and run cooler than 1/2W.
I don’t know what a NPN transistor is.
Why not take a few moments to learn about them?
https://www.electronics-tutorials.ws/transistor/tran_2.html
You don’t need a 2.2k resistor. If the optocoupler is only driving an Arduino input you can use a 4.7 k resistor. That would consume less than 1/8 watt. You could likely get good results with a 10k resistor, which would be about 60 mW.
What about something like Shelly Plus Pm to measure the current of your AC. It's cheap, safe and certified and you can interface with it about all the possible ways if your programming skills are not a problem.
Actually it comes out to 0.26W. That is the "MAX" power, its always good to derate parts under continuous conditions.
What will be the load on (what will be connected to) the FOD814A300's output transistor?
The current required through the input LEDs will depend on the current desired through the output transistor.
If you have them lying around you could make a pair of 1/4 watt in series and connect the pairs in parallel. Same resistance, one watt dissipation.
You may only need 3 or 4mA through the opto LED, if it's Vfd is 1.2V, then 22.8V / 0.004A = 5700Ω, use closest standard (5.6k), 22.8 / 5600 = about 4 mA, resistor power = 0.004 squared * 5600 = 0.09W. A 1/4W would be OK.
Well then that is the wrong circuit to use altogether.
You should be using an 817 optocoupler NOT an 814 or maybe a more sensitive optocoupler.
Can you buy parts from Digi-Key or Mouser?
Here is the correct updated circuit
[EDIT] Updated per @6v6gt comments in post #17
No special code needed, just connect Pin to any Arduino Pin. If Pin is HIGH then the A/C is on.
Another alternative is to use an old smartphone charger which puts out 5v when the mains supply is available, otherwise zero volts. That is easily measurable with an Arduino although I would add a resistor and a zener diode (to cover some fault cases with the charger).
There are other solutions such as a current transformer or opto couplers on the mains side but these are for "experts".
EDIT
I've just looked more carefully at your schematic in post #7. It does not appear to be a circuit for testing the general availabilty of the household power supply but more the detection of a signal voltage between a thermostat and an air conditioner.
The application is very similar to a landline telephone ring detector circuit where you may be detecting the presence of an up to 90 volts AC signal. Many of the circuits use a capacitor in series with the resistor and opto coupler to limit the heating effect.
Here is just an example of the basic idea.
I think you need to reverse a diode across the internal diode of the PC817 to protect that internal diode against reverse voltage. The datasheet specifies max. 6 volts. Good would be to use a LED there to have some visible indication of activity.
You are absolutely right!
As you are using an isolation transformer to get 24 VAC RMS from 220V AC RMS, you can employ the following circuit (Fig-1) to sense the 220V AC supply failure.
Figure-1:
Working Principle: The circuit senses the zero crossing point of the AC wave. As long as the AC wave is present, the zero crossing signal-A is present which triggers the 1-sec 74LS123 one-shot. When the AC wave fails, the signal-B drops to zero level within 1-sec period. The falling edge of signal-B interrupts the MCU, the MCU goes to interrupt sub routine, and takes action as needed.
Sample code:
#define INTZ 2
volatile bool flag = false;
void setup()
{
pinMode(INTZ, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(INTZ), ISRINTZ, FALLING);
}
void loop()
{
if(flag == true)
{
//take actions as needed
flag = false;
}
}
void ISRINTZ()
{
flag = true;
}
Have a look at “ volt stick” circuits , which are isolated and very simple . ( a wire wrapped around the incoming cable ( insulated !!)
I have one to tell when power is restored .
A diode pump in the output produces a nice on/off digital output .
The other thing you could do is just use a main powered relay and use the contacts to indicate if the supply is live ( relay energised )