Introduction: Halls Sensor Using the Linkit One

Picture of Halls Sensor Using the Linkit One

In this instructable I'm going to show you how to work with a Halls sensor using the Linkit One. The halls sensor is a sensor that detects magnetic fields.

Step 1: List of Parts

Picture of List of Parts

  • Linkit One
  • Halls Sensor from Seeed Studio
  • Micro USB Cable

Step 2: Halls Sensor

Picture of Halls Sensor

Connect the signal pin from the halls sensor to the linkit one D7 pin, and connect the vcc to the +5v pin and gnd pin to gnd.

Step 3: Micro USB

Picture of Micro USB

Next you need to connect a micro USB between the Linkit One and your PC, and install the necessary drivers from the Linkit One official site.

Step 4: Code

Use the arduino IDE to upload the code to the board, you need to modify the IDE to make it support the Linkit One board.

<p>#define HALL_SENSOR 7<br>#define LED	14//the Grove - LED is connected to D4 of Arduino
void setup()
void loop() 
	if(isNearMagnet())//if the hall sensor is near the magnet?
void pinsInit()
/*If the hall sensor is near the magnet whose south pole is facing up, */
/*it will return ture, otherwise it will return false.				*/
boolean isNearMagnet()
	int sensorValue = digitalRead(HALL_SENSOR);
	if(sensorValue == LOW)//if the sensor value is LOW?
		return true;//yes,return ture
		return false;//no,return false
void turnOnLED()
void turnOffLED()

Step 5: Run Time

Bring a magnet near the sensor and you should see the on board LED at D13 Light up.


DIY Hacks and How Tos (author)2015-12-20

Cool LinkIt One project.

About This Instructable




More by sridhar96:Halls Sensor Using the Linkit OneLinkit One Getting Started With GPSLinkit One Light Sensor
Add instructable to: