Hello, i have a task, in which i have to measure RLC circuit parameters using this circuit. The thing is, i'm a beginner and i've haven't done anything complex besides projects like led dimmer and blinker and lcd display. So i'm a bit lost in this. if someone could advise me where to search for info on how to measure voltage between two points and how to measure current and most importantly, how to generate AC signal, that would be really nice :)
What is Your background regarding the theory of L, C and R?
hey, i understand how to measure these parameters and i know what they mean in physics and i already measured these with classical multimeters. the thing is i don't know how to set this up in arduino. Edit: what confuses me is that i don't know how to do the parallel measurement for voltage, do i just make an empty branch next to a resistor for example and use it as input? like this
https://www.autodraw.com/share/UB15GIDCFQAE I guess i'm wrong, because as far as i know, for measuring voltage, you are basically measuring potential difference between two points, and this is based on one point.
What kind of measuring stuff do You intend to use? Measuring AC call for measuring both current and voltage at the same time. Using a conventional micro controller You can read current, wait for the result, and then, some time later start the voltage reading. That introduces an error. A more sophisticated arrangement would be to trigger 2 AD converters to start at the same time, one reading voltage, the other reading current.
To manage measuring those 3 components I suggest this: Measure them one at the time. The component being measured is the one connected to GND. Then swop the order of the components and put the next component close to ground. Note that L and C are next to each other.
The circuit,from up to down could be R, L and C. Then R, C and L. Finally try L, c and R. Measure one the last component.
Do You get it? No differetial measuring, only measuring +object to GND!
Sorry i didn’t understand the first question. What do you mean by measuring stuff?
I’m not using any kind of multimeter or generator, since this is a school project, and i don’t have access to school generators and multimeters and i don’t have any of my own, because of the covid situation, i need the measurements to be fully dependent on arduino, because later, i intend to send them to a web server by esp8266. So, can i somehow generate AC signal with arduino?
Though i think i understand your point about measuring voltage and current measurement. I basically need to use two analogRead() functions to read input pins connected to the object i am measuring and at the same time, connect the measured object to ground on arduino. and then convert the integer number i got from analogRead() into a value resembling current or voltage? Did i get that right?
Unfortunately, i cannot measure these components one at the time, because they have to be physically connected in the circuit in the same way all the time.
Personally, this isn't something I'd try to build... I might build a dedicated "panel meter" to measure voltage or current (like for an automotive application) but I wouldn't try making a general purpose LCR meter or a multimeter, etc.
I guess i'm wrong, because as far as i know, for measuring voltage, you are basically measuring potential difference between two points, and this is based on one point.
The Arduino only measures 0 to +5V (or you can use a lower reference) relative to it's ground. But if you have an isolated power supply (or separate battery) you can "float" the ground and use it just like the minus lead on a multimeter, and you can connect it anywhere (as long as that voltage is negative relative to the analog input).
Another way to measure between two arbitrary points (with a common ground) is to use two analog inputs and subtract in software.
AC presents a "special problem" because the Arduino can be damaged by negative voltages (again, negative relative to it's ground). A couple of solutions are to rectify the voltage (either full-wave or half wave) or you can add a negative voltage protection circuit and ignore the negative half of the waveform (and assume it's the same as the positive half). I assume most multimeters use a precision rectifier.
And when you measure AC you are "sampling" by measuring one instant in time (AKA "sampling"). And if you are using two analog inputs to measure the difference, there is only one shared/multiplexed ADC so you can't measure both voltages at exactly the same time. If you know you have a continuous sine wave you can simply find the (positive) peak because there is a known relationship between RMS & peak. Of course, you do have to sample fast-enough to "catch" the peak.
I basically need to use two analogRead() functions to read input pins connected to the object i am measuring and at the same time, connect the measured object to ground on arduino. and then convert the integer number i got from analogRead() into a value resembling current or voltage? Did i get that right?
Right... Subtract the readings before or after converting to Volts (I'd do it before).
The Arduino can't directly measure current. It only measures voltage.* So you have to measure voltage across a known resistance and then calculate current. If you are lucky you can use a "small" resistance (low resistance relative to the existing resistance/impedance) and still get enough voltage to measure. Or there are Hall effect devices and current transformers that can convert current to voltage.
- It measures voltage, but the unit-of measure is not "Volts" so you have to do a conversion based on the ADC bit count and reference voltage.
DVDdoug: Another way to measure between two arbitrary points (with a common ground) is to use two analog inputs and subtract in software.
Ohh, right, do you mean like getting the two values around resistor for example and then just do this: value1 - value2, just like a real voltage works, because it's a differene between two points, right? By rectifying, i guess you mean using a diode for example, so the current can make it only one way and then i basically mirror the negative values in my code, in order to resemble the other amplitude of the sine?
Okay, now i get how can i measure the thing without damaging my board, but how about generating it? can't i just make software solution, or do i need a physical AC generator?
The Uno is totally unsuitable for the task.
- It cannot generate a sine wave, only a fixed amplitude square wave.
- It cannot measure negative voltages commonly present in ac waveforms.
- All voltage measurements are referenced to the common of the power supply.
- You you cannot measure voltages across different components in a series circuit became of #3.
- You cannot measure current in positive supply lead because of #3.
Your experiments are far better served with individual meters and a signal generator. You are going down a rabbit hole that has nothing to do with the actual task in front of you, learning about RLC circuits.
Sorry WattsThat I must (partly) disagree
It cannot generate a sine wave, only a fixed amplitude square wave.
Or use a data table and and PWM with a suitable filter.
It cannot measure negative voltages commonly present in ac waveforms.
But you can use an op amp to shift the voltages
All voltage measurements are referenced to the common of the power supply.
You you cannot measure voltages across different components in a series circuit became of #3.
But you can measure all from the common ground and calculate their values.
You cannot measure current in positive supply lead because of #3.
?positive - its AC!
Again you can - by measuring the difference. Or use an instrumentation amplifier.
depending on the component values you would likely need to make measurements at high frequencies.
I’m sorry, as a school project I’d suggest its too complicated and unrealistic. Could you consider simplifying it to just measuring the values of capacitors and resistors?
If you “short circuit” the inductor in your diagram you can find Xc if you know R, Vr, Vc
and if you know the frequency you can find C.
unfortunately, this is the task, i cannot do it with multimeters and generators, though i realise, this would be a much easier task to do.
Although i could ask if i could borrow school generator, make circuit use this generator, but use arduino only to get values from the circuit, i could at least do that, right?
Perhaps switching to these tasks would be easier? “Measuring Volt-Amper characteristics of 5 led diodes of different colors and wavelenghts”?
I’m just trying to understand the assignment you have been given. It appears that you have been given a circuit and have been asked to instrument it with an Arduino.
In what format are the results to be delivered ? Direct graphics plotted from the Arduino IDE or are you delivering tables of samples (voltage/time etc.) to be plotted in some external system ?
Are you able to use hardware in addition to an Arduino ? With the values in that circuit , the current (around 80mA) could not be driven directly from an Arduino pin (DAC output / resistance ladder etc.) so you’d have to find an additional solution.
The picture shows some physical hardware and a lot of wires. Have you been given something clearer which would help identify the components?
The simulation controls shows a frequency selection range 1 to 20Hz so do you have to duplicate this frequency adjustment in your Arduino system ?
I quickly put this LTSpice simulation together showing the test circuit you have illustrated. However, I added a DC offset to the AC supply so the values are measurable with Arduino analog pins (no negative voltages). I guess you’ve just got to solve the AC generation with a DC offset.
The second picture shows the circuit current at 10Hz to be nearly 140mA
hello, thanks alot for your interest. Basically the picture i posted is from external source, not directly from my teacher, and that stuff with cables is not included in my task, the only thing that matters to me right now is to create it within arduino.
As additional hardware, do you mean a real sine generator? unfortunately i cannot. but i was just talking to my teacher today and he told me that i could use op amp to convert the DC to AC. Unfortunately i have to find some information about how op amp works first.
the question about the frequency: yes, it would be good to implement frequency adjustment. And the whole thing should be later controllable through web application, so the data should be handled by esp8266? but i need to build a base project that works first.
I've seen your ltspice simulation, is the ltspice program compatible with linux? I would like to get it too, since it would help me in my future projects. But basically you're right, if i understand your tp points, those are the ones i use as input for arduino, so i can get values that i can convert to current and voltage, right? Basically you're correct, my problem i need to solve now is to generate AC and make it measurable by arduino, though i don't know much about DC offset, so i should look up some info about it.
Edit: I noticed your second circuit. This may be a stupid question with simple answer, but why are you using two generators? i see the one has the parameter with the 10Hz frequency, but i don't understand the meaning of the second one
The LTSpice software appears to be available for Windows and Mac only. There may be other Spice variants around. Some even online.
I've added another picture which also makes it clearer how you add a DC offset with a simple DC source. That leaves you with the problem of generating an AC voltage.
I'm still not totally clear about the objective and the output you have to deliver, though. Are you simply instrumenting the circuit (as you have illustrated) and delivering the outputs in some format or is the objective to measure the values of the components ?
Also, you have to have some range limits on the components values if you are not working with the fixed values illustrated in your first picture.
Just to be clear. The (lower) 2.5 volt DC source provides the DC offset. The now separate 10Hz AC source has a 2.5 volt amplitude and now no DC component. The DC offset is necessary so the Arduino does not see negative voltages.
The project you have been given would be challenging to users with far more experience. Its wholly unrealistic.
Yes, change to "measuring Volt-Amper characteristics of 5 led diodes of different colors and wavelenghts" which is fairly straightforward.
As you have asked about op amps please have a look at this page which I'm currently developing - it isnt even linked into my site nav yet!
Oh, alright, i will try to check out some different spice software. Okay, i think i understand the thing DC offset, that looks simple. Thanks alot, though i'll have to either make use of Johns manual for op amps, which i thank him alot for, or ask my teacher for a way to somehow have access to generators we have in schools, i guess that it would be much easier to complete project with a real generator. John, did you mean the project is difficult given i am using op amps to get AC signal, or do you think the project as a whole is difficult?
6v6gt: Well basically as i said, what i'm trying to do now is to make sure that i am able to measure the values of the objects on the circuit. After that, i need to send those data to a web server, i guess the rest is basically web application development, and that's another topic, which i don't want to burden you with. And the final product looks something like this
http://kdt-30.karlov.mff.cuni.cz/ Although the whole page is in czech, i think you'll get the point
Of course my version of this experiment would be a narrowed down version, since i obviously don't have the capacity of university associate professor.
well it looks much harder than i thought it would be. I'll try to make up how to generate the signal somehow, first i'll ask my teacher about the generator, and if that fails, i'll try to use the materials provided by John. I'll of course try to do the volt-amper characteristics though, just in case i fail this project. I'll at least have something.
OK. So you are not attempting to calculate the component values of the resistor, inductor and capacitor by a program on the arduino. You are simply going to sample the data regularly at the measurement points you have identified then upload the collected data to a web server. Is that correct ?
If that is the case, then I don't believe it is very difficult. It would appear to be a matter of reading analog pins in a loop , maybe some calculations, then formatting the data (csv etc.) and finding some means means of uploading it.
Depending on the component values you chose, you may not need a high current AC source.
That web site that you linked appears to give the option of exporting data from that simulation. I don't see, though, any means of importing it (but I don't know czech ! ) . This looks like it is delivering samples about every millisecond for each measured parameter . .
Čas [s];I [mA];U [V];Ur [V];Ul [V];Uc [V];Frekvence 0,002;-12,69;0,26;-0,03;0,37;-0,10;20,7 0,003;-10,71;0,40;-0,02;0,53;-0,11;20,7 0,005;-5,41;0,50;-0,01;0,61;-0,12;20,7 0,007;-0,55;0,63;0,00;0,74;-0,12;20,7 0,009;4,53;0,71;0,01;0,80;-0,12;20,7 0,010;6,95;0,74;0,02;0,80;-0,12;20,7 0,012;11,66;0,75;0,03;0,79;-0,08;20,7 0,014;15,23;0,71;0,03;0,71;-0,05;20,7
If you REALLY WANT to pursue this tricky project (I would NOT) this page might give you some tips on generating a sine wave using a pwm output. The wave I generate ISNT a sine wave but you can easily change the data table.
Do you really need this headache when a much easier option is avaliable?
6v6gvt, yes, that is correct. It doesn't need option to import data, it serves as a distant experiment for students, so they can turn on the application, try it out, read some theory about it, export the data and process the data so they can use them in a homework for example.
John i thank you alot for your materials you've shared with me, i've read your last posted material about the op amp a bit, and i liked it alot. Yeah you are right, i have thought about it a bit and i think the best way would be to finish the VA characteristics first. But sooner or later, i will have to finish this one too, so it's still good to know a bit, how to do that
Youre very welcome. Dead right, do the easy one first.