News:

Let's find out together what makes a PIC Tick!

Main Menu

Additional PIC support

Started by John Lawton, Feb 04, 2025, 02:53 PM

Previous topic - Next topic

John Lawton

Hi Les,

I'm designing a dimmer interface to measure the phase angle of an input waveform and output that data serially to a light fitting.

So my feature shopping list is:

1 x Zero crossing detector
1 x Comparator
1 x UART
8 pins

I've come up with the 16F18013 / 14 / 15 or 16F15313
Possibly the 12F1612 (but has no UART)

Only the last one is currently supported. Is there a chance of some of the others being added please? I'm happy to have a paid upgrade, it's been a while since the last one....

John



John Lawton

Thanks for that. However I'm wanting to reverse-engineer a dimmer output signal.

This means simulating a dimmer load (normally it is a lamp) and measuring the dimmer phase angle/period and outputting the measurement to an existing LED light fitting that has uP brightness control and a RS232 input.

This way varying a dimmer will control an existing 12V DC operated multi-LED light fitting.

I'm looking for a supported PIC with all the built-in hardware I need, but there isn't one at the moment.

John

top204

#3
I'll check them out over the weekend John.

I'm off to the Newark antiques fayre on Friday, and can't wait to see what there is there. It is mostly expensive crap from profiteering sellers, but sometimes, they sell something interesting that they do not understand, so it is less expensive. However, that is getting rarer now with the internet and Ebay, because they can do a search for items. Then think of a price and treble it for the, plentiful, stupid punters. :-(

John Lawton

Many thanks Les.

Good luck at the Newark Fayre.

John

Fanie

Quote1 x Zero crossing detector

QuoteThis way varying a dimmer will control an existing 12V DC operated multi-LED light  fitting

I'm curious why you need a zero cross when controlling 12V DC, and does not work well on transformers - assuming this is what you have in mind.
Even when you count and skip cycles to dim the transformer output it does not seem to do well.
It will be far easier to control LED lighting directly from the 12V, simple PWM.

The kids will use wifi modules to do the same.

flosigud

The PWM needs to be filtered and the current controlled, not voltage. Controlling the voltage only can end in disaster.

John Lawton

#7
Quote from: Fanie on Feb 10, 2025, 10:37 PMI'm curious why you need a zero cross when controlling 12V DC, and does not work well on transformers - assuming this is what you have in mind.

These light fittings were a big project for me, over 10 years ago now. They are high power multi-LED fittings, powered from 24V DC. Each RGBW LED is individually controlled by PWM driver boards. Each Driver board drives 8 LEDs, a Motherboard holds up to 20 Driver boards, the Driver boards are controlled by a motherboard Master PIC using twin SPI buses.

The total DC power is up to 500W. The Master PIC is controlled by 4 external control lines and an RS232 interface (for KNX control). An Ethernet port allowed for firmware updates and configuration.

A couple of these fittings are being re-purposed as dimmable white-only fittings and I need to repurpose the RS232 port to do this, by sending it control data from my dimmer interface unit, where the dimmer angle is converted into brightness level commands.

Anyway I've now prototyped the dimmer interface circuitry, I just need to write the PIC firmware for it.

Here is one of the 500W LED controllers being bench tested:




flosigud

Dimming a LED has nothing to to do with phase angle. The current has to be controlled. To get white light it is better to use white LEDs rather than RGB because that way you get more light. In the ten years since you designed these lights, LEDs have evolved and are now brighter than ever.It would be easier and faster for you to design brighter light with modern technology. Like COB LEDS. If you run LEDS at 1/3 power you will get 50% more light and less heat.

flosigud

The disaster I mentioned in message No 6 is Thermal runaway https://en.wikipedia.org/wiki/Thermal_runaway

John Lawton

The LEDs used are RGBW about 3W power. The light fittings all exist so won't be redesigned, we are just re-purposing a couple of the fittings using RS232 control. The LEDs are all fed by constant current drivers and use pwm switching to control brightness. They've been working fine for 10 years....

So, again, I'm not using phase control. I'm making an interface that measures a dimmer output and converts that into a brightness level that is then sent to the light fitting using RS232. It's what the customer wants so I'm not arguing.

John

m.kaviani

hi John
here is zero crossing detector circuit.

Quote from: John Lawton on Feb 04, 2025, 02:53 PMHi Les,

I'm designing a dimmer interface to measure the phase angle of an input waveform and output that data serially to a light fitting.

So my feature shopping list is:

1 x Zero crossing detector
1 x Comparator
1 x UART
8 pins

I've come up with the 16F18013 / 14 / 15 or 16F15313
Possibly the 12F1612 (but has no UART)

Only the last one is currently supported. Is there a chance of some of the others being added please? I'm happy to have a paid upgrade, it's been a while since the last one....

John



John Lawton

Thanks.

After dimmer bench tests, I found that I needed to use a LED type dimmer (not a triac type) because of the low load I'm placing on it.

I also realised that I didn't actually need a zero-crossing detector, I could  just feed the full wave rectified dimmer waveform, (after clamping it to ~15V max), into an opto-isolator and I then get an output pulse with a width equal to the dimmer ON time.

I just need to measure this pulse width using a PIC to get my brightness control value which I can then output over the serial port.

John



JonW

Nice solution John. Youll have to post a schematic for that

John Lawton

Hi Jon,

yes I probably could do that as I won't be making more that a handful of these and the job is a retrofit to a bespoke lighting system.

John