Measure PWM output with Arduino?

I have a pwm regulator and I want to measure its output voltage with arduino but when I connect voltage divider to positive and ground of the output regulator stops working but only when the voltage divider is connected to arduino’s pins.Regulator works between 6-90V input with max 15A current and pwm frequency 16kHz.Output will be usually between 14,2V and 30V with the same current.(10-15A)

new-6-90v-15a-dc-motor-speed-controller-pulse-width-pwm-regulator-switch-16khz-da4af338154ed54543e6f41bc6df51f9.jpg

Hi, Can you post a schematic of how you connected the arduino, including power supply and how the gnds are connected. Also a picture of your test circuit assembly would help.

Thanks.. Tom.... :)

Well the schematic is basic.....I just want to measure the output voltage for now.... [url=http:// Edit: I dont have a schematic of the regulator itself because I bought it from aliexpress and I can't find any other info about it....some of the elements on the board dont have markings or anything...

Schematic image file size is WAY TOO SMALL. Retake photo and post 1 Mbyte image file.
can’t read schematic.

Sorry something went wrong with previous link...

Still can't read it.

attachment

Hi, What are you using as a power supply to the controller? If you connect the divider to the output, but not the arduino to the divider, what happens? That is remove both arduino connection, A0 and gnd.

Thanks.. Tom.. :)

Hi,
With the motor running can you measure the voltage between the neg power and neg motor terminals please?
copy1.jpg

Thanks… Tom… :slight_smile:

If I disconnect the voltage divider from arduino and it's only connected to regulator everything works fine....Arduino is supplied from USB port of my laptop. I'm not using a motor for now, just a 15V 25W lightbulb....so the problem: I'm using digital potentiometer as well in order to regulate voltage automaticaly with Arduino(mcp41010).I have replaced the original analog pot with MCP and it works fine.Wrote some basic code(loop) to move pot's wiper from 0-255 tap and vice versa to see the effect and test it.During regulation(moving the wiper and changing duty cycle) the lightbulb goes from dimmed to 100% and backwards and if I connect the voltage devider to arduino and regulator output lightbulb instantly goes 100% powered although it should be for instance at 50% power at that moment.(no regulation)If I connect voltage divider only to regulator output(without connecting it to arduino)-nothing happens/works fine but I can receive data for output voltage... P.s 2 days ago I burned the same regulator while I mixed up connections and connected positive(input) with negative(output)....thank goodness I bought 2...so I'm a bit afraid of doing that kind of measurement :D

Another thing....a few people said that I should create a RC filter because I'm trying to input digital to analog but I'm not sure about that and I definitely don't know how to calculate such filter and how to choose the resistor and capacitor for it....

Hi, You can do the measurment I suggested, with a DMM, I suspect the MOTOR -ve and the POWER -ve are not the same.

I'm using digital potentiometer as well in order to regulate voltage automaticaly with Arduino(mcp41010)

Okay, PLEASE draw a COMPLETE circuit, you did not have the digi pot in it. You will possibly have a problem with gnd references and the controller, without a circuit diag of the PWM controller (I have tried to find one but to no avail) it will be difficult to work how to solve your problem.

Thanks.. Tom... :)

a few people said that I should create a RC filter because I'm trying to input digital to analog but I'm not sure about that and I definitely don't know how to calculate such filter and how to choose the resistor and capacitor for it....

Take a look at this

Personally, I always use 4.7k ohm and 1 uF to 10 uF (depending on what I have laying around)

OK the schematics is…ugly :slight_smile: as I said there is no schematic of the regulator so I had to do it with some photoshop bad skills and fritzing…

raschemmel:
Take a look at this

Personally, I always use 4.7k ohm and 1 uF to 10 uF (depending on what I have laying around)

Thats what I ment as well but I not an electrician so…If I apply 30V and 15A to the capacitor and resistor…are they going to burnout(they are at the same circuit…I think…)…that is the problem…I don’t know how to choose them and what should I look for…except “4.7k ohm and 1 uF to 10 uF”

I don't think that's your problem . Ask yourself this, how would an aircraft pilot feel if he did not know how to navigate ? Now, assume that feeling because you do not know Ohm's Law.

So let'z see what Ohm's Law says about your comment. Let V=30V I =15A (as we will see , this is only your power supply rating and has no relavancd per se to anything else because:

I = V/R Let R= 4700 ohms.+ 100 Mohms This is because the capacitor is NOT a load. The RC LPF (resistor-capcitor low pass filter) connects the OUTPUT of the 1/30th voltage divider to the analog input which has an INPUT impedance in the order of 100 Mohms. The ADC input current is 160 nA. The volatge divider reduces the 30 V to 30*(1000/31000)= 0.967 V. You refer to your regulator as a PWM regulator. If we assume you are saying the output is PWM, then the 0.967V is also PWM ( which of course means it would NOT read 0.967V on meter but would measure 0.967V peak to peak on a scope.)

The current through the 4.7 k ohm resistor is 160 nA. Do you think that will blow anything up ?

Hi, You can do the measurment I suggested, with a DMM, I suspect the MOTOR -ve and the POWER -ve are not the same.

Thanks.. Tom... :)

If I connect voltage divider only to regulator output(without connecting it to arduino)-nothing happens/works fine but I can receive data for output voltage...

Is it possible you meant to say "I can NOT receive data for output voltage.." ?

What is the INPUT power supply for the controller ?

yes thats what i ment....type-o Power supply is around 15VDC for now because I'm testing it with a light bulb which needs max 15V

TomGeorge: Hi, You can do the measurment I suggested, with a DMM, I suspect the MOTOR -ve and the POWER -ve are not the same.

Thanks.. Tom... :)

Ok I measured it and the voltage was same 15V max 0V min....because I move the wiper of the digipot all the time....interesting thing for me was the fact that when the light bulb is 100% powered the voltage between the two negatives was 0 and when it was 0% it was maximum...