I have worked in computer-controlled robotics and when I saw the Arduino board, which is a small microprocessor with inputs and outputs built onto the board I was excited. If you are not familiar with this type of hobby it is quite rewarding. The experience of what you are doing is seen immediately and it gets your old brain a working.
It has been over twenty years since I have done any prototyping or programming and I hope to be putting out this type of information to help other people who need to have it or keep it simple.
The Arduino board is gaining user ship and you can get the control software online at the Arduino website. The software is free to download and there are other sites that have support and /or projects they have put together with the Arduino board.
There are other boards available which do the same or similar functions but the price on the other boards is higher. I purchased the board I have for $39.00, which included shipping. You can get parts from online websites and buy assortment packages for $2.49 each, which has multiple parts in a bag or you can order the single part you need for the project you are working on.
The program below was written for a wiring board. I revised the program to match the Arduino board pin outs and changed the lines of the program to do the same. The program changes will have the LED on all the time, unless the magnet activates the hall sensor, then the LED will go out until the magnet is moved away. The LED will blink and turns on.
The circuit is attached below on how to connect it to the Arduino board. I am not saying this is the best way but it does work and show you the operation of the circuit. You can copy the program from here and paste it into the Arduino software. You will then have to compile the program, which is done in the program so it is not a big problem. You have to push the compile button and then upload the program to the Arduino board and it will start running the program.
Hall sensor
A hall sensor is a magnetic field sensor, it can detect when a magnet is nearby. This example turns off a light (LED) connected to a digital pin when a magnet is near the Hall sensor
int ledPin = 13; // diagnostic LED on the Ardinuo board
int pinHall = 0; // Pin for the Hall sensor
int pinLed = 3; // Pin for the led that turns off if the magnetic field is near
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
pinMode(pinLed, OUTPUT); // sets the digital pin as output
pinMode(pinHall, INPUT); // sets the digital pin as input
digitalWrite(ledPin, HIGH); //turn on the Wiring board diagnostic LED
}
void loop()
{
if (digitalRead(pinHall) == HIGH) // If a magnet is not near the Hall sensor
{
digitalWrite(pinLed, HIGH); // turns ON the LED
}
else {
digitalWrite(pinLed, LOW); // if magnet is near hall sensor LED turns OFF
}
