One channel toggle infrared switch board remote receiver

 

 IR REMOTE RECEIVER

 

 

PREFACE

        This infrared remote receiver circuit base on the design of DIY kit. I built this circuit but I didn't buy from them. It is a useful circuit anyway. I used it for switching my lighting room. Usually before go to sleep, I prefer reading while laying on the bed, and then after a few moment then I fell to sleep, or even not while still sleepy it is very hard to walk to the switch on the wall, to turn off the lamp. It is very often like that. So I made this circuit work for it, while I can switch the lamp without standing from the bed. Just use a remote control. The circuit response to any of remote control unit, like a TV remote, VCR remote, VCD remote, Compo remote, etc... etc..., but it's only response to a few buttons. It doesn't matter anyway, because we only use a single channel (our purpose is only to toggle state). I used a general remote control unit. This unit can be programmed to many electronic equipment products from many maker. But it is ok for any remote that can be found on your house. It is all work fine, I have already tested it !
 

SCHEMATIC DIAGRAM

        The circuit (33.150 Bytes) already changed a little from the original design to make it a stand alone unit. The works is still the same with the original design. I search for the IR detector module (the most difficult component to find) from the local market. Then I found 3 types of this with different package (9.667 Bytes). I used the second ones. It doesn't matter for the code because some IR detector works at 36 kHz while the other works for 37.9 kHz. I also not quiet understand about it anyway. For this circuit, the code not necessary at all, because we only want a pulse to toggle the flip-flop. So forget about it. Here is the data for TSOP17XX and TSOP18XX. It is ok for what type of you can find, it is work. Before using this type, I try to made it from a discrete component like photo transistor or photo diode with amplification circuit. But the response not very good. Its only react about 1.5 meters, and the beam must directly straight forward. So forget about it. If you can't find the IR-module, don't build this circuit. IR-module much more sensitive than that, it can still response about 10 meters and the beam not necessary directly straight forward. It also can receive bounce off signal.

        The response pulse is about the same as the charge time (R4xC2) = 12 msec. While the discharging time (R5xC2) = 0.5 sec. The charging cycle of the capacitor C2 provides the rising edge needed to clock the flip-flop. The discharging time of the capacitor C2 is much slower then the frequency of the received pulses. But on my prototype it is often the flip-flop react 2 times, on then off again, for some of remote control buttons. So it is better to bigger this discharging time to prevent that matter. Note that you can also add the count for the flip-flop input charging/discharging time (R6xC3) = 1.2 sec. to prevent that matter.

        One of the advantage of this circuit compare to the commercial one is a used for a relay. A commercial product usually used a triac for the output drive. So it is not possible to drive the neon lamp (TL) like philips SL or some kind of it. Because it will produce a flicker. But by using a relay for the output drive, we can put this type of lamp to work. Use a power relay type for safety reason.

        I change the power supply circuit using the common voltage regulator IC, because the original circuit not produce the stable voltage. Original circuit wired to become active low. The output IC1 pin 12 (-Q flip-flop) used to drive the transistor Q2. I change it to become active high, so every time the switch on, the relay also on too. You can choose it as you want.
 

PCB LAYOUT

        I already designed the layout (10.164 Bytes) to be used for a stand alone unit. The design not very small, but already tested and it works. I used a small transformer that I could find on the market. The circuit not drawn so much power, it is about less than 100mA for my prototype, depends on the relay type. Note that, because we want to use it for hi-power (220V-AC) use a good power relay. Also if the relay use a different voltage to drive it, you can reduce the transformer output voltage. Here for example I use a 220V-AC/5A output rating with coil voltage about 24V.
  

PARTS LISTS

        Component parts lists to build the complete set are :
   1. Resistors :
      R1, R2, R4, R6 = 27k ......................4 pcs
      R3 = 100k ................................. 1 pcs
      R5 = 1M ................................... 1 pcs
      R7 = 4k7 ...................................1 pcs
      R8 = 6k8 ...................................1 pcs
      R9 = 470 Ohm/2W ............................ 1 pcs
   2. Capacitors :
      C1, C3 = 47 uF/10V (elco) ................. 2 pcs
      C2 = 0.47 uF ...............................1 pcs
      C4 = 47 uF/25V (elco) ......................1 pcs
      C5 = 100 uF/35V (elco) .....................1 pcs
      C6 = 100 nF .............................. 1 pcs
   3. Semiconductors :
      D1 = 1N4148 (Silicon diode) ...................1 pcs
      D2 = 1N4007 (Silicon diode) ................... 1 pcs
      Led1 = Red Led (3 mm) .........................1 pcs
      BD1 = BY127 (Bridge diode) .....................1 pcs
      IR1 = TK-19 TSOP 1738 (Infra red module) ....... 1 pcs
      IC1 = 4013 (CMOS IC) ............................1 pcs
      IC2 = 78L05 or 7805 (voltage regulator) ...........1 pcs
      Q1 = BC558 (PNP transistor) ...................... 1 pcs
      Q2 = C1061 (NPN transistor) .......................1 pcs
   4. Others :
      RL1 = 24V relay PCB type (hi-power output, 5A/220V-AC) ............ 1 pcs
      CON1 = 4 pin screw terminals PCB type ............................. 1 pcs
      T1 = 220V to 24V, sec. 150mA/3W (Transformer) ..................... 1 pcs
      Optional push on switch for toggle operation ...................... 1 pcs
 

PROTOTYPE

        After everything has been tested, then it is the time to put it all to the right box. I used a self made acrylic box (13.986 Bytes). The dimension about 150mm(L) X 60mm(W) X 60 mm(T). So it is safety enough from a short circuited. To make the circulation inside, drilled the both side with 6mm holes formed a row-column. Note that I put the IR-Module outside the box, to make a good response, just glue it because the body also made from a kind of plastic. You can also see a small push on switch at the top of box. I added this part later because, sometimes the response was bouncing when the main switch was on, and to prevent when somethimes I lost my remote, or to fast moving when I wanted to switch it off. For the remote control  I use a universal type (36.753 Bytes) like this.

        Here is the circuit diagram of application this ir remote receiver to activated lamp (5.467 Bytes) at my room. The original wiring changed as necessary. You can also put the unit close to the lamp and take a new wire from the lamp to the output of the relay. It is all your choice. I prefer like this so I only wired 1 piece of cable. Besides that the unit can be reach easy if you put it at the main switch (8.631 Bytes). Now only one point must to remember that, becareful when doing this at home, switch wire contain a hot wire line at one side. Also careful when changing the fuse if it was blown, turn of the switch first for safety reason. Good luck!


WARNING!!! Be careful when you do some repairing or at the assembling. You must turn off the power before doing any change (turn the main breaker off). Otherwise a hazardous voltage will cause you injured.

EPROM application in User Define Function Signal Generator using DAC-0800/DAC-0808


 Function Signal Generator


Universal Digital Function Generator, based on DAC-0800 (DAC-0808) and EPROM-2732 for lookup table data to generate any function signals. 

Why it's universal?

Because you can add the patterns as you wish. 

I. PREFACE

 

        After already done with EPROM programmer, you really don't know where to go next, what to do next, etc...etc. Here is the example of EPROM implementation, Universal Digital Function Signal Generator. We can use it as a collection of our R&D laboratory instrument, beside that you can learn how to use a Digital to Analog Converter (DAC) type DAC-0800 or DAC-0808, an 8-bits resolution DAC. The circuit we want to build, I got it from "Electronic Project Magazine" made by "Shailesh M. Patkar & Prashant P. Kelkar" from India. Thanks to both of them, for their great idea.

        This signal generator, generate its signal wave form from look up table data. This data reside in EPROM type 2716 (2k X 8-bit) or 2732 (4k X 8-bit). Each signal used 1 block of data (about 256 byte of data each). So for 2716 type, it can be store up to 8 function signals, while for 2732 type, it can be store up to 16 function signals. This signal data still in digital type. Then we used DAC to convert this data to become analog signal. Because we can programmed what kind of signal we want to, it is why we named it as Universal Digital Function Signal Generator (UDFG).

II. SCHEMATIC

        The original version use 2716 EPROM type, while I prefer using 2732 type. The first one may be already hard to find, while the last one also can load more signals data (it can feed more signals 16 types), you can create more than 8 signal types.

To generate the address lines, the circuit use cascaded binary counters. By cascading this 2 binary counters up to 2 power by 8 (256) address line covered. This is all the data we need for 1 block or 1 function signal. The rest of address lines connect to binary selector switch. It is better if you could find a thumb wheel switch (digital switch). So it is easy to select the function type that you want. But thumb wheel switch only preserve for 10 function types. You need another one selector switch to select the upper and lower half of 8 signals. By store this data in EPROM, the circuit becomes less complicated and less expensive and gives high fidelity. The clock use a simple clock generator from IC 555 which configured as an astable multivibrator. The timing is adjusted by the equation : 

  T = 0.693 (R1 + VR1) C
 
By using the values give in the drawing, the frequency varied from 10Hz to 1kHz. Besides that we preserved also for external clock generator. Because the sampling frequency for DAC-0800 minimum as little as 100 nsec, we can do experiment about the speed of this function generator (in theory up to 10 MHz, this is the limitation of TTL IC clock). Digital output of EPROM 2732 tired to DAC-0800 and convert it to be an analog signal gradation from -10V to +10V, because the reference voltage is tired to +10V. Data for each point of signal rose by 2 IC counters (74163 & 74193) wired cascaded, 4-bit each to become 8-bit counter. These 8-bit counters produces the output data from 00h to FFh totaling 256 states. These 8-bit output counters then wired to the low address of EPROM, while the rest high address connect to digital switch and selector switch to select each signal generator types.

        As told before, each signal divided by 256 data point. So for a complete 1 cycle (360 degree) signal, each data point must rounded to the nearer number. This data for each signal then combine to make it a data look up table and programmed to the EPROM. We don't cover the programming section for this EPROM. For detail explanation about programming the EPROM go to another pages. These Data look up table will be explained later.

        None further explanation needed for the power supplies, because it all using a simple IC regulator. The +10V supply inherited from +15V supply because we don't need this to much power (Iref is about 1.7 mA only) and used to give the reference voltage to DAC-0800, so the output will vary from 0 to +10V by 256 gradation and then feed to op-amp comparator to make the output voltage vary from 0 to +/-15V. That is the output range. You can decrease the output voltage by adding divider resistors. 


III. LAYOUT

        Original circuit completed with PCB layout. But to accommodate the modification, I  already drawn another layout to make it comfort and fit the modification option. So it can fit at a box about (100 x 100 x 30) mm. Only single side needed, the rest will connect through cable and jumper. Note that except the 10 jumpers from the picture, there are 4 connections by cable for power supply. Also not included IC10 and the pull up resistors, because when I designed this layout, the switch never thought about. I put it later. 


IV. PART LISTS

        Component parts lists to build the complete set are : 

   1. Resistors :
 
      R1 = 330k ......................................................... 1 pcs
      R2 = 680k ......................................................... 1 pcs
      R3, R4 = 45k6 ..................................................... 2 pcs
      R5 = 1k. .......................................................... 1 pcs
      R6 = 470 Ohm ...................................................... 1 pcs
      R7 = 47 Ohm / 20W ................................................. 1 pcs
      R8 ~ R11 = 4k7 .................................................... 4 pcs
 
   2. Capacitors :
 
      C1 ~ C4 = 100 nF .................................................. 4 pcs
      C5, C6, C8 = 10 nF ................................................ 3 pcs
      C7 = 10 uF/16V (elco) ............................................. 1 pcs
      C9, C10 = 2200 uF/35V (elco) ...................................... 2 pcs
      C11 ~ C14 = 1000 uF/25V (elco) .................................... 4 pcs
 
   3. Semiconductors :
 
      D1 ~ D4 = 1N4007 (Silicon diode) .................................. 4 pcs
      DZ1 = 10V / 0.25W ................................................. 1 pcs
      Led1 = Red Led (3 mm) ............................................. 1 pcs
      IC1 = 2732 (4kByte EPROM) ......................................... 1 pcs
      IC2 = 74HC193 (Synchronous 4-bit binary counter) .................. 1 pcs
      IC3 = 74HC163 (Synchronous 4-bit binary up/down counter) .......... 1 pcs
      IC4 = DAC0800 or DAC0808 (Digital to analog converter 8-bit) ...... 1 pcs
      IC5 = 555 (Timer) ................................................. 1 pcs
      IC6 = LM324 (Low power Quad Op-Amp) ............................... 1 pcs
      IC7 = 7805 (Voltage regulator) .................................... 1 pcs
      IC8 = 7815 (Voltage regulator) .................................... 1 pcs
      IC9 = 7915 (Voltage regulator) .................................... 1 pcs
      IC10 = 74HC04 (Hex inverter) ...................................... 1 pcs
 
   4. Others :
 
      VR1 = 100k (trimpot) .............................................. 1 pcs
      VR2 = 10k (trimpot) ............................................... 1 pcs
      VR3 = 1k (trimpot) ................................................ 1 pcs
      CON1 = 2-pin terminals PCB type ................................... 1 pcs
      CON2 = 6-pin terminals PCB type ................................... 1 pcs
      CON3 = 3-pin terminals PCB type ................................... 1 pcs
      S1, S2 = Switch spdt .............................................. 2 pcs
      S3 = Thumbwheel switch (BCD switch) ............................... 1 pcs
      T1 = 220V to 30V, sec. 500mA (Transformer) ........................ 1 pcs
      Box = about 12 x 12 x 4 cm ........................................ 1 pcs
      Single side PCB = 10 x 10 cm ...................................... 1 pcs
 

V. DATA LOOK UP TABLE

        To display a signal on an oscilloscope using microprocessor is a very difficult and time consuming task. Say that for example a digital sine wave signal :
                           03     05     07
        sin 0 = 0 - ---- + ---- + ---- + . . .
                          3!      5!      7!
Using microprocessor, the sine function can be displayed at the output by incrementing 0 at every step and outputting the sine value of the 0 to the DAC. The sin 0 can either be calculated by software or by using floating point arithmetic cards. As this method is complicated, the simple and accurate method is to make the look up table. The value for each 0 is stored in memory in a sequential manner. For outputting code to the DAC, the memory for the 0 is then accessed. That is why we use a look up table to store the data.
        The original version already put data for 6 signals, ie: sine wave, ramp (saw tooth), triangular wave, square wave, staircase and particular wave. Here is the explanation of  2 steps from look up table data for sine wave signal :
 
 
Memory
Address
 0 =(360/256) x Memory Address
Sin
0
Bits
Binary
Value
(Base 80h + Bits)
Hex
Value
0000
0
0
0000 0000
1000 0000
80
0001
1.40625
0.02454
0000 0011
1000 0011
83
...
...
...
...
...
...
Example of two steps from look up table data for sine wave signal
       
The value of sine function = 1 at 90 degree. The amplitude is 128 units above the zero (reference) level. So for X sin function = ? above zero level. 

              X
        So ---- x 128 = X.128
              1
                         (sin 0 x 128) Round off
        %Error = -------------------------------- x 100
                                  (sin 0 x 128)
Digital value calculation :
                360                                       360
        0 = ------ x Memory Address = ------ x 0001 = 1.40625
                256                                       256
        sin 0 = 0.02454
        Bits = sin 0 x 128 = 3.14127
 
Therefore the digit before decimal point is 3.14127 = 3 (decimal) = 0000 0011 (binary, Bits)
Binary value to be stored to the EPROM is = 1000 0000  (Base value of DAC) + 0000 0011 (rounded point value) = 1000 0011 (83h).

The %Error can be calculated to get the exact sine wave representation which improves the accuracy.
Here is the rest of the look up table data for these sine wave signal. To make it simple for me and for you to design the patterns, I already make the simple editor program, works in graph mode or text mode. So it is easy to see the result and the more important things that it can be saved to disk. Here is the result for the six pattern signal that I already inputted :
  1. Sine wave (sine.sig)
  2. Saw tooth (ramp) wave (ramp.sig)
  3. Ramp reverse wave (ramprev.sig)
  4. Triangular wave (triangle.sig)
  5. Square wave (square.sig)
  6. Staircase wave (stair.sig)
  7. Negative staircase wave (stairneg.sig)
  8. Particular wave (partculr.sig)
The signal then can be combined to become one big data to loaded into EPROM. Just use copy command from DOS like this : 

COPY /B sine.sig+ramp.sig+triangular.sig+square.sig+stair.sig+...(more pattern signals)...+particle.sig  all.sig

You can add the spare address locations of EPROM to fit your need. Up to 10 signals free for your imagination. Please explore it and have fun !!! 


VI. PROTOTYPE

        My prototype size about 100mm x 100mm x 30mm (LWT), with the switches, thumb wheel and connector put on the top side of the box. Made from plastic and PVC. By using thumb wheel switch, only 10 function signals can be covered. If you don't want this, you can change the system by using a decoder type switch (1 to 16 lines), so the location can be covered all. Here is my prototype and sample of its wave form generate (This capture from a simple selfmade oscilloscope). I will published it later.

The complete UDFG can be obtained here.

8-Bits relay driver board using LPT parallel port


RELAY BOARD


A. PROLOG
 
        This article means to utilize your old PC to be come a simple controller. Many old PC like 8088 type, 8086, 80286, 80386, or even 80486 already become an obsolete systems, since they can not run many new program now a days. In fact, this system still also can be run well. Many people has let their own not used, since they have a new one (pentium type). Thus what for this old system now? For people like us, we can use this old PC to make any experiment. Here I will stimulate you to take advantage, make a simple controller using 8 relays to make a variety uses like; turning on/off lights, turn your home stereo set, on/off you home appliance, make a timer device, make a home device alarm, etc. All application depends on your imagination.

