Pages: 1 [2]   Go Down
Author Topic: Variable resistance to control MEAN WELL HLG-120H-42B  (Read 1635 times)
0 Members and 1 Guest are viewing this topic.
USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any suggestions as to how to amplify the signal?
You could use a transistor (either BJTs or MOSFETs would work) and some resistors for a simple level converting circuit (as in this schematic). 

Or you could use an op-amp based non-inverting amplifier with a voltage gain of about 3.85, but since a PWM signal is digital there's no innate advantage to use this method.

By ADC, are you referring to the DAC on the Duo?  Does this mean the Duo can't output a constant 1.2345 V signal, for example?  Anyone, I think the correct road to go down is using a capacitor as a low-pass filter for the standard PWM.  I could get this working first with PWM only, then try to add the filter.

No, I'm referring to analog-to-digital conversion and this capability exists in some form on all official (and probably all non-official) Arduino boards, not just the Due.  DAC, or digital-to-analog conversion is basically the opposite process and the Due is currently the only official Arduino board to have real DAC outputs.  In some circumstances PWM (which again all Arduinos have) can be used to effectively simulate ADC, but that really only works with some types of parts.

I don't know if the Due can output exactly 1.2345 VDC.  However, since it's DAC has 12-bit resolution that means there are 4,096 distinct voltage levels it can output between 0 and 3.3 VDC.  So even if it cant output that specific value it can get very close.  By the way, if you wanted to amplify an analog voltage like this than you would need something like the op-amp based amplifier I mentioned before, rather than just a logic level shifter.   
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't know if the Due can output exactly 1.2345 VDC.  However, since it's DAC has 12-bit resolution that means there are 4,096 distinct voltage levels it can output between 0 and 3.3 VDC.  So even if it cant output that specific value it can get very close
  That is good enough, it doesn't need to be very close.  From the early description of the DAC I thought this might only output a wave, for example, a smooth wave between 0 and 1.2345 V at a specific frequency.

Quote
Or you could use an op-amp based non-inverting amplifier with a voltage gain of about 3.85
  Can you tell me more about this?  I am a software guy.  I see some very cheap op-amps online, but they all have much larger voltage gains.  Also, why 3.85?  3.3V (or 5V) + 3.85V is less than 10V
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is good enough, it doesn't need to be very close.  From the early description of the DAC I thought this might only output a wave, for example, a smooth wave between 0 and 1.2345 V at a specific frequency.
A DAC takes an integer value (specifically a number between 0 and 2n-1, where n is the resolution in bits) each cycle and outputs a voltage level between the minimum and the maximum output voltage.  For example, on the Due 0 would be 0 VDC and 4,095 would be 3.3 VDC; but many DACs have a much wider output voltage range, including negative voltages on some.  If you want a constant output, just keep feeding the DAC the same integer value.  If you want some sort of waveform vary the integer value so you get the frequency and wave shape you want.

Can you tell me more about this?  I am a software guy.  I see some very cheap op-amps online, but they all have much larger voltage gains.  Also, why 3.85?  3.3V (or 5V) + 3.85V is less than 10V
Amplification is generally expressed as a factor (AV) that's either the ratio of output over input , AV = VOUT / VIN , or multiplied with the input to get the desired output,  AV * VIN = VOUT.  Regarding the value of 3.85, for some reason I thought the desired voltage was 12 VDC not 10 VDC.  3.85 * 3.3 VDC = 12.705 VDC  So you'd have enough for 12 VDC plus the forward voltage drop of a standard diode to prevent any back EMF.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post an example of an amplifier similar to what might work to give me a better idea?

If this maxes out at 9V, I lose a small amount of dimming range (lowest brightness settings) which is not a big deal.  If this maxes out at 12V and blows my driver ($20-$100) this is a big deal.
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post an example of an amplifier similar to what might work to give me a better idea?
The gain for an op-amp is usually set using two or more resistors, there exact configuration is based on what type of amplification circuit you use.  In a non-inverting amplifier you'd normally have two resistors (R1 & R2) configured similar to a voltage divider between the output and ground, with point between R1 and R2 going to the inverting input ("-" or "V-" on schematics) of the op-amp.  The ratio between them determines the gain, for many op-amp "families" the formula for voltage gain will be AV ≈ (R1/R2)+1 but check the datasheets for the exact performance of a specific part.  The other connections are straight-forward the non-inverting input is connected to the input voltage, and the positive power supply pin needs to be at least as high as your desired output voltage level (it doesn't matter if it's higher) and your negative power supply pin will be grounded (Aside: most op-amps can have negative voltages but in this case you don't want to do that).  

Here's an example of a non-inverting amplifier using a LM358N op-amp.  If you were to use that op-amp and wanted to output exactly 10 VDC from exactly 3.3 VDC, the voltage gain would need to be 3.0303... (i.e. AV = VOUT / VIN = 10/3)   Therefore, the ratio of resistor values should be 2.03... (i.e. R1/R2 = AV - 1 = 3.03... - 1).  The exact resistance values you use are less important than achieving the necessary ratio of resistance values.

Edit: Here's a on using op amps...
« Last Edit: November 02, 2012, 11:56:00 am by Far-seeker » Logged

Pages: 1 [2]   Go Up
Jump to: