Not quite. You are assuming zero voltage drop through the H-Bridge and that the '9V' supply is well regulated under load.
Perhaps it won't matter. Why is it you want to measure the resistance of the load?
Not quite. You are assuming zero voltage drop through the H-Bridge and that the '9V' supply is well regulated under load.
Perhaps it won't matter. Why is it you want to measure the resistance of the load?
That still does not help if you have a resistance that varies with the current, because you are applying either 0 volts or full voltage, and consequently either no current or full current, with nothing in between (except for the short time that the PWM signal is switching between 0v and max volts).
Exactly what type of load are you trying to measure that has a resistance that varies with current? Are you sure the resistance is proportional to current, and not power (or temperature, such as a light bulb filament)?
Thanks a lot David. very good point. yes, the resistance is a function of the power and that's why by changing the duty cycle of the input voltage I am trying to actually change the input power.
Do you know what voltage you might see across your Rsense? You might need an amplifier if the currents are real low resulting in a low voltage across Rsense.
Else the sequence in post #14 should work.
I am sending around 100-300 mA across the load. I am wondering can you point me to an A/D measurement example?
Thanks a lot @JohnRob
No, you are not. Loads draw current.
True but the load expected to draw 100-300mA current from the PWM based on its resistance.
The Arduino ide has a pretty good example. Look under File/examples/analog.
If a simple if statement is not fast enough you might have to delve into the A/D details.
I would perform 3 or 4 readings in a row, as fast as possible. The goal would be to see if all the reading are the same (or at least close).
long uint Peak1
long uint Peak2
long uint Peak3
long uint Peak4
Peak1 = analogRead(analogPin)
Peak2 = analogRead(analogPin)
Peak3 = analogRead(analogPin)
Peak4 = analogRead(analogPin)
Print out Peak1 to Peak4
Note: It's not strictly a sense resistor like the diagram shows. It's a resistor on the sense pin of the L298P H-Bridge chip used in the Arduino Motor Shield Rev3.
Yes but there is a 0.15 ohm resistor in the return of each bridge Driver Sense Resistor
So I guess I was asking for the current the OP is expecting, however now looking at the schematic of the board and thinking it through I don't believe the sense voltage is a PWM but a triangle wave.
From the motor shield documentation:
"On each channel will be a voltage proportional to the measured current, which can be read as a normal analog input, through the function analogRead() on the analog input A0 and A1. For your convenience it is calibrated to be 3.3V when the channel is delivering its maximum possible current, that is 2A."
On a 5V Arduino that should give you an analog input of 0 to about 676 (about 3 mA per step).
Thanks a lot @johnwasser and @JohnRob .The main challenge I have is that the analogRead() does not give meaningful data for a PWM signal. How should I solve this?
I still have no idea what you're doing, but Reply #4 would do it for me.
Can you tell us what your load is?
And can you give us a numerical example of the data you are seeing?
This answer uses very clear language to speed up the resolution of the problem. It may sound rough, but it is not meant to be unfriendly, it is only intended to emphasize how important it is to provide precise and detailed information.
From the way you
I conclude that your knowledge about how electronics really works is very very limited.
You have already shown that you have multiple misconceptions about electronics.
I highly doubt that you have a "voltage-dependend-resistor.
Most electronic parts that are called "resistor" do have a voltage-constant-resistance.
Maybe 0,1% of all kinds of resistors are voltage-dependend.
It is very likely that what you call a "variable resistive load" is either not a resistor or non-voltage-dependend.
Please post a picture of your hardware. Post as much information as you have about this
take a picture with your smartphone of it
Post a link where you have bought it
Write what kind of measurement-equipment you have
do you have an oscilloscope?
do you have a digital multimeter?
it would be very helpful if you would describe the final purpose of it all.
it would be very helpful if you would give a detailed description of the complete project.
We are 4 days beyond your initial question and nothing substantial has happened yet.
The reason is the small information you have provided so far.
Imagine how much information you could have posted within 4x16 hours = 64 hours.
So if you want to proceed into the direction of finishing your project provide the informations asked above.
best regards Stefan
Measuring the amplitude of a PWM signal is very straightforward and is exactly how AM radio demodulation works. All you need is a diode detector circuit
@johnerrington Thanks a lot. I tried this breakout which essentially should be similar to what you suggest, right? somehow it does not work even if my current in the right range. maybe I damaged the board somehow
INA169 Breakout Board Hookup Guide - SparkFun Learn
I am a novice and my apologies for that. The
the resistance can change by 10% based on the input power so it is really a voltage dependent one. It is just a wire to be honest with you and I am not sure how the picture will help
but the link provided by @johnerrington seems to be what I want. As mentioned earlier in the post I am not sure why the breakout is not working though.
Thanks
user believes to "know" what he is doing. topic changed from tracking to normal.
But still he refuses to say what he is measuring. It would clear things up a lot if we had an example of the sorts of thing he is trying to measure. Despite being asked several times he refuses to answer.
sorry @Grumpy_Mike
I am trying to measure the change in resistance of the wire as a feedback to my system. I have oscilloscope and DMM to check the output manually/troubleshooting but I want to have this measurement embedded in my Ardunio code.