Promblem controlling an 1-10V dimming ballast

Hello everyone,

i am new with the arduino and am using it at my project which is controlling an 1-10v dimmable ballast.
First i made a circuit using an omp amp to multiple the arduino PWM output.This circuit normally works but when i connect it to the ballast the lamps are not dimmed.
I measured the 1-10v input of the ballast when its only powered with 220V ac and it gives me 13V
When i connect it to the arduino and altering its out put voltage this voltage is only changing a little.
What might be wrong ?Could anyone help me?

sorry if my English are bad

Your problem is that you think you can output 1 - 10 V from the arduino using PWM.
Not true.
PWM stands for Pulse Width Modulation

1 - 10 V Input requires ANALOG.

PWM != ANALOG

You need a DAC

It IS possible to filter PWM using an RC LP FILTER

( 4.7k ohm resistor in series with 1 to 2.2 uF cap, with the input at one end of the resistor and the output
at the other end of the resistor where it connects to the cap .

The LP FILTER is going to have a slower response time than the DAC and the DAC is only $5 so it makes
more sense to order the DAC and use the LP filter as a temporary work around until your DAC arrives.

Also, the DAC can only output 0 - 5V dc so you need an OP AMP configured as a Non-Inverting Amplifier, with RIn =Rf because the gain formula for a non-inverting amplifier
is :
Vout=[(Rf/RIn)+1]
Let RIn=Rf= 10k ohm
Then,
Vout= (10k/10k)+1 = 2

2 x 5Vdc = 10V dc
Obviously you have to power the op amp with +12V, Not 5V. Get the lowest current 12V dc wall wart
you can find. (100 mA) would be ideal.

You still need the Gain of 2 op amp amplifier if you use the RC LP filter since the PWM is 0 - 5Vdc.
Either way you need the x2 amplifier.

Datasheet for the ballast in question? The starting point is finding out what it expects
as input. That means knowing the impedance, not just the nominal voltage levels. For all
we know it is happy with PWM.

thank you a lot for your replies.

i have used an RC filter before the omp-amp so i can gain 0-10V from the arduino output.
here is a picture from my circuit:

and the datasheet from the ballast that i am using:
http://www.hepgmbh.de/uploads/datenblaetter/Dimmable_ECG_for_2_Lamps_1398845992.pdf

as fas as it is 1-10V i think it would expect 1-10v and not measuring 13V.
I can't understand what impact the impedance has

Some 0-10V dimmers work with PWM and some don't.

This circuit normally works but when i connect it to the ballast the lamps are not dimmed.

Do you still get the 10V PWM with the ballast connected?

How do you know it's working? Do you have an oscilloscope to look at the PWM?

If you don't have a 'scope, you can set the PWM to 100% and you should get 10VDC out of the op-amp with everything working correctly. If you've got 10VDC out of the op-amp, connect the ballast and see if you still get 10V.

Or, connect ~10VDC from your power supply directly the ballast to see if it comes-on to 100% brightness.

Then connect 5V to see if you get about half-brightness.

Or, you could also connect an LED to the 0-10V output to confirm the PWM is "dimming", and then leave the LED connected when you connect the ballast to see if the LED is still dimming normally or if the ballast is killing the control signal.

Then ground the dimmer-input to see if it goes off (or dims to minimum).

I measured the 1-10v input of the ballast when its only powered with 220V ac and it gives me 13V

What??? You are measuring the input with nothing connected? Is the lamp at full-brightness? That might be normal... There could be an internal pull-up so the lamp works as a regular on/off light with the dimmer input unconnected.

If the dimmer works with PWM, it's "easier" to use a transistor or MOSFET than a linear amplifier built with an op-amp. But if you need DC, it's "easier" to put a low-pass filter in front of the op-amp's high-impedance input that to put the filter after the transistor/MOSFET.

[EDIT] OK, your op-amp and filter circuit looks OK to me (at least at 1st glance).

22k and 1uF is a time constant of 22ms, with a -3dB cutoff of 45Hz. So that should be good for a 490Hz PWM. A gain of 2, that looks fine.

Have you looked at the signal at the junction of R3 and C1 with a scope to see what is there?

BTW, you should never leave an Op Amp section disconnected. It may break into oscillation or lockup and draw loads of current, messing up the other section.

Connect the inverting input to the output, and the noninverting input to some mid-range voltage, not ground.

Some tips on drawing schematics: Draw batteries vertically. Don't wire all the ground leads together on the schematic, that is what the ground symbol is for.

I started getting you on the right track on your other post. Unfortunately it's now locked due to cross posting.

Check out this document

If omega(rad/S)breakpoint=45.45, (1/RC)

omega of breakpoint (-3 dB)

Wouldn't the frequency in Hz be 7.23 Hz ?

or is the omegabreakpoint expressed in Hz ?

DVDdoug:
Some 0-10V dimmers work with PWM and some don't.
Do you still get the 10V PWM with the ballast connected?

no i am getting a little higher about 11V

DVDdoug:
How do you know it's working? Do you have an oscilloscope to look at the PWM?

If you don't have a 'scope, you can set the PWM to 100% and you should get 10VDC out of the op-amp with everything working correctly. If you've got 10VDC out of the op-amp, connect the ballast and see if you still get 10V.

i dont have a scope but at 100% PWM i get very close to 10V

DVDdoug:
Or, you could also connect an LED to the 0-10V output to confirm the PWM is "dimming", and then leave the LED connected when you connect the ballast to see if the LED is still dimming normally or if the ballast is killing the control signal.

I have tried this with the Led and the led was dimmed.
I will follow your suggestion and also connect the led with the ballast

DVDdoug:
What??? You are measuring the input with nothing connected? Is the lamp at full-brightness? That might be normal... There could be an internal pull-up so the lamp works as a regular on/off light with the dimmer input unconnected.

if you dont connect anything at the 1-10v input the ballast is working as a regular non dimmable ballast at full range.Measuring these two pins without anything connected i get 13V. i know it is very strange

KenF:
I started getting you on the right track on your other post. Unfortunately it's now locked due to cross posting.

Check out this document

i think that the DALI dimming ballasts work with manchester coding and not the 1-10V. These are using analog 1-10V voltage

akis31:
i think that the DALI dimming ballasts work with manchester coding and not the 1-10V. These are using analog 1-10V voltage

I strongly suspect you're not going to get any reasonable results then unless you add a capacitor to smooth out the PWM to a steady DC voltage level.

Oops, sorry, raschemmel you've got me there.

The -3dB point is the frequency at which the output of the filter is 1/2 power (ratio of 1:2). Since voltage ratio is the square root of the power ratio, the output voltage should be 1/sqrt(2).

Well, without going into several paragraphs, this is the point at which Xc = R, because capacitive reactance leads resistive, er, resistance, so at this point, the voltage is 1/sqrt(2) and shifted by 45 degrees.

So R = 1/(2piCf)
f = 1/(2piRC)
f = 7.23Hz
It drops off by -6dB per octave, so at 490Hz there should be very little ripple.

Try PWM output at 50% and see if you are getting 2.5V at the junction of R3 and C1, and at the same time are you getting 5V from the output of the Op Amp.

How about that second section? Did you read my message?

You should have pot in series with the feedback resistor to adjust the gain.

Re: adjustable gain
Yes, good.

But we still don't have confirmation of what is going on at the end of the RC lowpass network. Try it at different PWM settings and see if the voltage properly correlates with the PWM.

akis31:
as fas as it is 1-10V i think it would expect 1-10v and not measuring 13V.
I can't understand what impact the impedance has

Because some devices will be fairly low impedance (industrial controllers
for example) to reduce sensitivity to noise. This means you have to
drive with an output stage capable of supplying enough current without
overloading. Here the device is rated at 0.6mA max, which isn't a problem
for standard op-amps.

Some devices have their own RC filter on the input so that PWM will typically
just work. Others don't and may malfunction given direct PWM.

Maybe it isn't really 13V (rms). Maybe it is higher than that with the ripple and the meter is averaging the
ripple down to 13V. Also , what do you want to bet that the OP doesn't know that the output voltage rating
for a 12V walwart is based on the rated current and the voltage increases as the load decreases. An unloaded 12V walwart can output 14 to 15V. An op amp draws so little current , as far as a load is concerned, it is neglible. The walwart is essentially UNLOADED (assuming there IS a walwart). Consequently, my guess is that if you scope it out you'll see a 14V peak ripple , dipping down to 11 or 12V
and reading 13V rms on the meter. Try increasing the capacitance in the RC filter and see how that effects
the output voltage.

Because some devices will be fairly low impedance (industrial controllers
for example) to reduce sensitivity to noise. This means you have to
drive with an output stage capable of supplying enough current without
overloading. Here the device is rated at 0.6mA max, which isn't a problem
for standard op-amps.

@OP,
The translation of the above is:

"Use a voltage follower op amp as an output buffer amplifier"

What are you using for the "12V" PS ?

raschemmel:
Maybe it isn't really 13V (rms). Maybe it is higher than that with the ripple and the meter is averaging the
ripple down to 13V.

I cannot see in the OPs descriptions, any reference to 13V RMS.

What he said was that with no control input, he measures 13V (DC) across the control terminals. This is precisely as you would expect; it has some form of pull-up to an internal voltage source, which same source is operating its control circuits - how else would it be able to calibrate to the 10V as "full scale"? Obviously, it would not default to less than 10V because it must default to full brilliance and presumably any voltage up to 10V will result in a proportional dimming function whilst any voltage of 10V or greater will be full brilliance.

raschemmel:
You should have pot in series with the feedback resistor to adjust the gain.

Possibly useful, but his circuit should produce an exact doubling of the PWM result which in turn should accurately reflect the 0 to 5V from the Arduino.

KenF:
I strongly suspect you're not going to get any reasonable results then unless you add a capacitor to smooth out the PWM to a steady DC voltage level.

Did you actually look at the circuit he gave?

polymorph:
BTW, you should never leave an Op Amp section disconnected. It may break into oscillation or lockup and draw loads of current, messing up the other section.

Fair point, may or may not relate here.

Paul__B:
Did you actually look at the circuit he gave?

In all honesty, NO. Probably as I was still a tad irritated by the cross posting issue.

I cannot see in the OPs descriptions, any reference to 13V RMS.

What do you think the meter he used to measure the 13V dc was displaying ?

You aren't really telling me that you didn't know all digital meters use rms to display dc voltage ?

Fluke 87V Industrial True RMS Multimeter with Temperature (TRMS, Analog Bargraph, Digital Display, Backlight, 1000VAC/DC, Measure up to 10 A, 20 A for up to 30 seconds)

What he said was that with no control input, he measures 13V (DC) across the control terminals. This is precisely as you would expect; it has some form of pull-up to an internal voltage source, which same source is operating its control circuits - how else would it be able to calibrate to the 10V as "full scale"? Obviously, it would not default to less than 10V because it must default to full brilliance and presumably any voltage up to 10V will result in a proportional dimming function whilst any voltage of 1V or greater will be full brilliance.

Nothing the OP said or could say about the device he want to control has any relevance to the output
voltage of the RC LP FILTER. If he has not measured that by itself, without a connection to the dimmer
then we are wasting our time.

Based on this comment:

i have used an RC filter before the omp-amp so i can gain 0-10V from the arduino output.
here is a picture from my circuit:

It would appear he has, however, I would feel more comfortable about it if he had worded his comment,
"I measured 0- 10 V on the output of the filter with no connection to the dimmer"
but maybe that is just his way of saying that. I don't know.

" i can gain" isn't exactly "I measured..." but I suppose it's just semantics and that's what he meant.

I am not concerned about what he measures on the floating input of the device. My first question would be does the thing turn off when he shorts the input to ground ? My next question would be does it turn on full when he connect a 9V smoke alarm battery to it. My next question would be what happens when he connects a 10k pot across the 9V battery and connects the output of that to the dimmer analog input. If everything up to that point seems to work, then it would be appropriate to go ahead and test his RC LP FILTER output with the dimmer.

I must say I don't follow this comment:

proportional dimming function whilst any voltage of 1V or greater will be full brilliance.

in view of the OP's comment:

my project which is controlling an 1-10v dimmable ballast.

Why would any voltage 1V or greater result in maximum intensity ?
What is the rational for that ?

@OP,

Promblem controlling an 1-10V dimming ballast

What's wrong with this picture ?

MarkT:
Here the device is rated at 0.6mA max, which isn't a problem
for standard op-amps.

maybe it is a silly question but how can i find out the exact current my circuit with the amplifier produces?
because the nominal current for the ballast at the 1-10v terminal is 0.8mA max

polymorph:
How about that second section? Did you read my message?

you mean connecting the second omp amp of the Lm358n as a voltage follower?

raschemmel:
@OP,
The translation of the above is:

"Use a voltage follower op amp as an output buffer amplifier"

What are you using for the "12V" PS ?

where should i connect the voltage follower? thas why i chose Lm358n so i would have a second om amp just in that case

for now i am using a 12v battery

raschemmel:
It would appear he has, however, I would feel more comfortable about it if he had worded his comment,
"I measured 0- 10 V on the output of the filter with no connection to the dimmer"
but maybe that is just his way of saying that. I don't know.

i am sorry i didn't make it clear. without the dimmer connected the output of omp amp gives maximux 10V that i need. the output of the filter without the dimmer connected gives a value close enough to the value of the arduino output.

the dimmer not connected to my circuit ,connected only to 220v supply voltage gives at the 1-10v input terminals 13V.

Fixed the obvious "1V" blunder. OK?

The LM358 should be perfectly capable of supplying a few mA to drive an input specified as drawing (or in fact, sourcing) 0.8 mA. No need at all for a further voltage follower. If the first stage cannot drive the output, the second will not either. ::slight_smile:

The gist of the present advice is: split the problem. Put a 1k potentiometer across the 12V battery and apply that voltage (with negatives connected, need I say it) to the dimmer. Does that execute correct dimming?

Does the Arduino through the Op-amp generate a smoothly varying 0 to 10V output under program control?

If both these parts work, it is a mystery as to why connecting the two parts together, does not.