How to Control Christmas Lights - How to do almost anything with Christmas Displays.
  August 20, 2008 - Wednesday |Id: Visitor|Login|Prefs|Register| 125 more shopping days until Christmas  
Home
About
Story
Forum
Forum Pro
How To
Photos
Videos
Classifieds
Community
Score Board

High Scorer
Art Colin




HowTo: Build a 16 Ch PicDimmed Renard with SSRs onboard!  (Dave Johnson)


    << Previous Page       Page 1    Page 2    Page 3    Page 4    Page 5   Page 6       Next Page >>

Step 21 : RS485 Input Circuitry


In my opinion this is one of the hardest circuits to understand in the entire controller. I hope to alleviate some of this confusion.

R1 = 120
R2, R3 = 1K
R4, R5 = 27K
D1 = 1N5229
D2 = 1N5239
U1 = The chip is any RS485 chip.


The front-end circuit was inspired by the TI document SLLA036B, entitled "Interface Circuits for TIA/EIA-485 (RS-485)".
http://focus.ti.com/lit/an/slla036b/slla036b.pdf

In order to make the board input universal, discrete components are being used to allow the RS485 receiver to directly receive RS232. RS232 uses alternating plus and minus voltages to signal mark and space. So depending on the computer serial port you could have anything from +/-3 volts to +/-15 volts on the wire. The RS485 uses differential "0" and 5 volts to signal mark and space. so directly connecting the RS232 transmitter to an RS485 receiver is deadly to the receiver. It will choke or croak on the -5 - 15 volts.

The main purpose of the resistors (two 1K and two 27K) is to ensure that the output of the RS495 chip goes to a known and reliable state when the input cable is either open or shorted. The A pin is pulled-up, and the B pin is pulled down. While the two 1K resistors limit current in the event of a direct short.

The purpose of the Zener diodes is to prevent the input of the 75176 from going outside of the allowed range when the circuit is driven with an RS232 signal.

The 120 Ohm resistor is for matching impedance as 120 Ohms is the typical impedance of twisted pair. The 120 Ohm resistor is placed between pins 4 and 5 of the input RJ45 connector.

If you are using RS485 for PC to controller then the only thing you need is the 120 ohm resister between the A/B leads on the 485. If you are using RS232 then the best choice is to put an RS232 chip at the input. MAX232 or any of the many others. But in “Phil’s design” (The universal design) he does a couple of things to make both possible. The 27K resistor to connecting the "A" to VCC and the "B" to ground are what they consider "weak Pull-ups". They are there to ensure the input is in a known state if the computer is disconnected. That is their only function.