USB to IEEE 1284 Parallel Port Adapter Cable

A. SCHEMATIC DIAGRAM

click below images to enlarge


This board using 8-bits of LPT printer parallel data port (DP) to activate the relays. LPT printer parallel port also have 4-bits additional port (PC) which can be utilized too. But this is not implemented in this design, because in my opinion, 8-bits are more than enough, and beside that this size (1 byte) fit each of 8255 PPI port if we want to interface it too. The basic is the same for all the eight channels. To protect the LPT port from damage, I use optocoupler to isolated the PC side (+5V) and relay circuit (+24V). You can change the relay voltage type to +12V or even +6V if you can find one. This type of optocoupler, PC914 can be replaced with another type like 4N series (4N22 ~ 4N28, 4N35, 4N47 ~ 4N49, etc.).Using a common driver combination, transistor Q1 ~ Q8 (hi-power) to drive the relays. D1 ~ D8 use to protect the transistor from any transient current when the relay is in the off state. The resistor values are chosen to make transistors get full enough saturated when it is on. This common driver also can be change using IC driver like: ULN2002 ~ ULN2004 types. Each package contain 6-bits line drivers. So you need 2 of this IC, but one does  not maximize. If you use PC port, than this IC can be utilized. A good alternative.



Note that, for the relays, it must be stand the high voltage and current (big power) if you want to use it to drive any equiptment from the AC line. Find a good ones with a high rating output. Careful about the hi-voltage line on the PCB. Extra care must be taken in order to prevent the two different voltage lines not laying in the close distance. I used a terminal strip to connect this hi-voltage power wire.

B. PCB LAYOUT


 




  Here I already designed the PCB for this relays driver. Not very compact, but already run well. Only data byte were used (DP port). Note that, pin 18 through 25 all together connected to ground. This PCB also included with power supply voltage regulator (+24V). Its very easy to change it to any other voltage by changed the voltage regulator only. For the data connection, as usual I used a DB-25 connector, to be easy to connected to LPT printer parallel port or for future using, when we want to connect it to any other port (like 8255-PPI port). For any reader who doesn't have protel software, you can also printout this pdf schematic layout (90.414 Bytes).

C. PART LISTS

 
        Component part lists to build the complete set are :

   1. Resistors :
      R1 ~ R16 = 10k .................................................... 16 pcs
      R17 ~ R24, R33 = 1k5 .............................................. 9 pcs
      R25 ~ R32 = 1k .................................................... 8 pcs
   2. Capacitors :
      C1 = 2200 uF/50V (elco) ........................................... 1 pcs
      C2 = 1000 uF/25V (elco) ........................................... 1 pcs
   3. Semiconductors :
      D1 ~ D12 = 1N4007 ................................................. 12 pcs
      Led1 ~ Led9 = Red Led (3 mm) ...................................... 9 pcs
      IC1 = 7824 (voltage regulator) .................................... 1 pcs
      Q1 ~ Q8 = C1061 (transistor) ...................................... 8 pcs
      OP1 ~ OP8 = PC914 (optocoupler) ................................... 8 pcs
   4. Others :
      RL1 ~ RL8 = 24V relay PCB type (hi-power output, 5A/220V-AC) ...... 8 pcs
      CON1 = DB-25 socket (female, PCB type, LPT connector) ............. 1 pcs
      Optional CON2 = power connector ................................... 1 pcs
      OUT-1 ~ OUT-8 = 2-pairs of terminal strip ......................... 8 pcs
      Transformer = 15V with CT/1A or 30V-AC/1A ......................... 1 pcs
      Optional on/off switch for power supply ........................... 1 pcs
      Optional LPT parallel port cable (3 m) ............................ 1 pcs
      Optional little heatsink for voltage regulator .................... 1 pcs


D. SOFTWARE

     There are many 'ready to use software'. Besides that you can write your own software as your purpose. But our goal now is to run our new card well. Here is a good free software I found on the electronic CD recently, one based on windows and the other based on DOS system. This 2 softwares are the best as an LPT port analyzer program. You can on/off (toggle) every bits, and get the response at the back read. So we can used this option to on/off our correlation output relays.




Some related software based on DOS program also can be obtainable at : DIY Electronics kit from Hong Kong. If you want to write the software by yourself, Boondog Automation tell the detail how to programming it using simple basic interpreter programming language and C-language. A good lesson to first time. That's all for right now, hope you have a happy programming!



E. PROTOTYPE
 
        Here is my prototype board. As usual, I put it all together in a piece of multiplex board. So I can make a reach to any other components on the board, include the terminal strip to connect the output of relays.









Download the complete relay driver board project, now!

Programable I/O expanding decoder using 8255 PPI part-2

HARDWARE



            The decoder card used ISA slot (8-bit expansion card), so the card will be reside in the PC. We used only the lower slot (62-pins). To access the line, I used a standard connector DB-25. I used a female type, so I can utilize the standard parallel cable usually selling in the market. But if you decide to used this female type, careful about the same connector between it with LPT parallel port connector. If you can not differentiate it or if the PC used by many people, better used a male type. This can prefent you or someone else from plugged at wrong connector. But the bad side is you must make your own cable. Fig-2. shows the PCB layout. The design is not quiet good, but it works, and also easy to drawing it.

                                                Fig-2. 8255-PPI I/O decoder PCB layout.

Note that if you change the connector to DB-25 male type, all of the wiring layout connected to DB-25 must be changed and drawn again. Because the female and male type count direction are opposite. I used a jumper strip (header) for selecting the IRQn lines, so the card can be selected which number is still available (IRQ-3 to IRQ-7). to select the I/O address, just simple set up the 8-bit dip switch to the selected unused I/O address (refer to I/O map for details). Each dip switch from MSB to LSB (Q7 ~ Q0) related to address lines A9 ~ A2, while A1 and A0 directly selected by the PPI-8255 itself. To select an I/O address, eg.: I/O address 0220 Hex, the dip switch set directly from MSB to LSB (bottom to top at the picture) are : off-on-on-on-off-on-on-on. Just remember that this switch are opposite to the setting bits.

