Issue: I have to figure out if the AC (air conditioner) is ON or OFF.
Context: I have found a continuous voltage inside the AC (we'll call ACSTATE) that have these values:
3,4v => AC on
2,2v => AC off
I have done this circuit (op-amp comparator with a LM358) to convert ACSTATE to logic level (0-5v):
But my OUT don't go to saturation (about 5v) but stay on 1,4v.
I have tried the circuit on my desk and work like a charm, but when I connect to my AC don't work. There is something of strante on ACSTATE. I have also che the is a dc current...
I have also tried to add a buffer in front of op-amp comparator: and have 2,6v and 4v on OUT. Why not 0v?!
Ahhhh, next time draw a diagonal line trough the resistor with the arrow on the end That is how you draw a potentiometer. Didn't recognized it this way. An arrow like the (just up in the air) is common for a voltage rail.
But how do you power the opamp? Because you just tied together two GND's...
And out is just connected to a Arduino pin?
Also, an opamp will never give you 5V out when you power it with 5V. Around 1V to 1,5V below the supply voltage at best. Or you need to get a rail to rail opamp. But 4V should be good enough for the Arduino.
Ahhhh, next time draw a diagonal line trough the resistor with the arrow on the end That is how you draw a potentiometer
That is a potentiometer: first pin to 5v, middle pin to V-, end pin on ground.
But how do you power the opamp? Because you just tied together two GND's...
I have an external power supply with +5v...you can see it on circuit.
And out is just connected to a Arduino pin?
This is the idea...but before connect it I need 5v and 0v on the OUT pin
Also, an opamp will never give you 5V out when you power it with 5V. Around 1V to 1,5V below the supply voltage at best. Or you need to get a rail to rail opamp. But 4V should be good enough for the Arduino.
Yeah, I know...I also have the LMV358 (rail to rail version), and I have also try with it, but the OUT is 5,36v and 3,6v...so don't solve my problem
muttley:
That is a potentiometer: first pin to 5v, middle pin to V-, end pin on ground.
I know that now but that's not what you drew in the schematic That's why I didn't recognized it at first.
muttley:
I have an external power supply with +5v...you can see it on circuit.
No I can not... I just see 5V, where it comes from I can't see.
muttley:
This is the idea...
I know, and with a external (isolated) 5V supply you're fine (as long as these are the only connections).But I would add decoupling caps. But I didn't know what was giving you the 5V. For all I know you took that from the AC unit. And then you can't just randomly connect the GND to it wherever you want it to be.
muttley:
but before connect it I need 5v and 0v on the OUT pin
5V is hard... A logic HIGH should work.
But let's start measuring. To what voltage did you set the potentiometer? What voltages (on and off) do you see on that ACSTATE line when it's connected to the opamp?
5v is an external power supply...an wall usb charger (used for charge the smarthphone).
I know, and with a external (isolated) 5V supply you're fine (as long as these are the only connections).But I would add decoupling caps. But I didn't know what was giving you the 5V. For all I know you took that from the AC unit. And then you can't just randomly connect the GND to it wherever you want it to be.
5v is an external power supply, as I wrote above: an 220v to 5v. Do you think my circuit is done?
But let's start measuring. To what voltage did you set the potentiometer? What voltages (on and off) do you see on that ACSTATE line when it's connected to the opamp?
Voltage on potentiometer is set between 3,4v and 2,2v: I set about 3v
ACSTATE: 3,4v => AC on / 2,2v => AC off
Also when is connected to opamp
Anyway, I guess the issue is on the AC/ACSTATE, because if I test my circuit on my desk (without connect to AC) all works like a charm!
Yes, you could draw it like that way. But the gap between the resistor and the arrow made it look like two items. You can't have that with the other symbol. But don't get me started on symbols, don't like the American symbols all together
But if you still measure 3,4V and 2,2V even when connected to the opamp then only one questions remains:
septillion:
And out is just connected to a Arduino pin?
One thing I can think of, the ACSTATE voltage might not be a pure DC voltage. Maybe it's partly AC. Or a PWM signal. Do you have a scope?
Why don't you use an analogue input (no opamp).
An analogue input can detect 1024 voltage levels.
Use a 10k resistor between AC output and analogue input, to protect the pin.
Are you sure that you can ground one of the AC lines.
Leo..
Hi,
In your circuit, is the AC line that goes to gnd ref of the opamp, really gnd?
In other words, if you connect a DMM on AC range between you AC gnd and gnd, do you get a reading?
Can you define AC ON or OFF.
Is it the Mains POWER to the AC being ON or OFF?
OR
The AC being in chill mode or standby with Mains Power still ON?
Where in the AC did you locate these voltages.
Thanks.. Tom...
If your AC gnd is not really gnd and you connect a grounded circuit to it you may damage your AC.
ohhh...ok! My mistake sorry. I'm not so good and my english is quite bad.
And out is just connected to a Arduino pin?
no, I check it with the multimeter...but don't understand the reason of your question
One thing I can think of, the ACSTATE voltage might not be a pure DC voltage. Maybe it's partly AC. Or a PWM signal. Do you have a scope?
A possible solution would be to add a RC filter.
mhhh...this could explain a lot of things. But I don't have oscilloscope (do you mean this)?
I have only try to invert the mutlimeter terminal and the voltage change sign
Why don't you use an analogue input (no opamp).
An analogue input can detect 1024 voltage levels.
Use a 10k resistor between AC output and analogue input, to protect the pin.
I have thought this solution, but I would like understand why my first idea don't works...only for figure out what happend.
Are you sure that you can ground one of the AC lines.
obviously...nope but what is the alternative way?
In your circuit, is the AC line that goes to gnd ref of the opamp, really gnd?
In other words, if you connect a DMM on AC range between you AC gnd and gnd, do you get a reading?
I have no make this test...and now I'm away. Again, what is the alternative?
AC ON when it start to rotate the fan (mode dry, cool, hot, etcc...). AC Main is always ON because it wait remote controller command
If your AC gnd is not really gnd and you connect a grounded circuit to it you may damage your AC.
I thought that link/share/tie AC gnd with circuit gnd was only for get a V ref. If I share the gnd I can make a compare (with opamp) between two voltage.
Firstly that is exactly how a potentiometer is drawn (there is a variant with a box rather than
a zigzag too). Variable resistor (2 terminal device) is drawn with the slanting arrow through,
that's a different configuration not relevant here.
Secondly there needs to be something like a 10k protection resistor between the voltage
source and the non-inverting input of the opamp to protect your circuit both from rogue voltage
spikes and when its connected but not powered up (phantom powering).
And thirdly a comparator is the normal component to use here, opamps are not really designed for
this. The Arduino's based on the ATmega chip even have a built-in comparator on one of the pins.
And of course you could simply use an analog input and do the thresholding in software.