The Basic System

Now starts the good stuff. Here begins the description and construction of the basic development system I've been referring to in previous lessons. The source for most of the parts will be Digikey Corporation. Understand that I'm neither affiliated with nor do I have a preference as to which you use and, depending on where you live, there are probably other sources. I will try to list the electrical characteristics of each part so that where ever you get them, you will get the right one. There are some parts that can't be obtained at either place and I will list them as they come up.

One more thing. You should, if you don't already have one, get a multimeter to use along with this course. It will prove invaluable in trouble shooting problems with the system, and you are basically blind without one. One can be obtained for around $20 that is digital and is quite accurate. These used to cost over a hundred dollars at the least and several hundred for a good one. CARE SHOULD BE EXERCISED WHEN USING ONE TO MEASURE VOLTAGES GREATER THAN +5 VOLTS! especially when measuring AC power outlets or the like.

For more information on electronics, check out this link. This is a nice tutorial on electonics, and should prove useful.

We will begin with the system power supply. This consists of a transformer, a bridge rectifier, a filter capacitor, a +5 volt regulator chip and a heat sink for the regulator. The transformer needs to be a UL listed wall mount variety with at least a 7.5 volt RMS output and at least a .5 amp capacity.

The parts I bought were from DigiKey Corp. and the part numbers are:

Qty     Part#             Description                            Price

1       T702-ND           WALL TRANSFORMER  9VAC  600 MA         6.70
1       HS121-ND          PLUG-IN HEAT SINK FOR TO-220            .44
1       W005G-ND          1.5 AMP 50 V BRIDGE RECTIFIER GP        .42
1       P5234-ND          NHE RADIAL ELECT CAP 16V 470UF          .66
1       NJM7805FA-ND      IC 5V POSITIVE REGULATOR TO220          .88

The processor parts consist of the microcontroller, an oscillator, 2 switches, 2 resistors, a hex inverter and a capacitor. All but the microcontroller I got from Digikey. Here are the Digikey parts

1       SE1232-ND         CRYSTAL OSC 11.0592MHZ CMOS 8 D        3.45
1       CD74HCT04E-ND     HEX INVERTER                            .39
2       P2040-ND          22UFD 16VDC TANTALUM CAP               1.72
2       CKN1059-ND        TOGGLE SWITCH SPDT VERTICAL RT         8.88

The processor I bought from Dallas Semiconductor directly. The part number may vary from the one shown, but it should be the 16 MHz, 32K X 8, 40 pin DIP, part.

1       DS5000-32-16      Soft Microcontroller                 ~70.00

Dallas Semiconductor can be reached for credit card orders at 1-800-336-6933 for US orders or at 972-371-4000 for orders outside the US. Another source is Newark at 1-800-4NEWARK for  $62.50

The rest of the parts I bought at Digikey. I've included a description so that you could get some of these parts at another location. Radio Shack has many of these parts, including solar cells. Also the prices I've listed here, will, no doubt, vary over time.

Also the LCD Display can be bought from Allelectronics.com for $7.00. Their part number is LCD-46. The solar cell can be substituted with a part number PVD-2, from the same place. Allelectronics.com has many of these parts, and a whole lot more, at GREAT prices. Check them out at http://www.allelectronics.com .

6       P2040-ND          22UF 16VDC TANTALUM CAP                5.13
10      P4551-ND          .001UF 50VDC POLYESTER B CAP           1.08
2       CD74HCT123E-ND    DUA RETRIG MONO MULTIVIBRATOR          1.60
1       ADC0808CCN-ND     8 BIT A/D CONV 8 CH MUX 28-DIP         6.60
1       MAX232CPE-ND      IC 5 VOLT DUAL RS232 X/R 16-DIP        2.94
3       2N3904-ND         NPN SML SIG G.P. AMP&SWITCH TO-92       .87
1       2N3906-ND         PNP SMLL SIG G.P. AMP&SWITC TO-92       .29
5       100EBK-ND         100 OHM 1/8W 5% CARBON FILM RESISTOR    .28
5       330EBK-ND         330 OHM 1/8W 5% CARBON FILM RESISTOR    .28
5       470EBK-ND         470 OHM 1/8W 5% CARBON FILM RESISTOR    .28
5       4.7KEBK-ND        4.7K OHM 1/8W 5% CARBON FILM RESISTOR   .28
18      10KEBK-ND         10K OHM 1/8W 5% CARBON FILM RESISTOR    .56
5       27KEBK-ND         27K OHM 1/8W 5% CARBON FILM RESISTOR    .28
1       4N35QT-ND         TRANSISTOR OPTOISOLATOR                 .43
2       923252-ND         SUPER STRIP ALLOY CONTACTS            38.50
1       P276-ND           SOLAR CELL 1.3V 55.0 X 11.0 MM         1.16
1       73-1098-ND        LCD MODULE 20 X 4 CHARACTER           31.92
1       MC14M-X-ND        5 FT 14 CONDUCTOR RIBBON CABLE         4.80
3       HLMP-1700QT-ND    T-1 DIFFUSED RED LED                    .90
2       P4887-ND          .1UF CAP                                .64
1       CD74HCT393E-ND    DUAL 4 BIT COUNTER                      .83
10      BAV21DICT-ND      .2 AMP 250 VOLT DIODE                  1.00
2       LM34DZ            32 TO 212 PREC F TEMPERATURE SENSOR    5.70
1       P2105-ND          1UF 16VDC TANTALUM CAP                  .28

