Hall Effect Switch

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times

Hall Effect Switch

Post by JohnCrow »

Dual Channel Hall Effect Switch Part 1

This simple project is based round the Melexis US1881 Hall Effect switch

It is a simple 3 pin device in a TSOT package (Thin Small Outline Transistor).
The simple connections are
Pin1 = 5V
Pin2 = Out
Pin3 = Ground

Pin 2 has a 10kΩ pull-up resistor to 5V
Each device has its own pull up, unlike for example the I2C bus.
A100nF capacitor is placed across the power rails and a separate 4n7 capacitor decouples each output to ground.

When a magnet is placed near the front side of the device it will change state and latch until the opposite magnetic pole is brought near to the device.

i.e. North pole will cause the device output to go high. It will remain in this state until a magnetic south pole is brought near the device.

Note
Turning off the power will result in the devices resetting to the off state.

The output is read by means of the ADC inputs

The example program uses floating point and displays the output voltage.
Output values will be dependant on the specific device but are approximately:

Off = 0.01 V
On = 0.49 V

The sensors have been placed so they can be switched either independently or simultaneously by placing the magnet between the devices.

The image shown below is using read as Integer on the ADC and not as a float as in the test program.
Hall Sensor Test - Float V1.fcf
(11 KiB) Downloaded 269 times
Full Test System
Full Test System
System.JPG (106.48 KiB) Viewed 4221 times
Dual Channel Hall Sensor
Dual Channel Hall Sensor
Hall Sensor.JPG (98.5 KiB) Viewed 4221 times
1 in 10 people understand binary, the other one doesn't !

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times

Hall Effect Switch Part2

Post by JohnCrow »

This version uses read as INT on the adc input and switchs an LED on / off depending on input

North Pole = LED On
South Pole = LED Off

If a bar magnet is placed in front (or slightly above, the sensors, held with a non magnetic shaft, and rotated the outputs will pulse alternately.
System
System
System2.jpg (89.77 KiB) Viewed 4217 times
Hall Sensor Test - Int V1.fcf
(18 KiB) Downloaded 305 times
1 in 10 people understand binary, the other one doesn't !

Bobw
Posts: 157
Joined: Sat Jan 22, 2011 10:39 pm
Location: Michigan
Has thanked: 6 times
Been thanked: 27 times
Contact:

Re: Hall Effect Switch

Post by Bobw »

John,
Anyway to make it so that it will not latch?
I need a home position sensor, I thought about using a hall sensor, but I know you normally have to reverse the pole of the magnet to reverse the state of the hall sensor.

Bob

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times

Re: Hall Effect Switch

Post by JohnCrow »

Hi Bob

The latching function is built into this device.
You can get non latching sensors just did a quick google and found this one. Looks even simpler to wire up than the one in my circuit.
Non Latch Hall.pdf
(38.88 KiB) Downloaded 353 times
Im sure you will find something suitable
1 in 10 people understand binary, the other one doesn't !

Bobw
Posts: 157
Joined: Sat Jan 22, 2011 10:39 pm
Location: Michigan
Has thanked: 6 times
Been thanked: 27 times
Contact:

Re: Hall Effect Switch

Post by Bobw »

See,
Learn something new everyday, always thought hall sensors were of the latching type.
Will give it a look.
Digikey should love me this month.

Bob

Post Reply