PART LISTS

            The components for building this 8255-PPI I/O decoder are :
   1. Resistors :
      R1 ~ R14 = 4k7 ........................5 pcs
   2. Capasitors :
      C1 = 100 uF/16V (for power input) .....1 pcs
      C2~C4 = 100 nf (ceramic) .............  3 pcs
   3. Semiconductors :
      IC1 = 74LS682 (8-bit comparator) ...... 1 pcs
      IC2 = 74LS32 (Quad OR gates) ...........1 pcs
      IC3 = 74LS245 (Octal tri-state buffer) . 1 pcs
      IC4 = 74LS125 (Quad tri-state buffer) ..  1 pcs
   4. Others :
      Optional IC socket for 20-pins ..... 2 pcs
      Optional IC socket for 16-pins ..... 1 pcs
      Optional IC socket for 14-pins ..... 2 pcs
      Pin header ..........................10 pcs
      Jumper header ....................... 1 pcs
      DB-25 socket female type ............. 1 pcs
      2-layers PCB about 75mm x 105mm size . 1 pcs
      Plate for pcb mounting ................ 1 pcs
 

PROTOTYPE

            Fig-3. shows my prototype. The prototype made by hand. Not too bad. You see! Don't forget about through hole. Hand made PCB don't have a through hole copper. you must make it by connection. I use a tiny wire (usually I took it from a small transformer that already damage). Before you put the components, soldering the wire at the top layer first, and then the bottom layer can be soldered both. Hope you have a nice work!!!



                                                   Fig-3. My protoype board, front and rear side view.

EXPANDER CARD MODIFICATION

            In the previous design lpt expander card, PPI-8255 pin directly connected to LPT port line signal. We must make so the proper connection related to the proper pins. For this purpose some changes must be made to the original design. Pin connection for address selection (A0-A1) and read/write signal (-WR/-RD) are not changed. But for reset and chip select (-CS) the connection pin changed by a double selection switch. This pin connect to the other unused pin connector. I used 'select' pin and 'paper end' pin for reset and chip select respectively. The complete changed new schematic diagram are shown at fig-4. Beside that a push button (push on) switch was added. This button used for resetting the card if the card not reset by the PC warm boot, or if the card not connected when doing re-boot-ing, or the time not happen to be doing re-boot-ting. Just simple push the button once. Remember that, if the button was pushed after the initializing card has done, all accessing to the ports would be inhibited. The rest is the same as before.


click the images for enlarging 

                      Fig-4. LPT expander card modification circuit diagram.


 Fig-5. shows the PCB layout for expander card modification. The elippses show the two jumper wire that must be opened and another track should be added. Opened point goto selector switch (sw1) and push button switch (sw2). Another is IRQn which optional using, if the PPI-8255 configured for mode-1 or mode-2. This point connect to the proper pin of port-C. 

                                        Fig-5. LPT expander card modification PCB layout.

Fig-6. Shows the setting card on the IBM PC/AT compatible (80486DX2-66), and fig-7. Shows the application program to run the 36-bits led display driver.


                                          Fig-6. Setting card on IBM PC/AT compatible, ISA slot.



                                      Fig-7. Application program running 36-bits led display driver.

Programable I/O expanding decoder using 8255 PPI part-1

8255 I/O DECODER


PREFACE

            As you can see from the article LPT port expander, this PPI-8255 is a general purpose I/O programmable function. But usually this IC are tired to the computer bus directly. Return to this idea, here I will show you that the card can be used to dual function purpose. Beside for the expander port, it can be used for I/O functional directly. So we can used the card both for the expander experiment or for direct connection to the computer bus experiment. Why do you need this I/O directly connection for? Many article on the net usually used this method for I/O interfacing. So by doing this, we can take 2 benefits. First, we can used many useful routines (usually with the tested ones) or directly used the softwares (?) or routines; secondly, we can used many hardware design by someone else (compatibility type). At most we can replace the I/O parts. Happy programming and happy surfing on the net.

DETAILS

            To directly connected a hardware to computer bus, we need an I/O decoding. Here I don't explain anymore, please refer to the topic of decoding technique at the other page. There are 2 type of decoding technique, ie: partial decoding, when we want to reduce the components using or full decoding. I prefer the last one. The decoder circuit must be preserve all of the possible unused I/O ports, easy to select the address, and not ambiguous for the future compatibility design. I used a comparator 74LS682 type and a dip switch for this purpose. Besides that the lines need buffers because the card may put far away from the PC. The complete circuit diagram shown at fig-1.
            One thing must remember that, when doing re-boot-ing the PC, the expander card must be connected to this decoder card. So the PPI can be reset. If not, the PPI can not be initialized. To anticipate this purpose, we can add a push on switch between +Vcc and reset pin of PPI. So you can connected the expander card at any time, when ever you want and without re-boot-ing the PC. Initialized perform when the software being execute. Some connection also must be changed to make the circuit work with this decoder card. The explanation will be clearly later.

click the image for enlarge

                                          Fig-1. I/O decoding for PPI-8255 circuit diagram.

SOFTWARE

            Nothing to say about this card programming. It is quiet easy. You can access the port by accessing directly to 4 contiguous port location, eg: if the decoder set to port 220 hex, so port-A = 220 H, port-B = 221 H, port-C = 222 H, port-CW = 223 H.
            First, initialize it by sending the control word data to port-CW (control word data contain mode setting for each port). Refer to PPI-8255 data book for more detailed explanation. Then each port can be accessing directly. Here are a sample of initialize routine for mode-0 for any language.
 
In PASCAL routine : 
CONST
     Base_Port = $220;
     Port_A = Base_Port;
     Port_B = Base_Port+1;
     Port_C = Base_Port+2;
     Port_CW = Base_Port+3;
     CW_Data = $82;       { Port-A = output, Port-B = input, port-C = output }

PROCEDURE Initialize_Port;
BEGIN
     PORT[Port_CW] := CW_Data;       { Send Control Word }
END;
PROCEDURE Read_Write_Port_A(Datanya : BYTE);
BEGIN
     ...
     PORT[Port_A] := Datanya;  { Send a Byte }
     ...
END;

FUNCTION Read_Port_B : BYTE;
BEGIN
     ...
     Read_Port_B := PORT[Port_B];   { Receive a Byte }
     ...
END;
PROCEDURE Write_Port_C(Datanya : BYTE);
BEGIN
     ...
     PORT[Port_C] := Datanya;  { Send a Byte }
     ...
END;

 
In ASSEMBLY routine : 
Base_Port EQU 220 H
Port_A    EQU Base_Port
Port_B    EQU Base_Port+1
Port_C    EQU Base_Port+2
Port_CW   EQU Base_Port+3
CW_Data   EQU 82 H           ;Port-A = output, Port-B = input, Port-C = output
Dummy     EQU 5A H

Initialize_Port PROC NEAR
          MOV  DX,Port_CW
          MOV  AL,CW_Data    ;Send Control Word
          OUT  DX,AL
          RET
Initialize_Port ENDP
Write_Port_A PROC NEAR
          ...
          MOV  DX,Port_A
          MOV  AL,Dummy      ;Send a Byte
          OUT  DX,AL
          ...
          RET
Write_Port_A ENDP
Read_Port_B PROC NEAR
          ...
          MOV  DX,Port_B
          IN   AL,DX
          MOV  Dummy,AL      ;Receive a Byte
          ...
          RET
Read_Port_B ENDP
Write_Port_C PROC NEAR
          ...
          MOV  DX,Port_C
          MOV  AL,Dummy      ;Send a Byte
          OUT  DX,AL
          ...
          RET
Write_Port_C ENDP

 
In BASIC routine : 
Base_Port = &H220
Port_A = Base_Port
Port_B = Base_Port+1
Port_C = Base_Port+2
Port_CW = Base_Port+3
CW_Data = &H82     ;REM ----- Port-A = output, Port-B = input, Port-C = output
Dummy = &H5A
PROC Initialize_Port
     OUT Port_CW,CW_Data     :REM ----- Send Control Word     
END PROC
PROC Write_Port_A
     ...
     OUT Port_A,Dummy        :REM ----- Send a Byte
     ...
END PROC
PROC Read_Port_B
     ...
     INP Dummy,Port_B        :REM ----- Receive a Byte
     ...
END PROC
PROC Write_Port_C
     ...
     OUT Port_C,Dummy        :REM ----- Send a Byte
     ...
END PROC

 
In C routine : 
#define Base_Port 0x220
int Port_A = Base_Port;
int Port_B = Base_Port+1;
int Port_C = Base_Port+2;
int Port_CW = Base_Port+3;
unsigned CW_Data = 0x82;/* Port-A = output, Port-B = input, Port-C = output */
unsigned Dummy = 0x5A;
               
void Initialize_Port()
{
     ...
     outp(Port_CW) = Dummy;  /* Send Control Word */
     ...
}
void Write_Port_A()
{
     ...
     outp(Port_A) = Dummy;   /* Send a Byte */
     ...
}
void Read_Port_B()
{
      ...
     Dummy = inp(Port_B);    /* Receive a Byte */
     ...
}
void Write_Port_C()
{
     ...
     outp(Port_C) = Dummy;   /* Send a Byte */
     ...
}
            A sample in assembly program show the demo for the possible combination of mode-0. If you already have built the project of 36-bits led display driver, you can put it to the output port-A through port-C. A nice display. I plan to write the sample program for mode-2. May be I could published it later.
At last, I found a good software to demonstrate this mode programming capabilities. This program was made by someone else and could shows the I/O state for each mode setting, as input port or output port. A good example software.

SB OSCILLOGRAPH


~ SB Oscillograph
_
[]
X
  Files   Edit   Options   Start Help
|          |          |          |          |          |
          |          |          |          |          |          |
          |          |          |          |          |          |
30000     |          |          |          |          |          |
----------|----------|----------|----------|----------|----------|-
          |          |          |          |          |          |
          |          |          |          |          |          |
          |          |          |          |          |          |
20000     |          |          |          |          |          |
----------|----------|----------|----------|----------|----------|-
          |          |          |          |          |          |
          |          |          |          |          |          |
          |          |          |          |          |          |
10000     |          |          |          |          |          |
----------|----------|----------|----------|----------|----------|-
          |          |          |          |          |          |
          |          |          |          |          |          |
          |          |          |          |          |          |
0         |          |          |          |          |          |
----------|----------|----------|----------|----------|----------|-
          |          |          |          |          |          |
          |          |          |          |          |          |
          |          |          |          |          |          |
-10000    |          |          |          |          |          |
----------|----------|----------|----------|----------|----------|-
          |          |          |          |          |          |
          |          |          |          |          |          |
          |          |          |          |          |          |
-20000    |          |          |          |          |          |
----------|----------|----------|----------|----------|----------|-
          |          |          |          |          |          |
          |          |          |          |          |          |
          |          |          |          |          |          |
-30000    |          |          |          |          |          |
----------|----------|----------|----------|----------|----------|-
          |          |          |          |          |          |
          |          |          |          |          |          |
          |          |          |          |          |          |
          |20        |30        |40        |50        |60        |
/\
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
 
\/
<
 
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>
 

Download 27 Kb
  
License
 

 Characterization

It is real digital oscillograph. Your sound cart can give 16 digital bits, and has two independent channels. It's great, it gives about 150 microvolt precision level. Frequency limit isn't hight, no more then 44100 Hz, but in many case it is enough.

