View previous topic :: View next topic |
Author |
Message |
leaveme
Joined: 24 Nov 2010 Posts: 19
|
AC Dimmer |
Posted: Tue Dec 13, 2011 9:43 am |
|
|
Hi,
I'm looking for an AC dimmer. I checked in code library but couldn't find anything.
Anybody has a working dimmer in CCS?
Do you mind to share...pls.
Thanks. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Tue Dec 13, 2011 11:01 am |
|
|
did you search on the term:
you might try that next ..... |
|
|
leaveme
Joined: 24 Nov 2010 Posts: 19
|
|
Posted: Tue Dec 13, 2011 11:20 am |
|
|
I tried the search but didn't return anything good. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Tue Dec 13, 2011 3:28 pm |
|
|
you asked this same question recently - and got other info.
what is your approach to solving this?
or more simply - how do you plan to go about
creating the circuitry and code to do it?
if you have no clue of where or how to start - THEN-
might i suggest the "100 series" courses in
electronics and engineering, at any local higher educational institution
as being a very good start.
I believe that is the way that most of us here learned to do electronic design ourselves. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Tue Dec 13, 2011 4:13 pm |
|
|
Microchip has several application notes about using PICs for AC dimmer control.While most are in Assembler(easy to learn) it is easy enough to translate into CCS C code.
All it takes is some reading and code cutting.
As well try 'googling' and you should come up with a few thousand 'hits'. Again, while some will be in another version of PIC C, easy to translate. |
|
|
leaveme
Joined: 24 Nov 2010 Posts: 19
|
|
Posted: Tue Dec 13, 2011 10:11 pm |
|
|
Thanks guys.
I tried google as well and google returned tons of references. But they are mostly assembler. Unfortunately I can't read asm.
I asked here if anyone willing to share a dimmer...anything in CCS. That will be a reference point for me. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Thu Dec 15, 2011 5:01 pm |
|
|
As a starting point -
Do you have a schematic of how you plan to do the
actual AC control?
Using a triac or other modulator?
What POWER level in, say watts, that you want to control?
Your line volts and frequency??
Whether or not you will need to run at very low duty cycles - ie
below 10% "ON" ?
which leads to....
A circuit to tell the pic when the mains power zero cross occurs,
with good enuf stability not to flicker at low modulation settings?
HOW you plan to tell the PIC what amount dimming you wish ?
{
Read a POT ??
listen to RS-232 ??
smoke signals ??
} //
The FIRST step in any design - is to, well, set the design specs right?? |
|
|
leaveme
Joined: 24 Nov 2010 Posts: 19
|
|
Posted: Mon Dec 19, 2011 4:25 am |
|
|
Hi asmboy,
I just need a simple dimmer in PIC, i.e. a dimmer by which you can control a 100w 220v/50Hz AC lamp.
Duty cycle is about 25% to full and a POT can be used to control.
I have no idea for zero cross synchronization. Any reference or example will really help.
Thank you. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Mon Dec 19, 2011 6:00 am |
|
|
Seriously, the words 'sledgehammer', and 'egg' seem to apply here.
Problem is that to use a PIC, means adding a power supply to run the PIC. PIC+PSU+dimmer, equals perhaps 10* the number of components needed for a simple dimmer.
Have a look at:
<http://www.aaroncake.net/circuits/dimmer.asp>
or any one of the dozens of similar circuits online.
Dirty, likely to make quite a lot of RF noise, and you _must_ ensure that you use a potentiometer that has a safe AC insulation rating, but shows just how simple a dimmer can be.
Where a processor does 'come in', is if (for instance) you want the circuit controlled from another location, or need to reduce RF (this is where zero-crossing comes in), but all involve increasing complexity.
Unless you need the extra features, KISS
Best Wishes |
|
|
leaveme
Joined: 24 Nov 2010 Posts: 19
|
|
Posted: Mon Dec 19, 2011 6:38 am |
|
|
Thanks Ttelmah.
I need something MCU controlled so complexity is ok with me.
Aah...nobody made similar yet... |
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
|
Posted: Mon Dec 19, 2011 7:25 am |
|
|
leaveme wrote: | Thanks Ttelmah.
I need something MCU controlled so complexity is ok with me.
Aah...nobody made similar yet... |
I think that what Ttelmah wants to know is WHY it has to be MCU controlled. What's the reason? Is this just some educational assignment that you've been given, or is it a real project: a paying commercial one? If its paying its just as Ttelmah says, a costly inefficient, difficult sledgehammer to crack a nut. If its an assignment, then we DON'T do other people's homework for them. A
In any case, mixing live mains with delicate PICs is not easy to say the least, there are all sorts of issues to deal with.
The basic technique is to arrange hardware, e.g. op amps, CCPs, timers etc. to trigger off zero crossings of the mains, then delay by some time related to the required dimming ratio, ideally taking account of luminousity to % duty ratio, but not for a quick and dirty dimmer, then trigger a triac, possibly via a pulse transformer, at the required moment, Repeating this cycle with as little firmware interference as possible every mains cycle.
I did something like this, it was for a multi-projector sound/light unit, using a 6809 many years ago. It worked, or at least the lighting control bit did. I used a hardware PLL to multiply the mains by 512 (256 for each half cycle giving me full 8 bit resolution) then had 8 bit counter/comparitors in TTL hardware, one for each channel (and I designed it for 32, but only got two working before I gave up).
So, what is it that you are really trying to do?
RF Developer |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Dec 19, 2011 12:21 pm |
|
|
leaveme wrote: | I just need a simple dimmer in PIC, i.e. a dimmer by which you can control a 100w 220v/50Hz AC lamp.
Duty cycle is about 25% to full and a POT can be used to control.
I have no idea for zero cross synchronization. Any reference or example will really help. | How much time did you put into searching for examples?
When I go to the Microchip website, Application Notes and then search for 'Lighting, ''Incandescent' only two application notes pop up, one of them for a 100-200W dimmer. Took less then one minute to find.
The code is in assembly but pseudo code is given that can easily be converted to C. The schematic is designed for 110V/60Hz and will have to be modified for 220V/50Hz, especially because they get the 5V straight from the mains without using a transformer. But as you said in another thread you have 'a sound knowledge in electronics' this shouldn't be a big problem. Before you kill yourself, here is a link to a document describing the details of a transformerless power supply: http://ww1.microchip.com/downloads/en/appnotes/00954A.pdf
Many other (and safer) designs can easily be found on the internet. It feels a lot like you asking us to do your homework with you putting hardly any effort into it yourself. |
|
|
|