I also put a connector on my LCD display which involved the male connector on the display, a female connector to plug on it and the pins and crimper for the female connector. You can solder the 14 conductor ribbon right to the display, saving this cost, if you are careful. Digikey doesn't sell a 14 pin version so you have to get a 12 pin and a 2 pin connector and use them together to get 14 pins total.

1       WM4210-ND         .1 INCH 12 PIN HEADER                  1.38
1       WM4200-ND         .1 INCH 2 PIN HEADER                    .29
1       WM2000-ND         .1 INCH 2 PIN TERMINAL HOUSING          .14
1       WM2010-ND         .1 INCH 12 PIN TERMINAL HOUSING         .86
30      WM2200-ND         .1 INCH PINS FOR HOUSINGS              3.15
1       WM9900-ND         .1 INCH PIN HAND CRIMP TOOL           13.57

You will need a cable and 9 or 25 pin female serial connector to connect to your PC serial port. The number of pins depends on the number of pins on your PC. Some PC's have both, with the 9-pin being COM 1 and the 25-pin COM 2. But things are further complicated if you have an internal modem. Many times the 25-pin port, or COM 2 will be disabled and the installed modem will be set for COM 2. The cable between the PC and the microcontroller only needs 3 wires. I have used standard flat telephone cable (called silver satin) for this cable. It is cheap and you can get some at many different places. It needs to be at least 10 Ft long so that the micro doesn't have to be too close to the PC. The schematic I will furnish will show you what pins to tie together on the female serial connector to avoid having to use more than 3 wires. I also bought a hood to cover the female connector to hide the wires on the connector. It's not necessary but improves the looks and gives you something to grab hold of when connecting or disconnecting the connector with your PC. The connectors are available at Digikey

1       109F-ND           9 PIN D FEMALE CONNECTOR               1.65
1       125F-ND           25 PIN D FEMALE CONNECTOR              3.43
1       909Z              9 PIN D HOOD                           2.00
1       925Z-ND           25 PIN D HOOD                          3.03

Some of the above parts are for constructing the X-10 interface. You will need the computer interface made by X-10 to complete the interface. It can be obtained from Home Automation Systems Inc. Their WEB site is http://smarthome.com/ . You will need a 10 Ft piece of flat telephone cord with a standard phone connector on one end to connect to the interface module. Their order phone number is 1-800-SMARTHOME or 1-714-708-0610 for questions. The part number is

1       1135              TW523 TWO WAY INTERFACE MODULE        22.95

I think that this is all the parts needed to complete the course. You might want to wait to buy the X-10 module if you are short of funds. It will be several lessons before we start on that project, but you will eventually need it to complete the course. It is a very useful interface and fairly priced. You will be able, through it, to control any light, appliance, air-conditioning, or receptacle in your house that you buy a corresponding module for. A module for controlling a light with dimming capabilities is about $10. To control the other equipment in your house you will need units that cost a little more but none are very expensive. Check out the WEB site mentioned above and you can get on their mailing list and get a catalog of the various modules available and the prices or view them on-line.

You will need a soldering iron to do any soldering. It should be as small a wattage as you can get, around 15 watts, with as small a tip as you can get, to prevent overheating the parts. They cost from less than $20 to over $100, depending on how good a one you get. You will also need a small pair of needle nose pliers, a small pair of diagonal cutters, a small screwdriver, and a pair of wire strippers. These can be obtained from Radio Shack and other consumer stores that sell electronic parts. Some of the above parts can also be obtained from Radio Shack but since I couldn't get a catalog from them I didn't list the part numbers for them. Radio Shack also has a small device that has alligator clips mounted on a stand that allow you to have a third hand to hold wires or parts that you want to solder to. It is very handy and fairly cheap, around $10.

I could make and sell some of the things that need soldering to you but that would stop you from learning how to solder. Plus I would have to charge you for my time and my original intent for this course was not to make any money for offering it.