This program can help you to make different measurements or scientific explorations. It can receive data from SB, show them like the oscillograph, save digital data in text file or just copy them to the clipboard for any other calculating program.

Instalation

Just run instalation program, read the license, if you agree, select destination folder and press "setup" button. That's all. Also you can, just copy oscil.exe -- about 20 Kb.

Controls and output

 

Program works with four streams of data. First and second are just source SB data without any adaptation. 44100 points per second. Left SB channel as X, and right channel as Y. Program stores only small part of full source SB data. To store big array of data advansed third and fourth streams are destined. They are acamulating channels. They can be filled with average, or with selected date. It can begin immediatle or by the front of signal. You can choose number of points in stream, time per point, how to acamulate points (average or just skip), loop stream or fill it one time only, etc.

  You can watch different graphics. Just X(t),Y(t). Like on the oscillograph you can select X+Y(t), X-Y(t), Y(X). Unlike oscillograph, you can watch many graphcs in the same time. May be sometimes Y(X) graphic has too many different lines, and it's drawing for too long. So, if you want to watch Y(X) don't select many points for stream. If you want to get Y(X) and select start by front mode, you can select synhronisation, start one channel with other. Advanced features of this program is spectrum of signal. It is real frequnce's spectrum calculated from first points of selected source chanel. Spectrum conversion is slovly operation, but two mode are precent. By default fast mode is seleted, but you may chouse precision mode.


 Hot keys

 


  • Use [+][-][*][/] keys to change scale

  • Or use pushed left mouse button to select scaled rect

  • Use just click of left mouse button to select full range

  • Use [Up][Down][Left][Right][Home][End][PgDn][PgUp] keys to scroll, or use scrollbars

  • To save one graphic or to copy one graphic into clipboard move mouse pointer, on this graphic (name of pointed graphic will be in the caption) and press right mouse button. Choose action from popup menu.

     

    Plug in

     

    If you have low level signals, no problem, you can direct connect it to SB, e.g to AUX input. AUX connector has common ground and left and right channels.
    //
    . ! . | |
      GND
    Left
    /
    Right
    Push right mouse button on the volume setting in the tool bar. In the menu select "Volume controls". In the window's menu select "Options". Choose "record". And select AUX or mixer as input channels.
    To measure different signals your need division scheme befor SB input. Here is an easy scheme for plug in one channel. To plug in two channels your need two equal scheme, like this.
    ,-----------------------> USB
                          |    To  Sound card ,---O
                          |                   |
                   |------|                   |
                   |      |         R3        |
    ,--\/\/\/\--\/\/\/\---+-------\/\/\/\-----+---|
    |     R1      R2      |                   |  GND
    |                     |                   |
    |                     '---|>L----J<|------|
    |                         VD1    VD2      |
    ^   Uin   Input   signal, one channel.    ^
    
      Resisters R1,R2,R3 are dividers. Variable resister R2 is to change devision rate. R1 is to restrict devision. SB will be measure voltage on R3.
    USB = Uin*R3/(R1+R2+R3)
    USB must be in range (-5..5V).
    To prevent voltage out of range two stabilitrons VD1 and VD2 included. Voltage stabilition must be about 4.4V e.g. 1N3995, BZX29C4V7, GLA47A, MZ4A, ZEC4.7, etc. 
     

  • BIP Electronics Lab Oscilloscope - 3.0

    DESCRIPTION



    The BIP Oscilloscope uses the sound card's input to measure signals. This means that the quality of the scope depends on the quality of your sound card. The scope has the following properties:

    Sampling frequency: 
     
    The scope automatically uses the highest sample frequency available at the input that you select (usually maximal 44 kHz)

    Accuracy:

    New Creative Labs Sound Blaster Audigy Se 7.1 24-Bit Sound Card Modern Design 
     
    The scope uses 8-bit samples to read the input signal. 
     
    Input impedance:

    VELLEMAN PCSGU250 USB-PC SCOPE + GENERATOR (2CH) 
     
    The same as the input impedance of your sound card.





    Download BIP Electronics Lab Oscilloscope - 3.0 

           Download Oscilloscope version 2.51

                                       

    SOUNDSCOPE

    If you own a PC computer, you can use a sound card as an oscilloscope to display a electronic signals.(Sound card have an A/D 16 bit converter
    with 48 kHz of sample rate ).For safety reason, I have create a circuit, that protect the sound-card from a high voltage.This is enabling or amplify or reduce the signal inclusive calibration of voltage levels.
    This circuit has one restrict - you can measure only AC signals.




    Demonstration of freeware program

    click the below images for zooming


     
    View circuit


    CLICK THE BELOW LINKS:




    View PCB















    Labels

    PROJECTS 8086 PIN CONFIGURATION 80X86 PROCESSORS TRANSDUCERS 8086 – ARCHITECTURE Hall-Effect Transducers INTEL 8085 OPTICAL MATERIALS BIPOLAR TRANSISTORS INTEL 8255 Optoelectronic Devices Thermistors thevenin's theorem MAXIMUM MODE CONFIGURATION OF 8086 SYSTEM ASSEMBLY LANGUAGE PROGRAMME OF 80X86 PROCESSORS POWER PLANT ENGINEERING PRIME MOVERS 8279 with 8085 MINIMUM MODE CONFIGURATION OF 8086 SYSTEM MISCELLANEOUS DEVICES MODERN ENGINEERING MATERIALS 8085 Processor- Q and A-1 BASIC CONCEPTS OF FLUID MECHANICS OSCILLATORS 8085 Processor- Q and A-2 Features of 8086 PUMPS AND TURBINES 8031/8051 MICROCONTROLLER Chemfet Transducers DIODES FIRST LAW OF THERMODYNAMICS METHOD OF STATEMENTS 8279 with 8086 HIGH VOLTAGE ENGINEERING OVERVOLATGES AND INSULATION COORDINATION Thermocouples 8251A to 8086 ARCHITECTURE OF 8031/8051 Angle-Beam Transducers DATA TRANSFER INSTRUCTIONS IN 8051/8031 INSTRUCTION SET FOR 8051/8031 INTEL 8279 KEYBOARD AND DISPLAY INTERFACES USING 8279 LOGICAL INSTRUCTIONS FOR 8051/8031 Photonic Transducers TECHNOLOGICAL TIPS THREE POINT STARTER 8257 with 8085 ARITHMETIC INSTRUCTIONS IN 8051/8031 LIGHTNING PHENOMENA Photoelectric Detectors Physical Strain Gage Transducers 8259 PROCESSOR APPLICATIONS OF HALL EFFECT BRANCHING INSTRUCTIONS FOR 8051/8031 CPU OF 8031/8051 Capacitive Transducers DECODER Electromagnetic Transducer Hall voltage INTEL 8051 MICROCONTROLLER INTEL 8251A Insulation Resistance Test PINS AND SIGNALS OF 8031/8051 Physical Transducers Resistive Transducer STARTERS Thermocouple Vacuum Gages USART-INTEL 8251A APPLICATIONs OF 8085 MICROPROCESSOR CAPACITANCE Data Transfer Instructions In 8086 Processors EARTH FAULT RELAY ELECTRIC MOTORS ELECTRICAL AND ELECTRONIC INSTRUMENTS ELECTRICAL BREAKDOWN IN GASES FIELD EFFECT TRANSISTOR (FET) INTEL 8257 IONIZATION AND DECAY PROCESSES Inductive Transducers Microprocessor and Microcontroller OVER CURRENT RELAY OVER CURRENT RELAY TESTING METHODS PhotoConductive Detectors PhotoVoltaic Detectors Registers Of 8051/8031 Microcontroller Testing Methods ADC INTERFACE AMPLIFIERS APPLICATIONS OF 8259 EARTH ELECTRODE RESISTANCE MEASUREMENT TESTING METHODS EARTH FAULT RELAY TESTING METHODS Electricity Ferrodynamic Wattmeter Fiber-Optic Transducers IC TESTER IC TESTER part-2 INTERRUPTS Intravascular imaging transducer LIGHTNING ARRESTERS MEASUREMENT SYSTEM Mechanical imaging transducers Mesh Current-2 Millman's Theorem NEGATIVE FEEDBACK Norton's Polarity Test Potentiometric transducers Ratio Test SERIAL DATA COMMUNICATION SFR OF 8051/8031 SOLIDS AND LIQUIDS Speed Control System 8085 Stepper Motor Control System Winding Resistance Test 20 MVA 6-digits 6-digits 7-segment LEDs 7-segment A-to-D A/D ADC ADVANTAGES OF CORONA ALTERNATOR BY POTIER & ASA METHOD ANALOG TO DIGITAL CONVERTER AUXILIARY TRANSFORMER AUXILIARY TRANSFORMER TESTING AUXILIARY TRANSFORMER TESTING METHODS Analog Devices A–D BERNOULLI’S PRINCIPLE BUS BAR BUS BAR TESTING Basic measuring circuits Bernoulli's Equation Bit Manipulation Instruction Buchholz relay test CORONA POWER LOSS CURRENT TRANSFORMER CURRENT TRANSFORMER TESTING Contact resistance test Current to voltage converter DAC INTERFACE DESCRIBE MULTIPLY-EXCITED Digital Storage Oscilloscope Display Driver Circuit E PROMER ELPLUS NT-111 EPROM AND STATIC RAM EXCITED MAGNETIC FIELD Electrical Machines II- Exp NO.1 Energy Meters FACTORS AFFECTING CORONA FLIP FLOPS Fluid Dynamics and Bernoulli's Equation Fluorescence Chemical Transducers Foil Strain Gages HALL EFFECT HIGH VOLTAGE ENGG HV test HYSTERESIS MOTOR Hall co-efficient Hall voltage and Hall Co-efficient High Voltage Insulator Coating Hot-wire anemometer How to Read a Capacitor? IC TESTER part-1 INSTRUMENT TRANSFORMERS Importance of Hall Effect Insulation resistance check Insulator Coating Knee point Test LEDs LEDs Display Driver LEDs Display Driver Circuit LM35 LOGIC CONTROLLER LPT LPT PORT LPT PORT EXPANDER LPT PORT LPT PORT EXTENDER Life Gone? MAGNETIC FIELD MAGNETIC FIELD SYSTEMS METHOD OF STATEMENT FOR TRANSFORMER STABILITY TEST METHODS OF REDUCING CORONA EFFECT MULTIPLY-EXCITED MULTIPLY-EXCITED MAGNETIC FIELD SYSTEMS Mesh Current Mesh Current-1 Moving Iron Instruments Multiplexing Network Theorems Node Voltage Method On-No Load And On Load Condition PLC PORT EXTENDER POTIER & ASA METHOD POWER TRANSFORMER POWER TRANSFORMER TESTING POWER TRANSFORMER TESTING METHODS PROGRAMMABLE LOGIC PROGRAMMABLE LOGIC CONTROLLER Parallel Port EXPANDER Paschen's law Piezoelectric Wave-Propagation Transducers Potential Transformer RADIO INTERFERENCE RECTIFIERS REGULATION OF ALTERNATOR REGULATION OF THREE PHASE ALTERNATOR Read a Capacitor SINGLY-EXCITED SOLIDS AND LIQUIDS Classical gas laws Secondary effects Semiconductor strain gages Speaker Driver Strain Gages Streamer theory Superposition Superposition theorem Swinburne’s Test TMOD TRANSFORMER TESTING METHODS Tape Recorder Three-Phase Wattmeter Transformer Tap Changer Transformer Testing Vector group test Virus Activity Voltage Insulator Coating Voltage To Frequency Converter Voltage to current converter What is analog-to-digital conversion Windows work for Nokia capacitor labels excitation current test magnetic balance voltage to frequency converter wiki electronic frequency converter testing voltage with a multimeter 50 hz voltages voltmeter

    Search More Posts

    Followers