Step 14Input devices
This shows how to control motors, sense the environment and other useful control.
In addition to these cirucits, there are a few that I use over and over again.
Temperature - the LM35 temperature sensor produces a voltage which can go straight into a picaxe and can be read with a readadc or readadc10 command.
Light - a light dependent resistor has a resistance that varies from a few hundred ohms in bright sunlight to over 5 megohms in pitch black. Measure the resistance at the light level you want to switch at and put the LDR in series with a resistor of about the same value. Eg I wanted to detect the lights of a car pulling into the carport to turn on some lights. The resistance was about 1M from indirect light so I put a 1M in series with the LDR.
Switch - some switches switch between 5V and 0V (a single pole double throw switch) but some just turn on and off. If a switch turns on it can send 5V to a picaxe chip but if it is off the picaxe pin would be 'floating' and could be any value. This circuit shows how to pull the input down to ground when the switch is off. This is the circuit to use for most pushbutton switches.
Potentiomter - a good old fashioned knob. Twiddle the knob and read the voltage into the chip.
There are all sorts of other electronic devices that create a voltage from 0-5V or can be easily configured to do so. Examples are magnetic sensors, humidity, speed, touch, infrared light, pressure, colour and sound. Sensors in general cost only a few dollars each.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|



















































