home *** CD-ROM | disk | FTP | other *** search
/ News-Disk 8 / News_Disk_Issue_08_19xx___BASIC.atr / project1.doc < prev    next >
Text File  |  2023-02-26  |  4KB  |  1 lines

  1. This article has been taken from Z*MAG on-line newsletter issue 205. Please also see my notes at the end.¢-----------------------------------¢¢===================================¢LIGHT SENSOR FOR THE 8-BIT¢by Kevin Jones¢===================================¢¢¢This is the first of a series of articles that will teach the average user a little more about his computer and the lesser known talents of the Atari computers.  If this article meets with any interest then there will be more "How to" articles following this one.  Each file will describe how to make a new hardware project for the Atari computers.  If you like this article, have any questions, or just want to complain, you can reach me at The Atari Scene!  (502-456-4292).¢¢In this file I will describe how to make a Light Sensor.  Before I get down to the details, I will tell you how it works.  The joystick port for the Atari computer consists of 4 joystick input pins, 2 paddle input pins, 1 negative ground pin, and 1 +5 volt pin.  Right now we are only concerned with the paddle input and the +5 volt pin.  The paddle works by a potentiometer that changes its resistance when the knob is turned. The ATARI measures this resistance and converts it to a number between 0 and 255.  The light sensor will consist of a plug for the computer port, a potentiometer and a photocell.¢¢The current will flow through the potentiometer, which is used to tune the potentiometer to a desired number, and into the photocell which will further change the resistance.  From the eye, the current will go back into the paddle input pin on the computer.  The photocell eye will change its resistance when light shines on its surface.  It works somewhat like the pot but does not have a knob to turn.¢¢Now that you have a minimal understanding of what you are making, we can begin to construct the sensor.¢¢Here is a description of the port configuration on the computer.¢¢*1 2 3 4 5*¢ *6 7 8 9*¢¢1 to 4 Joystick input pins¢5 Paddle B input¢6 Fire button¢7 +5 volts¢8 Ground -¢9 Paddle A input¢¢Parts:  (1) 9 pin Female connector¢            276-1538 2.49¢        (1) CdS photocell 276-116¢            1.79¢        (1) 100k potentiometer¢            271-1721 1.09¢        Wire-about Six feet¢¢Step One:  Cut the wire into two (2) strands of two feet each.  Solder one end of the first wire to pin 9 and the end of the other wire to pin 7.¢¢Step Two:  Take the free end of the wire attached to pin 9 and solder it to one lead of the photocell.  Next, solder a wire (new wire) to the other lead of the photocell and solder the end of that wire to an outside pin of the potentiometer (there will be three pins on the potentiometer).¢¢Step Three:  Take the wire from pin 7 and solder it to the inside pin of the potentiometer.¢¢Step Four:  Basically the sensor is finished.  You can either mount it in a box or pc board, or you can tape the connections with electrical tape and let if flop around.  I would tape it and mount it in a box to be neat and safe.¢¢All you have to do is plug the female plug into port one and run the below program.  This program will print out the value (0-255) of the port.  All that has to be done to measure the light is to obstruct the photocell and watch the readings.  That is it!!¢¢10 Rem Light Sensor Program¢20 x=paddle(0)¢30 print x¢40 goto 20¢¢That's about as simple as it gets.¢¢¢------¢News-Disk Editor's notes:¢¢The part numbers and prices given in the parts list are for Tandy. The prices are in US$. They will be more expensive in the UK. I would suggest using a joystick extension cable (also available from Tandy) instead of making your own connector for the joystick port. The potentiometer used in this project is not vital. It would work by just having the photocell connected between +5V and the paddle input. I would recommend a fuse (50mA quick blow) between the photocell and the paddle input. A very similar project appeared in an old copy of Atari User (the UK Atari User) quite a few years back. I built it and it works very well. But, don't forget: neither Z*MAG or I can be held responsible for any damage caused to yourself or your computer equipment as a result of attempting this project. It's a very simple project and you should hve no problems if you follow the instructions.¢