Pages: [1]   Go Down
Author Topic: Using a Hall Effect sensor with an LCD screen (solved)  (Read 452 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using a Parallax Melexis 90217 Hall-Effect Sensor (from Robotshop.com) and a 16x2 alphanumeric LCD (from the Arduino Starter Kit) both work correctly form previous tests. The magnet is a strong Neodymium Magnet.

What I want to do is print HIGH to the LCD when a magnet is present and print LOW when there is no magnet present. It is like a read out whether or not a door is opened or closed (LOW or HIGH).

Right now when the magnet is passed over the sensor it has no effect, the LCD continues to print LOW. The LCD only changes to HIGH when I remove the orange and black wires attached to the hall effect sensor and goes back to LOW when I plug them back in.  My wiring and code is a combination of an LCD tutorial and a Hall Effect tutorial so maybe that’s why it does not work effectively.

Any help on the coding/wiring is greatly appreciated!

Here is a download link of my wiring schematic the same schematic is pictured below:
http://fritzing.org/media/fritzing-repo/projects/l/latch-sensor-hall-effectlcd/fritzing/latch_halleffect_lcd.fzz


* Screen Shot 2014-04-20 at 4.45.16 PM.png (104.34 KB, 656x708 - viewed 32 times.)

* Screen Shot 2014-04-20 at 4.49.23 PM.png (16.53 KB, 288x508 - viewed 26 times.)
« Last Edit: April 21, 2014, 03:41:01 pm by scotthetland » Logged

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 45
Posts: 2469
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need a pull up on the output of the hall sensor. When the sensor switches "on" the output of the hall sensor sinks current (acts like a ground). You need to add a resistor between 5V and the output to set the signal high for when the sensor is not "on" and sinking current.

Melexis recommends a 5.6K resistor (or a 10K would probably be OK) for the pull up between pin 1 and pin 3 of the hall sensor.

If it's not apparent by what I've said above, the sensor will report a "high" signal when no magnet is present and low when the magnet is present.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have 1kOHM, 4.7 kOHM and 10kOHM resistors. The 10kOHM is pictured in the schematic. It seems to have no effect. I’ve tried the other resistors and they all behave the same: no effect.

In other places online I’ve seen that they’ve used resistors for hall effect sensors so I’m pretty sure that is the solution here. Maybe the error is in my code or with my wiring set up?


* Screen Shot 2014-04-20 at 11.19.19 PM.png (114.85 KB, 765x708 - viewed 20 times.)
Logged

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 45
Posts: 2469
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would say that either you've wired the sensor backwards or you've blown it.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes that was the problem, I wired the Hall effect sensor backwards. Thank you problem solved!  smiley smiley
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I also put a 10kOHM resistor between pins 1 and 3 on the Hall effect sensor in-case anyone else is facing a similar problem as me.
Logged

Pages: [1]   Go Up
Jump to: