View Full Version : Introduction: 8 channel DMX SSR
NogginBoink
04-13-2008, 12:38 PM
Given the development work that's been going into DMX recently I decided to create an intelligent DMX SSR ('intelligent' in this sense meaning the controller and SSR's are on the same board).
After abandoning my transformerless power supply idea (which I'd ulitmately like to come back to), I came up with the attached schematic.
There's absolutely, positively nothing that's unique or interesting about this circuit. It's stuff we've all seen before. The only minor quirk is that since all available pins on the microcontroller are used, I plan to write special firmware to set the device's DMX start address: you'd install the PROGRAM jumper, and send a special DMX512 data stream, to set the device's DMX address. The PIC would store that address in its EEPROM.
Any comments? Is this design worth pursuing, or are there other designsd out there superior to this one?
If there's interest, I'll move on to parts selection and prototyping.
P. Short
04-13-2008, 12:59 PM
It looks generally fine, as expected. However, there are a few minor issues that I've spotted.
First, the H11AA1 isn't wired up right. The collector of the H11AA1 should go to one end of the resistor and the PIC pin, the other end of the resistor should go to VCC (+5V).
Second, pin 6 of the PIC isn't usable as a general purpose I/O pin when the UART is enabled. There might be some way to finesse it, but that's probably not worth the trouble. I would just change the PIC to a PIC16F627A (or perhaps a PIC16F628A). This is a 18-pin part that was the same price as the PIC16F688 the last time that I looked, and it has four more I/O pins. Another possibility is to use a clock-oscillator instead of a crystal for program timing. This is a little more expensive, but frees up a pin on the PIC16F688 for the last output.
Third, I usually like to have a 'fail-safe' circuit on the input to the 75176 chip, to ensure that it's output goes to a known value if the input cable is disconnected or shorted out (rather than waving in the breeze, possible sending bad data to the PIC).
Fourth, I'd take a look at the power requirements, particularly if you are driving the optos with a PWM waveform (rather than just a pulse). You may be OK, I'm just saying this as a reminder.
Fifth, you are going to need a much bigger cap on the input to the regulator. That 0.33 uF cap just isn't going to hack it. I can't say what the value will need to be, because I don't know what current you are planning for, but it may end up at 100 uF or above.
--
Phil
NogginBoink
04-13-2008, 03:10 PM
Thanks for the comments, Phil!
Yep, that was a boneheaded mistake on the H11AA1. (I probably would have caught this before getting PCBs made, but thanks for pointing it out. Really, I do know what a pullup resistor is!)
Gosh dangit, I was sure the Tx and Rx could be enabled independently, but the SPEN bit does indeed control the functions of both. Thanks for pointing that out. I would have missed that one. And I was so proud of using every last pin on the chip, too! Going to the 627/628 makes sense. I suppose I could make an 11-channel SSR board. :) It would be odd, but it would work! Does anyone have any ideas on what I can do with those three additional I/O pins? :)
Just to play devil's advocate, what's the harm in letting the bus float in this application? Bad data to the PIC is almost certainly not going to be recognized as DMX512 formatted data, so I would imagine that in virtually all cases, the result is that the SSRs will simply stay in their last state. I can take care of this in software by shutting off all the outputs if no data is received in x units of time. I don't think that a floating bus would cause undue current consumption from the 75176, would it?
My power requirements are: 5mA * 8 optos = 40mA + 50mA for the 75176 = 90mA. The transformer is rated 9VAC at 100mA, and the voltage regulator is also 100mA. The PIC draws microamps according to the docs so I didn't bother adding it in there. Did I miss something in my power budget?
I could get the power budget down by pulsing the outputs only long enough to ensure the TRIAC is on but I don't see the need to do that in this case. I'll probably just leave them on the entire half-cycle (unless I leverage someone else's code that does otherwise).
Oh yeah; I also need to change resistor values on the inputs to the optos. I originally was planning to run the PIC at 3.3V, but since the 75176 is a 5-V only part (and equivalent 3.3V parts are pricey), I changed to 5V.
You educated me about capacitors on the inputs to voltage regulators last year. :) I hadn't done the calculations yet. I should have left that value blank.
Still, my big question remains: would there be enough interest in this to pursue it further?
NogginBoink
04-13-2008, 03:16 PM
You know, now I'm not so sure about the Tx pin.
Section 10.1.1.1 of the datasheet says:
Setting the TXEN bit of the TXSTA register enables the
transmitter circuitry of the EUSART. Clearing the SYNC
bit of the TXSTA register configures the EUSART for
asynchronous operation. Setting the SPEN bit of the
RCSTA register enables the EUSART and automatically
configures the TX/CK I/O pin as an output. If the TX/CK
pin is shared with an analog peripheral the analog I/O
function must be disabled by clearing the corresponding
ANSEL bit.
If I enable SPEN but not TXEN, it appears that this pin could be used as a digital output.
But rather than debate this here, a trip to the breadboard could answer this. I think I have one of these chips in my parts bin. I'll report back when I've had a chance to test this.
P. Short
04-13-2008, 03:52 PM
With the larger part you could add a few diagnostic LEDs (heartbeat, etc), and an input for a switch for programming the address. Or easily add a facility for reading a DIP switch to set the address, if that's your fancy.
--
Phil
DynamoBen
04-13-2008, 03:53 PM
The rule of thumb is if you are using the USART you can't use either of the pins as a general purpose digital I/O. (tried it before)
scorpia
04-13-2008, 05:29 PM
and to answer your question. Yes i would like to see a design like this made.
It would make a nice beginners board with everything being all in one. all the current beginner boards need other boards to help them work. (if the dmx is an issue then have a serial version of the firmware)
and yes the bigger pic would be a nice idea. extra i.o or diag/config switches wouldnt go asrtray. why stop at the 627/628. there are lots of nice 28pin devices out there :)
Peter
mrpackethead
04-13-2008, 06:25 PM
With regards to the H11AA1.. Since you already have a transformer, why don't you just pick up your zero cross on the low voltage side of that?
NogginBoink
04-13-2008, 07:29 PM
With regards to the H11AA1.. Since you already have a transformer, why don't you just pick up your zero cross on the low voltage side of that?
See this thread. (http://www.doityourselfchristmas.com/forums/showthread.php?t=2992)
mrpackethead
04-13-2008, 09:38 PM
You've spawned a completely new different idea in my head, which may be of some interest to the Aussie/NZ crowd particaually.. All our lights are low voltage. ( legal requirement ).. Perhaps we should do a low voltage version?? Scopia: this would be a great project for you! Sorry to hijack the thread.. i'll start a different converstation over here ---->
http://www.doityourselfchristmas.com/forums/showthread.php?p=27285#post27285
NogginBoink
04-13-2008, 10:45 PM
Well, y'all are of course right... enabling the UART means RC4 can't be used as a digital output. (But you knew that.)
The good news is that I was able to brush up on my PIC programming skills (it's been a while since I've actually gotten code to actual hardware), I found that the ICD2 clone I bought off Ebay last year works, and the MAX232 box I built 'just in case' works.
I'll redesign it with a 627 or 628 chip. That can probably be done in an hour or so.
Now I really need to get a DMX dongle! Are any of those projects on track to get out the door soon?
Well, y'all are of course right... enabling the UART means RC4 can't be used as a digital output. (But you knew that.)
The good news is that I was able to brush up on my PIC programming skills (it's been a while since I've actually gotten code to actual hardware), I found that the ICD2 clone I bought off Ebay last year works, and the MAX232 box I built 'just in case' works.
I'll redesign it with a 627 or 628 chip. That can probably be done in an hour or so.
Now I really need to get a DMX dongle! Are any of those projects on track to get out the door soon?
16F88 has the same number of pins, plus an internal 8 Mhz clock and double the code space...
NogginBoink
04-14-2008, 10:13 AM
Thanks, JEC.
While the internal clock is a nice feature, I have concerns about how accurate it is. The folks on the piclist have cautioned me pretty sternly to take Microchip's claims of clock accuracy with a grain of salt. Given the temperature ranges that these devices are going to be in, I'm thinking of listening to them. I think that a resonator is probably worth the extra 50 cents in this case.
I haven't written the code yet, but I can't imagine I'll exhaust the code space on the 627.
The 688 is about $2 more than the 627A. I don't see enough benefit to justify the higher cost.
(On the other hand, I DO appreciate you pointing this out to me. Microchip's product line is so jumbled that it's easy to miss the existence of the perfect part sometimes.)
DynamoBen
04-14-2008, 10:18 AM
I've started a number of projects with a 688 and end up finishing on a 16F876A. It has more I/O, more flash, and is reasonably priced. Again food for thought.
NogginBoink
04-16-2008, 03:48 PM
OK Phil, let's test my math skills. I need to size C1 properly for my circuit. You mentioned that earlier in this thread and we discussed this topic last year on a different circuit I was designing.
The first thing I did was dig up last year's thread here (http://www.doityourselfchristmas.com/forums/showthread.php?t=1208&highlight=oscillator) and get the formula you taught me.
So the DMX8 design in this thread has 8 optoisolators drawing 5mA each, a RS422 driver that consumes 50mA, and a PIC chip that consumes almost nothing.
So let's say my required current is 100mA.
The transformer in the design that I chose is a 9V, 111mA transformer. The peak output is 9 * sqrt(2) = 12.72 volts. Call it 12 volts.
The rectifier I chose has a 1.1V forward drop. So let's say the input to the voltage regulator is 11 volts. (12.7 volts - 1.1 volts, more or less.)
The 5V regulator has a 1.7V dropout, so the minimum required input is 5 + 1.7 = 6.7 volts.
So, delta V is 11 volts (the max I supply to the vreg) - 6.7 volts (the minimum I can supply to the vreg before it stops working) = 4.3 volts of droop that the design can tolerate.
At 60Hz, each half-cycle is .00833 seconds, which is delta t.
Delta V/Delta T now = 4.3/.00833 = 516.
I = C dV/dT
0.1 = 516 C
.000193798 = C
So a 200 uF capacitor should be appropriate for C1.
Did I get it right?
P. Short
04-16-2008, 04:30 PM
That looks right. I'd make sure that the board can take a 330 uF part to allow use in 50 Hz locales. This would also provide margin for component tolerance, for decreased capacitance at lower temperature, and margin for low power line voltage.
There are trade-offs that you can make here. There are LDO regulators (such as the LP2950 that can operate with a lower input voltage (and hence a smaller cap). There are also RS485 receiver chips that have a much lower quiescent current. These higher performance parts all cost more, but might be something to consider at some time. They don't really affect the board layout, though.
--
Phil
aussiephil
04-18-2008, 12:35 AM
NB
One thing you have missed is that the no load voltage of a small transformer like that will be somewhere like 33% higher.
a 9v 111ma from mouser has a spec of 12.45v unloaded and may actually fall under 9v as it approaches it's rated current draw.
12.45v will become 15.27 - 1.4 for the bridge = 13.87 input to the Reg.
Not sure if this changes the delta calc for the caps without running the figures but it does change the potential voltage rating of the cap.
The larger cap as PhilS suggests would also assist with any tranformer voltage droop with load.
Better yet if you have a 100mA expected draw then use something with a bit more headroom.
AussiePhil
darko
09-10-2008, 09:30 PM
Would anyone be open to sending the ZC signal and power over the cat5 ala the renard designs?
Aside from onboard power, this design seems ideal for me. Ive got a low budget, so Im all for parts minimization. 8 local channels on a controller seems to be a sweet spot for me, although others have expressed on this forum that controllers with more central channels are better.
Perhaps we can share firmware either way?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.