Okapi and Parilux circuits explained


This is a rather complicated power supply. For me. It's a dual power supply, using only one power input. On the left, at X2 terminals, the power comes in.

B1 is a rectifier bridge. For a DC input this would not be necessary. Still, if it is used, the user will not be able anymore to reverse connect the battery. So for reasons of reliability it's always advisable to make an AC input. AC inputs can be used by DC power sources as well. There is a catch but we'll come to that later.

The rectified AC signal is not DC yet. Therefore it needs to be smoothened out. We do that with C1 and C2. C1 will filter out (smoothen out) higher frequency signals. C2 is for the low frequency signals, like the power line (100 or 120 Hz). After C2, the voltage has changed.
If an AC voltage is 10 Volts, we really should say: It's 10 Volts AC, RMS. RMS is short for 'averaged out over time'. The peak value of the 10 Volts AC signal is in fact 14,142 Volts (multiply by SQRT (2)). Our rectified signal will be close to this 14 Volts.
BUT, there's one more catch: before we enter the filter capacitor section, the AC signal has to pass a diode and before entering the mains outlet again, it needs to go through a second diode of the B1 bridge cell. So that's two diodes to pass. Each diode eats away 0.7 Volts. So the filtered rectified AC signal will have a magnitude of:

      V = Vac x 1,4 - 2 x 0.7 = 1.4 x Vac - 1.5
   
I know, two times 0.7 isn't 1.5 but the 1.5 is easier to calculate and it is closer to reality. Doing so, we would get the following DC values for rectified AC voltages:

AC value DC value   AC value DC value
5.0 5.5 10 12.5
7.5 9 12 15.5
9 11 24 32

The catch I mentioned earlier was: you will need to supply a higher value DC source than the RMS AC source. So if you connect 9 Volts of AC (RMS) to the X2 terminals, that would be comparable to 12 Volts of DC. Two diode drops are valid for DC as well!

To obscure things a little bit more: if you measure the voltage of a secondary transformer winding, you will notice that it is higher than the rated voltage! This is because the transformer producer publishes a kind of worst case voltage for his product. It is the voltage produced by the transformer at nominal load. If the load is lighter than nominal, the output voltage rises, sometimes by 20% or more.

In my circuit, I call this voltage "+9 Volts" but that's just a place holder.

The raw recified and filtered signal is fed into a simple but reliable voltage regulator: a 7805. It will accept a voltage at it's input and eat away as many volts as required to produce a steady 5 Volts at it's output. The excess voltage is turned into heat. So if you supply the 7805 with 40 Volts DC, it will have to eat away 35 Volts. At 0.5 Ampere this results in 35 x 0.5 = 18 Watts of energy to consume.

Input Output Efficiency Heat loss
40 V 5 V 12.5 % 87.5 %

This is not very efficient. Still, the 7805 is reliable, cheap and easy to use. It needs at least 3 Volts headroom, so the trick is to design an input section that delivers as close to 8 Volts as possible. You do the math!

In this case the 5 Volts is fed into a so called DC-DC power supply. It is a black box, that uses magic to convert the 5 Volts input to 9 Volts output, which is in no way referred to the input signals. We need this for the computer interface to operate. If something happens on the human signal side, it may not reach the computer interface side, to protect the PC against fatal accidents.

The DC-DC converter produces a rather course signal, so a second 7805 is used to turn the 9 Volts of DC into a well defined 5 Volts. Not much to say here.

PC817 drives IRF540

This is the circuit I used as a replacement for a DC solid state relay. An opto coupler delivers 9 Volts (when off) or 0 Volts (when on).
This voltage is defined by the resistor R11. It is tied to +9 Volts, but this is a placeholder, a label. The actual value of the voltage at that point is more like 10 or 12 Volts DC.

If the opto coupler output is not conducting, the gate of the IRF 540 MOSFET is brought to 10+ Volts and it is conducting.
When the opto coupler is on, the output transistor makes a short circuit to ground and the gate voltage dives below the required source voltage. The IRF stops conducting. Switch closed.

In this example I use an N channel HEXFET to open it, I need to supply several more volts than the 5 Volts I want at it's output. If I would have used a P channel FET I would have had to supply ZERO volts at the gate, with the chance that this would not be low enough.
And the P channel types have higher internal resistance... And some more. So I chose for the N channel FET as a high side switch.

LED drive resistance

To the right, we see a simple circuit consisting of a LED and a resistor. The target is now to calculate the value of the resistor R7 for a given voltage across LED1 and R7.

This is very easy. The LED will eat away a voltage between 1.5 and 2 Volts. For reasons of simplicity, we will assume 2 Volts.

A LED will have an infinite life time when you make sure the current stays within limits. A safe value for the majority of LED's is 20 mA. But most LED's will produce a nice light level at 10 mA as well.

We determine the value of R7 using Ohm's law:

     Uc = Voltage across circuit
     Ic = Current through circuit
     Uf = Voltage across the LED (forward voltage drop)
     Ur = Voltage across R7
     
     R7 = (Uc - Uf) : Ic
   
Now, that wasn't too difficult! Below are some values of R7 for some values of Uc:

