Hello, i have trouble making my ina219 current sensors work. One of them works, the other one just stays permanently at -0,05 no matter what i do here are pictures to showcase it:
Even if they could measure AC you have them wired wrong and your code is totally wrong.
Best to start over with the correct sensor and do it right.
What are the range of voltages and currents you want to measure?
I've heard from multiple sources that they can be used for AC as well. Can you tell me what is wrong about the wiring?
Regarding the code: I know that some parts have redundant and janky code, it's a 3 years old project i have to continue on now, so i'm building on something i was able to do back then, which wasn't very good, i'm intending to improving the code but if you got any tips or see something alarmingly wrong, please tell.
However the main concern is making the second sensor work.
Voltages and currents: the sine source is an output from transformator 12V and 2A
If you would, please explain how hooking the INA219's SCL and SDA I2C signals up to analog inputs rather than the Uno's SCL and SDA pins is supposed to work.
Please post a complete schematic, the diagram in your OP helps a bit, but it's not a schematic and doesn't show how everything is wired. I could guess what you have, but that's a waste of my time and useless to you.
The idea that you can select 2 different frequencies from different tappings on a transformer is, to put it politely, interesting.
ohh i have no idea i could do that so i think that's most likely the problem.
I haven't soldered anything so that means they share the same i2c address right now right?
Okay i haven't tested it out yet, but rn when i test the sensors seperately they work, when i test them at once only one of them is displayed on plotter, so i guess my error is this. Thank you so much!
That is correct. That is why I suggest checking the new i2c addresses with the i2c_scanner when you are done changing, just to ensure they ended up where you thought.
Well then I suggest you ask those multiple sources how to connect them and write the code.
However, If you read the datasheet you will soon realize that they cannot measure AC.
They were never intended to measure AC and no one uses them to measure AC
Hey i didn't mean it to sound like other people know better than you. I'm not trying to argue with you, certainly not with people that are trying to help in their free time so sorry if it came out that way, i was just stating - my professor told me it should be fine to use this so i did and frankly i don't have any other option now, so i guess i just gotta roll with it now.
It's just odd to me because if you would use diode bridge, suddenly it should be completely fine to use. But at the same time ina219 is able to read negative and positive at the same time so it's making me confused.
If the prof said it was OK and you just need to plot some point on a graph then it's OK. However, if you need to make accurate measurements of peak, rms, average values or phase and frequency measurements you may find the code difficult or impossible to write.