DPRG Events Shoptalk

Website design and hosting by NCC

Newsletter Index

November 1997 issue of The DPRG Newsletter

Well after skipping a couple of months because things got really hectic around my house, maybe I'm back on schedule with another DPRG Newsletter. A lot of things have happened in the three months that were skipped. Three meetings (August, Septemeber, and October) and three RBNOs (Robotic Builder Night Outs). Even though we missed a few newsletters, DPRG is still going strong and it seems that everyone is still very excited about DPRG in spite of me not getting some newsletters out.

A rerun of the May RoboRama Robotics contest has been scheduled for the February Meeting. Bring yourselves and your robot. A good time to be had for sure. We've been consistantly holding around 25-30 in attendance in our meetings.

The Fiscal Year is at Hand

We're comming up on another DPRG fiscal year. In January we'll be holding elections once again for the officers and workers in the DPRG and maybe try to decide something about the new Bylaws and what officers we should have. Right now, the only officer we have is me (Jim Brown) as President. That's really not the way we should be opperating. Also, we have a Librarian, a Software/Hardware librarian, and a parts librarian. Anyway to change the Bylaws will require a hefty majority of the membership which is now up to about 50. Steve Rainwater has penned a new set of updated bylaws for us in preparation of getting the 501c3 status for our group that will require a set of bylaws. I'll try to get them online for everyone to view. We all need to sit down and read them and decide if that's what our group should be doing.

Driving high-power loads with a microprocessor

Roger Arrick
This tutorial offers suggestions about controlling large loads with a microprocessor. This is often an issue with those building robots who need to control devices such as lights, motors, vacuums, and other accessories found on robots.

We will only deal here with devices that need to be switched ON and OFF - not devices that need the power reversed. Obviously drive motors and other devices need to be switched ON/OFF and also have the power reversed in order to reverse the direction of the motors. That normally requires an H-bridge which is a much more complicated circuit.

Microprocessor output strength:
Most microprocessors have outputs that are not very strong. Many can sink (drive to ground) less than 20ma. That's about what you need to drive an LED but not a motor.

Protecting the Microprocessor:
First things first. You always want to protect the micro's inputs and output pins.

The easist way is to simply add a gate between the micro and the power device driver. Any logic gate that is compatible with your micro can be used. In most cases this gate can be zapped and spare the micro - keeping your little rug-runner from becoming brain dead. Gates are cheap, micros are expensive.

Another way is to use the following circuit which clamps out-of-range voltages:

--------                     _|_ 1N4000 
        |                    /_\  Diode
        | I/O pin   220 ohm   |
 Micro  |----------\/\/\/\---o--------> to circuit
        |                    _|_
        |                    /_\ 1N4000
--------                      |   Diode

Opto-isolation can be used to protect circuitry but it's ususlly not necessary unless you're driving a plasma cutter or other high-frequency/high-voltage devices. If you're still interested, look up data on the 4N25 optoisolator.

For loads < 200ma:
Many loads are small but just too big for a micro to drive. This includes small lights and small motors. Make sure to measure the current draw of your device before deciding on a drive scheme. Make sure to stall motors to see what their maximum current draw is.

My favorite parts for driving small loads <200ma is the popular 2N2222 transistor. They can often be had for less than 10 cents each. They come in small plastic cases (TO92). When looking at the front of the package (flat side) with the legs going down, the pinout is E B C (Emitter, Base, Collector). It doesn't take a EE degree to use these great parts - here's an example. Notice that the transistor drives the load to ground.

           \ R3           
-------    /              2N2222     ------ 
       |   \                   _____|      |___/\/\/\___ +5v
       |   |   R1         B |/ C    | lamp |     R2
 Micro |<----/\/\/\---------|        ------
       |                    |\ E
-------                       |

R1 is not needed if the output of the micro is simply a week pullup-open collector/drain like the those found on the 8051. Otherwise, R1 is needed to limit the current through the base of the transistor. Try 1k ohm for R1 if your micro has a strong output.

R2 may be needed to limit the current through the load. Use Ohm's law to calculate.