Uc [V] Ic [mA] Uf [V] Ur [V] R7 [Ohm] Rounded to
5 10 2 3 300 330 or 270
5 20 1.5 3.5 200 220 or 180
10 10 2.2 7.8 780 820 or 680
12 7 1.8 10.2 1460 1500

You need to have a datasheet of the LED to know it's actual "forward voltage drop" (the value of Uf). As a rule of thumb you can use 2 Volts. For higher values of Uc, the value of Uf becomes less critical. Below Uc = 6 Volts, it is convenient to know the actual value of Uf.

HCT243 drives PC817 opto couplers

In this case, consider the HCT243 (on the left) as a magic power source. It may produce a '+5 Volts' signal or it may produce a 'GROUND' signal. Let's now follow the output 'B2'. If B2 is at GROUND level, nothing happens since there is no voltage across the opto coupler OK2 and resistor R2.
But now, due to divine intervention, the output of B2 turns '+5 Volts'. Now we do have a voltage across OK2 and R2. So a current will flow. In the above section you have learned how to calculate the value of R2. In this case:

     Uc = 5 V
     Uf = 1.4 V
     Ic = 10 mA = 0.01 A
   
Based on this we get a value of 360 Ohms. More current is better for the opto coupler so we will not go for the value of 390 Ohms but we will use 330 Ohms. Voila.

Pull down circuit

The circuit on the right is a pull down circuit. It is used to force a certain starting condition on the lines, when there is no external drive present yet.
The signal lines are driven somewhere on the right of the picture. But the driving force is not present yet. In most cases due to an unconnected connector or a PC that is powered down. Still, the interface card can be powered and the circuit under control may be powered as well.
In this case, you don't want the control circuit to pick up random noise. So you use pull up or pull downb circuits to force an undriven interface to a certain state.

In this case, I force the signals 1, 2, 3 and 4 to a logic GROUND level. Each signal is connected to ground via a seperate resistor of 100 k. That's enough to drive the signal lines to a logic low level. But even the weakest input signal will have no problem overriding this state.


Signal conditioner

This is a typical input section combining some parts we saw earlier on. On the left is a 25 pin SUB D connector. In this case a male connector, meant to interface with a parallel printer port.

On the right is a 74HCT243 buffer gate. It will accept 4 weak and possibly noisy logic signals on it's "A terminals" and convert it into 4 stable and powerful signal on it's "B terminals".

Between the connector and the buffer is the pulldown resistor block we saw earlier. If there is no connector mounted, the signal lines are 'open' and may assume any value between '0' and '1'. So we use a set of resistors to force the signal lines to one specific level or state. In this case, the signal lines are pulled low, to a GROUND level.

This circuit compensates for the cable length between PC and interface. It's always a good idea to buffer your incoming signals if there is ANY length of cable or wire between two circuits. Consult the data sheets for finding the best possible IC for the job.


The LM317 as a power supply

One more power supply. This time an adjustable one.

And then the LM317 comes into play. The 317 is like the 7805: old, versatile and reliable. It will do the trick, each and every time you want it.

The concept of the LM317 is easy: it will vary it's output until the 'ADJ' terminal is 1.25 Volts lower than that output. If you connect the ADJ terminal to ground, the output will always be 1.25 Volts. In a formula, the LM 317 output is:

     Uout = Output voltage
     Rtop = upper resistor value in potentiometer
     Rbot = lower resistor value in potentiometer
     R    = Rtop + Rbot = value of potentiometer
     
     Uout = (1.25 : Rtop) x (Rtop + Rbot)
   
The voltage drop over Rtop will always be 1.25 Volts. So the current through Rtop will be 1.25 / Rtop Ampere. This same current will also flow through Rbot. So the voltage drop over R is R x 1.25 / Rtop. If you move the potentiometer tap 'up', the voltage goes up as well.

After the LM317 you find two small capacitors plus a so called TransZorb (ICTE 5). A TransZorb is a very fast and powerful diode that reacts on overvoltage. If the reverse voltage is too high (in this case: higher than 6 Volts) the TransZorb turns into a short circuit within nanoseconds, thereby protecting the rest of the circuitry.
In normal conditions, the TransZorb is just there without any effects. When kicked in, it can absorb thousands of amperes for a short time. In that time, the fuse of the supply circuit will break, thereby taking away the source of overvoltage.

Home made SSR using PC817 and IRF540

To the right you see the latest design change to Okapi 3. It is a home made solid state relay for DC loads. Operation is rather simple, but handy.

In normal conditions, the base of the driver transistor would need to be around 10 Volts to pump out 9 Volts on its emitter. Not handy.
But the opto coupler just supplies drive capabillity. If there is light, the transistor goes into conduction, no matter the voltages on emitter or collector. So in this case, the opto coupler is not just an isolator. It is also a level shifter.

I tried the circuit. It works as expected. The collector/emitter drop is around 0.25 Volts when the driver LED is on. The MOSFET is conducting like crazy. This is a good and cheap alternative to a much more expensive DC SSR. The LED on the right is just a load for the IRF 540 power MOSFET. You may use just about any other MOSFET here instead of the IRF 540. But due to its low price I use this MOSFET for nearly everything.

Page created 4 January 2008,

Page equipped with FroogleBuster technology