The 1K resistors are there to limit the current drawn from an RS232 transmitter if it is connected. (They also limit current if an RS485 transmitter is connected but don't hurt the situation).

If an RS232 transmitter is used the "TXD" lead is connected to the RS485 "B" lead. The "A" lead is pulled to VCC(+5V). The output of the receiver switches when the "B" input goes above and below 5 volts.

The Zener diodes from the "B" lead to ground are there to limit how far negative the "B" lead is pulled when an RS232 transmitter is connected.

The data sheet on the 485 lists "Receiver Input Voltage ... -8V to +12.5V" These are the "Absolute Maximum" values. In reality don't go there.

A Zener diode voltage drop is around .7V forward and 5V reverse (assuming a 5V Zener). so putting the diodes back to back is a way to limit the voltage in both polarities.

The 1N5239 is a 9.1V Zener and the 1N5229 is a 4.3V Zener so the net effect is to limit the "B" pin to a maximum of +9.1volts and -4.3volts. 1N5229 (4.3 V Zener, limits 485 input to -5.0 V), 1N5239 (9.1V Zener, limits 495 input to +9.8V)

The 1K resister in series between connector and the "B" pin limits the Zener current just like in any Zener regulator circuit.

In summary:

Don’t mix up pins 4 and 5 on the RS485. Look at the picture above closely, and play by the rules.


Step 22 : RS232 VS. RS485


Above are two pictures of an identical 8 channel Renard output from Vixen. The left image is the RS232 protocol, the right is after it has been sent through a RS485 converter.

We will start with a short discussion on RS232. In RS232, there is ground, and TXD (Transmit data, the dark blue line in the picture). TXD goes from ground to VCC. Ground is ground, and is therefore intuitive and pretty simple. In the picture above you can see the divisions are 200mV so in this case TXD goes from 0 to 1.5 Volts.


In RS485, the A signal (dark blue) goes from 0VDC to +.5VDC, while the B signal (light blue) goes from 5VDC to 0VDC. The resting or “no data” state of RS485 is A = .5VDC and B = 0VDC. The active state or “data being sent” state of RS485 is when A= 0VDC and B = 5VDC. Thus you can see, the signals are differential, one goes high, and the other low, for the transfer of one bit of data.

Step 23 : Triac

(http://forums.parallax.com/forums/default.aspx?f=21&m=61194)

The triac is the device that will switch the AC. The terminals on a triac are labeled Main Terminal 1 (MT1), Main Terminal 2 (MT2) and the Gate (G). From a black box perspective, the triac has four important functional characteristics (assuming the device is operating within its maximum ratings):

1. The triac will conduct in either direction of current flow. This means that current can flow from MT1 to MT2 or from MT2 to MT1.

2. The triac will only begin conducting when triggered by a current applied to the Gate.

3. The triac automatically ceases conducting when (only if) the voltage across and current through MT1 and MT2 goes to zero, after which the triac must be re-triggered to begin conducting again.

4. Once triggered, the triac will continue conducting until the next zero voltage crossing point in the AC sine wave regardless of the voltage/current applied to the gate. So, once triggered, the Gate input is in a “don’t care” state until after the next zero crossing point.

To summarize, the triac will only begin conducting when triggered and will continue conducting regardless of the state of the gate until the next zero voltage crossing point. The triac can be triggered in either the positive or negative part of the AC sine wave.

A helpful article titled “Thyristors and triacs - Ten golden rules for success in your application” can be found here:

http://www.web-ee.com/primers/files/AN_Golden_rules.pdf&e=7620


Step 24 : Opto Isolator Triac Trigger


R1 = 780
U1 = PIC
U13 = MOC3023
The green trace is an example of a control signal from the PIC output PIN (which operates from 0 to 5VDC) that goes to the cathode of the OptoIsolator and causes it to lower or raise the impedance between the two “Main Terminal” pins, causing the AC current to flow or not (lights go on and off! Now we are getting somewhere!)


If you have done everything correctly, everything above the “5VDC” text will be low voltage, everything below the “120VAC” text will be high voltage.


(http://forums.parallax.com/forums/default.aspx?f=21&m=61194)

The triac trigger is a device that provides 5 V inputs to an internal LED (through a suitable current-limiting resistor) on one side and a 120 VAC optically triggered triac on the other side. This device electrically isolates the 120 VAC side of the circuit from the logic level side of the circuit. Using a triac to trigger the main triac solves the problem of triggering the main triac on the positive or negative voltage portion of the AC sine wave.


Step 25 : Zero Crossing detector (H11AA1)


R1 = 27K – quarter Watt
U1 = H11AA1
R2,R3 = 15K – halfWatt

There are several approaches to detecting when the AC voltage is zero. It could be done by bringing 110VAC onto the board (and using the H11AA1 circuit as shown above, and used in the 16ch PicDimmed Renard with SSR design), by using a dedicated pin on the cat5 (That is, having a H11AA1 or another device located near the computer, and sending the ZC signal down the Cat5), or by using a CAT5 pin for the power input and zero-crossing at the same time.

Renard doesn't have interrupt-on-change enabled, so there is no interrupt from the zero-crossing logic. Also, the input to the transistor circuit that has occasionally appeared in connection with Renard is a full-wave rectified AC signal, so the output of the transistor is very similar to the output of the H11AA1.

(http://forums.parallax.com/forums/default.aspx?f=21&m=61194)


This device provides notification of when the AC voltage is zero. It consists of two cross-coupled LEDs on the AC side and a phototransistor on the logic level side. Thus the one or the other LEDs is on during any non-zero portion of the AC sine wave. Both LEDs are off at the zero voltage point. By adding a pull-up resistor to the photo transistor output on the logic level side of the device, the zero crossing detector will pull the output low during the non-zero portion of the sine wave and the pull-up resistor will pull the line up to 5 V when the photo transistor turns off. The zero crossing detector will produce a positive going pulse every 8.333 milliseconds (1/120 = .0083333). This device also electrically isolates the 120 VAC side of the circuit from the logic level side of the circuit.



    << Previous Page       Page 1    Page 2    Page 3    Page 4    Page 5   Page 6       Next Page >>
 

 
Designed, Hosted, and Coded by Hill Robertson
Computer Christmas - Copyright © 2001 Hill Robertson