R3 may be needed to pull up the input if the micro outputs nothing and has no internal pull-up's such as PO of the 8051. A 1k to 10k works good here.

Again, you can put a gate between the micro and transistor to add an extra layer of protection.

For loads > 200ma:
Ok, now for the big stuff you've been waiting for. MOSFETs are powerfull transistors that are great for doing this sort of thing. It's not a problem to drive loads > 10 amps using a MOSFET. Parts like the IRF540 are good for this job. Normally you can get them for $1-$3 depending on specs. Standard MOSFETs need 10 volts at their Gate pin to turn them on completely. This can be done with a 7406 level converter or a 2N2222 transistor. This level conversion usually inverts the signal so make provisions in your software. There are logic-level MOSFETs available that turn on with only 5v. Here's an example:

                 / 10k
-------          /    IRF540 D  --------
       |   |\    |        |----| vacuum |----- +12v 
 Micro |---| \O--o--------|     --------
       |   |/          G  |-- S
-------    7406              |

Looking at the MOSFET with the legs pointing down the pinout is G D S (Gate, Drain, Source).

Voltage ratings:
These circuits are dealing with low voltages (<12v). For higher voltages, make sure to check the transistor specs.

Driving inductive loads:
Inductive loads have coils in them. Examples include motors, relays, and solenoid valves. When you turn an inductive load ON then OFF, it creates a voltage spike. Normally this spike will distroy a transistor. Sometimes a MOSFET will handle this condition but it's best to protect the transistor with a simple diode across the load. Use 1N4000 diodes for 1 amp loads. Simply put the diode across the load with the cathode at the + power supply and the anode at the other side that connects to the transistor. Any voltage that is greater than the powersupply pin will be clamped.

Software and variable duty cycles:
In software you can simply turn ON or OFF the device by sending a 1 or 0 to the port pin. Remember that your drive circuitry will determine which will turn the device ON. Another not-so-obvious possiblity is that quickly turning ON and OFF the device can result in variable speed for motors and variable intensity for lamps. You can do this by setting up a timer or simply do a software timing loop. Normally a frequency of 100 to 1000hz will do the job just fine. Experiment, experiment, experiment.

Power up condition:
One often overlooked issue is that of power up conditions. When your micro is turned on, the output pins assume a default condition. Often this condition is HIGH (5v). If this is driven directly into the 2N2222 circuit shown above, then the device with turn on as soon as power is applied. Even if the micro's program quickly turns off the pin by sending a LOW (0v), you could still get a quick jolt on a motor or other device which could be bad. Use a gate such as a 74HC04 to invert the signal if needed.

That's a rap.

H-Bridge Project underway

The H-bridge project that we started a long long time ago (see the March 1994 newsletter) is now underway again. Hopefully this time we'll complete it! It will have two h-bridges capable of much higher current than an 18200 chip. You can see more details about the H-bridge project on the DPRG website.

Robotics Digest Number 2 is out

I've been getting a lot of requests on where and how to get the Robotics Digest magazine, so I thought I'd put it in the newsletter. Robotics Digest is published quarterly by William E. Gates (No not the Microsoft Bill Gates, the other one). Bill Gates also publishes Midnight Engineering and MicroComputer Journal.

Robotics Digest
1700 Washington Avenue
Rocky Ford, CO 81067
Phone 719-254-4558 . Fax 719-254-4517
Email 102505.3055@compuserve.com
4 issues US $24 | 4 issues Mexico & Canada $29 USD | 4 issues Other Foreign $49 USD

RoboRama Robotics Contest to be held in February

For more information on the upcoming RoboRama, see the February 1997 Newsletter
The contest specs, provided by the Contest Committee and penned by Eric Yundt, can be found in the December 1997 Newsletter.

Clay Leads the August DPRG meeting

Below are some pictures taken at the August DPRG Robotics Meeting.
Clay Timmons Kip Morevic Eric Yundt

Copyright © 1984 - 2014 Dallas Personal Robotics Group. All rights reserved.