I must state that soldering can be HAZARDOUS TO YOUR HEALTH. THE TIP IS VERY HOT and can give you bad burns if you come in contact with the hot tip. Also it is desirable to solder in a well ventilated area to avoid breathing the flux fumes that result from melting resin core solder. I have done it all my life, with no apparent problems, but I have heard that it is unwise to breath the fumes if you don't have to. I would place a small fan blowing on you to keep the rising fumes from being inhaled directly. I intermittently hold my breath while the tip is in contact with the solder. With skill and a developed art, you can minimize the amount of fumes by only applying the minimum amount of solder in quick well directed operations. It doesn't take much solder to connect small parts, like the temperature sensors to a cable so that it can be hung outside to get outside temperature into the micro. Also you should ALWAYS USE SAFETY GLASSES while working with tools and electronic parts.

I hope that you can afford to get all these parts because without them you will be at a disadvantage in trying to follow the rest of this course. I wish that I could just give them to you but I cant. If you can't afford all of them at once, maybe you can buy them a little at a time and be able to buy the ones necessary to keep up with the course. If you do have a problem with finances, look at the next lesson and only buy the parts necessary to build the initial part of the system. I realize that we are talking around $200 to get everything, so it may be difficult for some, but there is no way to teach this course and have you understand it without having a system to play with and to try out the different techniques described. What you will have if you can afford it is a development system that 10 years ago would have cost several thousand to build, if you could build it at all.

I don't however, discourage you to continue without the hardware described in this lesson. You may still be able to glean some good info without the hardware.

Here is the schematic for the system we are going to build. There are two versions, one is using the DS5000 part and the other is using the DS2250 part. Both are identical in functionality. The only difference in the schematics is the pinout of the microcontroller chip. The DS5000 is in a standard 40 pin dip package that is easy to use with the protoboard, but is about $70. The DS2250 is in a 40 pin simm package that requires special handling to connect to the protoboard, but costs only $52 with a special socket to accept the simm. I don't suggest this option unless you are confident in your soldering abilities, since you will have to solder very small wires to a connector with pins on .05" centers. I had some difficulty in doing this myself and I've had 30 years practice in soldering. I would get the DS5000 and spend the extra $20 and spare yourself the difficulties involved in getting it connected to the protoboard. The DS5000 simply plugs into the protoboard, with no hassles. If you contact Dallas and elect to get the simm part, tell them that you want a socket for it also. The part number for the DS2250 is the nearly the same as the DS5000. It is a DS2250-32-16 and the socket is a DS90720-40V. I STRONGLY suggest that you get the DS5000 part though! The warning has been given. Don't hold me responsible if you can't get the DS2250 wired up!

NOTE: To print the schematics you will need an HP compatible printer (one that understands the PCL language). To print a schematic type (at the DOS command line):   COPY /B MICLAB50.PCL LPT1 This example assumes which schematic and that the printer is attached to port 1 (LPT1). Usually most PC's only have one printer port. If you experience trouble printing a schematic, one thing you can try is, while at the DOS command line, cycle the power on your printer and try to print it again. I've had a report from one person that said that the bottom part of the schematic wasn't printing. This could be because WINDOWS has set the top and bottom margins and you don't actually have sufficient print area to print one of these schematics. By cycling power on the printer, while at the DOS command line, you will clear out any possible setup that WINDOWS has made to the printer and reset it to it's default, which should work.

I have recently found a program to convert the PCL files into BMP files. This is the 2250 file and this is the 5000 file in bmp format (zipped). You should be able to find numerous programs to display and print these files in this format.

For those that have downloaded the schematics prior to about 3:30 PM CST   4/19/97 , you need to download them again as I had a couple of errors on the original ones. I have also added two more ZIPS. One is a set of utilities that will allow you to work with the DS5000 or DS2250 chips but are useless without one wired up and connected to your PC. The other is a set of help files with chip pinouts, the 8051 instruction set, and a LCD display work sheet for laying out how you want different things displayed and where. This will be of more benefit later, but I'm giving them to you now. Some of these files use the IBM block graphics character set. Most printers support these characters, but some don't. To avoid problems, try to find an IBM emulation for your printer. (EPSON emulation definitely won't work) These help files are text files and should print on any printer supporting the IBM block graphics character set, which most do.

Digikey's Web Site is http://www.digikey.com/

Dallas Semiconductor's site is http://www.dalsemi.com/

National Semiconductor makes most of the chips, besides the microcontroller that are used in this course.
National Semiconductor's site is http://www.national.com/

Newark Electronic's site is http://www.newark.com/

My home page is http://www.hkrmicrop.com/personal/index.html .

On to lesson 12.