HOME > >
SENSING AND CONTROL MAIN PAGE > >
Sensing and Control for hobbyists and schools: Misc Sensors
Lets hear it for the simple switch! Both momentary and toggle switches are useful (The former is like a doorbell switch, the latter like a table lamp's switch.)
How do you connect them to a computer? Much is revealed at my electronics site. I've also posted information about connecting things to your program across a LAN or the internet.
Beyond the humble switch there is the un-humble switch: Devices that are, at their heart, "mere" switches... but under rather splendid skins. Most burglar alarm systems incorporate at least a few PIRs: The little boxes that get mounted high on a wall and wink an LED at you when they "see" you (more precisely, your body heat) go by. A PIR is a wonderful device... but the part you connect to is just a switch that is operated by the rest of the PIR's electronics.
The analog to digital convertor, or ADC, is another important device. It converts voltages into digital signals. Each device has different specifics. For instance, one accepts anything from 0 volts to 2.55 volts as it's input. In other words, you attach one pin of the device to the "zero" of some circuit and the input pin to some other point in the circuit, a point where the voltage won't always be the same. As that voltage can be 0 or high or quite high or quite low, it is called analog.
(The complement is digital, in which there are only two significant voltages, e.g. zero (or near zero) and 5 volts (or near 5). The presence of other voltages would indicate a fault in the circuit design.... unless it was designed to allow, say, anything below 2.5 to count as zero, the rest to count as 5.)
An ADC will have a number of output pins, in my example, 8 of them. When the input is connected to zero volts, all of the output pins will be connected to zero volts as well. If the input is nearly zero, most of the output pins will be connected to zero, but a few will be connected to 5 volts.... They're never connected to anything other than 0 or 5, though, so we say these pins carry a digital signal. If the input pin is connected to 2.55 volts, then all 8 of the output pins are connected to 5 volts. The pins are equivalent to the digits of a binary number, and the pattern of voltages on them counts as a number. The number will depend on the voltage applied to the input.
If the above wasn't something you mostly already knew, you might want to visit my page explaining analog and digital.
An ADC with 8 outputs can "show" 256 numbers: 0 to 255. You can buy ADCs which encode different voltage ranges, that have a different number of output pins, have different ways of connecting to the computer, etc, etc... each has it's pros and cons.
Why bother? Digital signals are much easier to connect to a computer and to deal with in the computer.
ADCs are useful because there are so many sensors available that turn some physical quantity into an electrical quantity. There are light sensors, temperature sensors, humidity sensors, pressure sensors, etc, etc.
Some sensors change their resistance according to the state of thing they are sensing. For example, suppose you wanted to measure the level of water in a fish tank. You can buy something called a linear potentiometer. It is long and thin, with a rod that will slide in an out of the device, a bit like the handle of a bicycle pump. It has two wires coming out of it. (Three actually, usually, but you can forget one, unless you know all about it, in which case please don't write and complain!) You attach one end of the potentiometer to a fixed point above the fish tank. You attach a weighted float to the end of the slider. If you've got it right, then as the water rises and falls, the slider goes in and out. The further out the slider is, the greater the resistance between the two wires.
Next, you need a fixed voltage, a resistor, a power supply and an ADC (see above, if you haven't met ADCs). Connect the zero volts of the power supply to one end of the resistor. Connect one of the wires of the linear potentiometer to the other wire from the power supply. Connect the other end of the resistor and the other wire from the linear potentiometer and the input of the ADC together. When the slider goes in and out, the computer will "see" different voltages! The following shows much of what you need. Connect the green spot you see below to the ADC, which isn't shown.
I've gone through some of the basic building blocks of sensing. The real fun begins when you bring your imagination to bear to devise ways of detecting the things you need to know about to build the system that you have taken on as your challenge.
There are many sensors available which interface to the PC via 1-Wire chips on MicroLans. Many of them could be adapted to interface via other channels.
A simple ultrasonic distance sensing module is available from Parallax, cost $25. Click here for details. It was designed for use with Basic Stamps, but with 5v, 1 i/o pin, and some work, you could use it in other environments. Range: 2cm to 3.3m. My thanks to a kind reader for bringing this to my attention.
Last, and not at all least... there are keyboards! I am convinced that it wouldn't be hard to interface one to hardware of your own devising, etc. I've written more at my page dedicated to the quest for the right device.
The search engine merely looks for the words you type, so....
* Spell them properly.
* Don't bother with "How do I get rich?" That will merely return pages with "how", "do", "I"....
Please also note that I have two other sites, and that this search will not include them. They have their own search buttons.
My site at Arunet.
My oldest site. (It's at Compuserve).
Ad from page's editor: Yes.. I do enjoy compiling these things for you...
hope they are helpful. However.. this doesn't pay my bills!!! If you find
this stuff useful, (and you run an MS-DOS or Windows PC) please visit my
freeware and shareware page, download something, and circulate it for me?
At least (please) send an 'I liked the parallel port use page, and I'm
from (country/ state)' email? (No... I don't do spam)
Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.
This is just one of the guides I have published on the net. Please visit any of the following that relate to interests you have....
Pascal programming tutorials
Electronics for hobbyists and schools
Main Home Page
Here is how you can contact this page's author, Tom Boyd.
Index of sensing and control pages (From there you can also go to other help from the editor of this page.)
Page WILL BE tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org
-- Page ends --