Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

0-10v controls for fluorescent lamp dimming using microcontroller

Status
Not open for further replies.

crankler

Junior Member level 2
Joined
Dec 21, 2010
Messages
23
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,283
Activity points
1,479
Anyone who knows a way to produce output of 0-10 volts from at89c51 microcontroller?

Using DAC is not a good option.

One way i know is using pwm output from the microcontroller, smoothing the output with RC filter (0-5v out) and amplifying it with an op amp to produce 0-10v output.
My problem is at89c51 has no pwm output pins.

Please show some schematic..thanks..
 

Last edited:
Thanks for the advice...

So it is possible to use software PWM with at89c51 microcontroller. But i was wondering if i use software PWM, should the whole program and microcontroller be dedicated to producing PWM output or i can still add subroutines to control some relays for output?

What i mean is to have PWM output and another output to control some relays. Is it possible?
 

Hi,
Yes it is possible. All you have to do is carry out the PWM bit in interrupts. I don't know about the 8051 or its timers or anything related to 8051 but as a rough guide, you could do this. Your timer is 8-bit. So it can count to a maximum of 255. So if you preload it with 128, it counts 127 steps, so when you need 50% duty cycle, preload it with 128 and wait for interrupt where again you preload it with 128.
This could be your program flow:
Code:
ISR:
    1. Check if timer interrupt occurs
    2. Preload timer with x
    3. Do required job like setting the pin or clearing it
    4. Clear flag (if required, I don't know about 8051, but it's not required in AVR but required in PIC)
   5. Return from ISR
end ISR

main code:

   *  Initialize everything required, ie the ports, port directions, timer, etc

   1. Enable timer interrupt
   2. Enable global interrupt (if there is such a thing)
   3. Determine required value for duty cycle as : x(the preload value) = required duty cycle(0 to 1) * 255
   4. Load x into the timer
   5. Do other jobs while interrupt happens
end main code
I don't know about coding for 8051, so I showed here the required algorithm. These should be the basic steps that you can follow.

Hope this helps.
Tahmid.
 
Last edited:
Now i slightly understand how it works. I just need to learn the codes.
 

Okay, my plan specifically is to control/dim fluorescent lamps with at89c51 microcontroller. Now, i learned from Tahmid a way to produce PWM output which we can smoothed out and amplified into 0-10v analog signal controls for fluorescent dimming ballast.

From all the stuff i've read, the control pins of ballast acts like a current source of max. 2mA. The controls should act like a current sink in order to control/dim the lights.

Here's one forum i've read which has almost the same concept: Arduino Forum - [PARTLY SOLVED] T5 dimming using 0-10V

I've got the circuit running like the schematic below:

**broken link removed**

When the pwm value is changed, the output 1 of the LM324 alternates between 0 and +10V, I've done some real world measurements:
- With pwm at 0, output 1 is at 0V
- With pwm at 255, output 1 is at ~10V

If I connect the ballast to the output1 and ground, I am able to dim the ballast.. what I'm not fully understanding here is how the LM324 is doing the referred sink stuff.

Another reference: Fluorescent Lamp Dimming Controller
Here's the schematic/block diagram and the description and explanation on the pdf:

The amplifier is almost the same but there are few modifications and i don't have the part nos. of the added components.
 

Attachments

  • !!!!Fluorescent Lamp Dimming Controller.pdf
    210.9 KB · Views: 142
  • Like
Reactions: kender

    kender

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top