kev wrote:Sounds like the opto-output is always forward biased. What is the resistance from pin 6 to pin 5? maybe you have a solder bridge between the two pins.
Yes, that could do it too. Good point kev.
LightUp wrote:The opto output should only be high near the zero crossing voltage and low elsewhere. Therefore with no battery you should get close to 5V output, and close to zero volts when you apply 9v. Your measurements suggests that your "10K" collector resistor is almost open, or your opto's are all shot.
Socket issue? wiring issue?With no power applied and only using an ohmmeter, do you get 10K ohms from pin 5 of the IC and the 5V supply point? Do you get close to zero ohms from pin 4 and the ground on your Arduino? When power applied do you get 5V between pin 4 of the IC and the 10K resistor end that is connected to 5V, including the wiring?
On my oscilloscope I get a pulse width of about 0.65ms at the base and about a peak voltage of 4.95V that looks like a 1/2 sinewave shape. This pulse peak straddles the zero crossing point on the AC waveform.
With no power applied and only using an ohmmeter, do you get 10K ohms from pin 5 of the IC and the 5V supply point - Yes (9.789K)
Do you get close to zero ohms from pin 4 and the ground on your Arduino - Yes
When power applied do you get 5V between pin 4 of the IC and the 10K resistor end that is connected to 5V, including the wiring - Yes
voltage at pin 5 with respect to pin 4 is 0.16
voltage at pin 6 with respect to pin 4 is also 0.75
there is definitely no short between 5 and 6.
OK, in case there is confusion in the procedure...
With no AC applied to the input of the opto-isolator but 5V power is applied the 10K resistor and ground, do you get 5V between pin 4 and pin 5? If not you will need to try a brand new H11AA1 chip.
The internal transistor of the opto will only conduct if there is light emitted by the internal LED. With no AC applied to the opto the LED has no current to cause it to light. This should keep the transistor off and thus pin 5 should then be at +5V. Pin 6, the base of the transistor, should be floating (no connection) and thus have no means of getting a base current to turn the transistor on. Hence there is no collector current to pull pin 5 to ground level.
LightUp wrote:OK, in case there is confusion in the procedure...
With no AC applied to the input of the opto-isolator but 5V power is applied the 10K resistor and ground, do you get 5V between pin 4 and pin 5? If not you will need to try a brand new H11AA1 chip.
The internal transistor of the opto will only conduct if there is light emitted by the internal LED. With no AC applied to the opto the LED has no current to cause it to light. This should keep the transistor off and thus pin 5 should then be at +5V. Pin 6, the base of the transistor, should be floating (no connection) and thus have no means of getting a base current to turn the transistor on. Hence there is no collector current to pull pin 5 to ground level.
all this trouble and it was my stupidity!!!!
IT WORKS!!!!!!!!! so freaking excited 🙂
I took what Kevin said about checking for a short across pins 5 and 6... I couldn't find any... but my mistake was that I was checking for a short using a continuity tester as well as checking in the 200 Kohm range... but for some bizarre reason when I switched the multi meter to MOhm range there was a 700 Kohm resistance across pins 5 and 6 with no ic plugged in. I couldn't for the life of me figure out why.. I took the socket apart and it was fine by itself. Put it back on the board and the same damn thing...
what I ended up doing was gouging the board around the pins... even though I couldn't see any solder contact, something was causing it to create a high resistance track... I had to use a sharp tipped bit and gouge around all 6 pins and it worked!!!!
the ZCD test is giving me a proper result now. should have printed a PCB instead of using this crappy cheap prototyping board. 🙂
Sorry for all the trouble you guys and thank you so much for sticking in with me 🙂
number of zero crossings: 120
number of zero crossings: 240
zc duration: 341
number of zero crossings: 0
number of zero crossings: 120
number of zero crossings: 240
zc duration: 337
number of zero crossings: 0
number of zero crossings: 120
number of zero crossings: 240
zc duration: 331
number of zero crossings: 0
number of zero crossings: 120
number of zero crossings: 240
zc duration: 331
number of zero crossings: 0
number of zero crossings: 120
number of zero crossings: 240
zc duration: 338
number of zero crossings: 0
number of zero crossings: 120
number of zero crossings: 240
zc duration: 338
number of zero crossings: 0
number of zero crossings: 120
number of zero crossings: 240
zc duration: 336
number of zero crossings: 0
number of zero crossings: 120
number of zero crossings: 240
zc duration: 338
number of zero crossings: 0
number of zero crossings: 120
number of zero crossings: 240
zc duration: 340
number of zero crossings: 0
number of zero crossings: 120
number of zero crossings: 240
zc duration: 334
number of zero crossings: 0
Great! I can go to sleep now. 🙂
Congrats!!!
LightUp wrote:Great! I can go to sleep now. 🙂
haha yeah 🙂 sleep tight and thank you once again for the guidance...
one small issue which i dont think is major... when i hit stop in vixen it keeps the last state the channels were in still running is that normal?
kev wrote:Congrats!!!
Thanks once again for all your help Kevin!
You are welcome. We all know the feeling of excitement once we get a problem figured out. I am excited for you!.
For the lights staying on, there is a couple lines of code in the 'void loop' section that might be responsible. Did you comment those two lines out during your previous troubleshooting?
void loop()
{
if(digitalRead(RANDOM_MODE_PININ)==HIGH) // not Random mode, Vixen mode
{ // play from Vixen mode
if(startingVixenMode)
{
turnAllLightsOff();
startingVixenMode = false; // make sure we know we are already in Vixen
setupVixenMode();
}
if(readFromVixen())
{
//kg #ifdef PC_COM_ON
//kg Serial1.println("read");
//kg #endif
}
else // comment out this else and the line below if you don't want the lights to turn off when vixen doesn't send data because the channel values didn't change from one from to the next.
turnAllLightsOff(); // set the channels to off
}
else
{ // random mode
if(!startingVixenMode) // indicates we were just reading data from Vixen
{
turnAllLightsOff();
setupRandomMode();
}
startingVixenMode=true;
doRandomLights();
}
}
kev wrote:You are welcome. We all know the feeling of excitement once we get a problem figured out. I am excited for you!.For the lights staying on, there is a couple lines of code in the 'void loop' section that might be responsible. Did you comment those two lines out during your previous troubleshooting?
void loop()
{
if(digitalRead(RANDOM_MODE_PININ)==HIGH) // not Random mode, Vixen mode
{ // play from Vixen mode
if(startingVixenMode)
{
turnAllLightsOff();
startingVixenMode = false; // make sure we know we are already in Vixen
setupVixenMode();
}
if(readFromVixen())
{
//kg #ifdef PC_COM_ON
//kg Serial1.println("read");
//kg #endif
}
else // comment out this else and the line below if you don't want the lights to turn off when vixen doesn't send data because the channel values didn't change from one from to the next.
turnAllLightsOff(); // set the channels to off
}
else
{ // random mode
if(!startingVixenMode) // indicates we were just reading data from Vixen
{
turnAllLightsOff();
setupRandomMode();
}
startingVixenMode=true;
doRandomLights();
}
}
i didnt comment anything out 🙂 since its all greek and latin to me... but they dont turn off when vixen is stopped... they continue with the sequence.. for example if i add a candle flicker to a channel and hit play it does the candle flicker but if i hit stop it continues that candle flicker... its like last state remains... is that how it should be?
