sir @aarg
You're right. I will attach .DSN schematic (ISIS)
So... It just phase detector circuit.
sorry, I know I got weakness.
I had pick phase detector diagram, and I just make like it.
Still in progress to get proper input for arduino, code still the same as last code posted.
dunno, the result is different.
I know I used different component but still in purpose.
I hope people will explain to me without getting mad.
because is out my basic. maybe I give some goofie question, but just tell me why
I will learn a lot from this forum.
Unfortunately, there's much more than that wrong with your circuit. First of all, please review the pinout of the IC and you'll find the correct pins for power. Here's a datasheet for the LM339 that also shows zero cross detection circuits. The datasheet recommends connecting unused inputs to ground ... but I think this is for dual supply. For single supply, I would use several op-amps for each input signal but just use one output each. Note that the output is open collector, so it would need a pullup resistor (suggest 10K) to 5V.
I had pick phase detector diagram, and I just make like it.
Oh ... I think that's the paperwork assigned to the shredder.
Its difficult if not impossible to find a perfect working solution for specific components. You'll need to do some R&D (works the same way for code).
dlloyd:
Unfortunately, there's much more than that wrong with your circuit. First of all, please review the pinout of the IC and you'll find the correct pins for power.
So I did in simple way to know that
I made input from pulse generator that replace the voltage and current input.
before I was using transformator and acs712.
and I look the wave before feed to comparator, still in normal condition.
why output comparator not work so well, what we miss?
I just change the pulse generator with sensor.
dlloyd:
Oh ... I think that's the paperwork assigned to the shredder.
Its difficult if not impossible to find a perfect working solution for specific components. You'll need to do some R&D (works the same way for code).
Its from valid journal, and tested. Maybe someone not reveal all process to share.
such as the inverting input for current sensor.
Ya, that you told me to make input ready right?
I will make one IC op amp for each input, hope this work. but I still need to fix the input phase 1st.
aarg:
I think the "goofy" diodes and resistor network is to drive an obsolete logic family, LSTTL or similar.
I see the diode is still there. I guess there's a pulldown resistor somewhere ... hidden behind the oscilloscope? It's OK to leave the diode there as long as there's a pulldown resistor. However, the diode and pulldown resistor isn't needed as far as I can tell. Awaiting updated diagram...
The red signal looks good ... it follows the XOR truth table perfectly.
You get 2 output pulses for one cycle on the inputs because there would be 2 zero crossings per cycle.
Are you trying to get only one? What do you want the red signal to look like?
Also, can you post a diagram without the oscilloscope hiding a big section of it?
More comments:
Your schematic can't be reached. Please update your schematic so we can view it.
why output comparator not work so well, what we miss?
Because the output is open collector?
Are you using pullup resistors?
dlloyd:
You get 2 output pulses for one cycle on the inputs because there would be 2 zero crossings per cycle.
Thats exactly what I want in sensor from acs712 and transformator. stable.
from my opinion,
The waves are different from new and previous one. the new one, both wave touch 0V perfectly, better than the previous with acs712 and transformator.
but how can I manage that?
dlloyd:
It looks like you've made some good progress.
I see the diode is still there. I guess there's a pulldown resistor somewhere ... hidden behind the oscilloscope? It's OK to leave the diode there as long as there's a pulldown resistor. However, the diode and pulldown resistor isn't needed as far as I can tell. Awaiting updated diagram...
there no more to hide
it just forward goal to make output from arduino.
dlloyd:
Your schematic can't be reached. Please update your schematic so we can view it.
Because the output is open collector?
Are you using pullup resistors?
really? which one ?
I think both the old and new can be reached. no private
open collector? dunno what it mean. I just need the comparator output work like this signal generator.
pullup resistors? ya I tried that, but when I give 10k resistor, the wave disappear. so I manage resistor as far as I can.
I think there's problem in there.
I think both the old and new can be reached. no private
True ... I meant to say I don't have the software to view those file types.
open collector? dunno what it mean.
The output is just an unconnected collector of an NPN transistor.
Thats exactly what I want in sensor from acs712 and transformator. stable.
from my opinion,
The waves are different from new and previous one. the new one, both wave touch 0V perfectly, better than the previous with acs712 and transformator.
but how can I manage that?
I just need the comparator output work like this signal generator.
Great ... now we know the perfect signal you need.
I agree that the previous signals with the ACS712 and transformer are less than ideal. The comparator zero crossing detector circuit is what to work on now. However it will be difficult to get a perfect signal for various reasons.
With single supply, the zero crossing circuit is a bit more complex.
With dual supplies (±5V), the zero crossing detector circuit in the datasheet is much simpler but the ACS712 output would be more difficult to work with because its centered at 2.5V. The current signal from the ACS712 is the most difficult to work with. It varies in amplitude with current and would produce low peak-peak voltages with low current.
The voltage signal from the transformer would be more stable (the voltage wouldn't vary much)
and would have a good peak-peak levels.
I aggree
Very complex and difficult
Thats why I come with idea using bitwise XOR code
We can configure by code more easier, if only we can manage the proper code for system.
We can configure by code more easier, if only we can manage the proper code for system.
Well, if you're considering using ADC on the Arduino, as mentioned in reply#15 you'll only be able to take 100 readongs per cycle (±3.6 deg resolution).
For the current signal, with low pk-pk amplitude, this adds more phase error due to the limited 10-bit resolution (4.8mV).
Further increasing phase error is that the ADC is multiplexed and the 2 readings cannot be taken at the same time.
Using zero crossing detection circuits with the LM339 and connecting the 2 output signals directly to 2 Arduino interrupts would be ideal. No external XOR needed. Just need to measure the timing between the 2 signals.
Ok
Let me verify
I go using 2 LM339 with +5 to ground supply,
One for voltage sensor, another to current sensor.
Which supply for both not conected directly (not parallel/shunt)
*I hestitate about this, is it ok to shunt supply?
Then,
I configure inverting input for current op amp using trin pod to get 2.5 V to feed to op amp for 0V center, from current op amp supply (or I need separate this from op amp supply?)
After that, op amp output conected to diode and pullup resistor 10k (if connected to XOR)
or directly if connect to arduino.
Let me verify
I go using 2 LM339 with +5 to ground supply,
One for voltage sensor, another to current sensor.
Yes
Which supply for both not conected directly (not parallel/shunt)
*I hestitate about this, is it ok to shunt supply?
I meant not to leave unused comparators with input pins floating. Instead, do this:
Then,
I configure inverting input for current op amp using trin pod to get 2.5 V to feed to op amp for 0V center, from current op amp supply (or I need separate this from op amp supply?)
Just connect ACS712 output direct to comparator + input. Then use voltage divider for 2.5V reference for comparator - input.
After that, op amp output conected to diode and pullup resistor 10k (if connected to XOR)
or directly if connect to arduino.
Op-amp output can connected directly to Arduino. It needs a pullup ... the Arduino internal pullup might be sufficient.
Well, yes. When asked about the logic family that the XOR gate belongs to, you could actually answer. When asked for a full schematic, you could supply it. When asked about the diodes, you could answer the question. You have not responded to any of these inquiries. Your latest attempt is a complete bodge. Why you would put 1 ohm resistors to ground and expect an op amp to drive them, is completely beyond my imagination. But the fundamental problem, is that you don't respond to direct requests for information.
What you have there is not a complete schematic, crucially, I couldn't tell what kind of logic gate it was because it is just a box that says, XOR. That is not a schematic, that is a just a rough diagram.
Where is your schematic? Almost nobody here has Proteus.
If you would take the time to read the datasheet for the LM339, you would find the method of interfacing to TTL in section 8.8.2, Figure 14, System Examples: