KY-003 JOY-IT | Alldatasheet
Document overview
- Manufacturer or author: Provided By alldatasheet.com(free datasheet download site)
- PDF pages: 7
Technical content
Hall Magnetic Field Sensor KY-003
Published: 27.08.2018 Copyright by Joy -IT 2 Hall Magnetic Field Sensor 1. Overview 2. Pin-Assignment 3. Code Example Arduino 4. Code Example Raspberry Pi 5. Information and take-back obligations 6. Support TABLE OF CONTENTS
Published: 27.08.2018 Copyright by Joy -IT 3 Hall Magnetic Field Sensor Dear customer, Thank you for choosing our product. In the following, we will show you what to observe during commissioning and use. Should you encounter any unexpected problems during use, please do not hesitate to contact us. The transistor switches through if the module is held in a magnetic field. This can then be read out at the signal output as an analog voltage value. 1. OVERVIEW Chipset A3141 Sensor Type Hall Effect Transistor/Switch 2. PIN -ASSIGNMENT Pin Assignment Arduino LED + Pin 13 LED - Pin GND Signal Pin 10 +V Pin 5V GND Pin GND Pin Assignment Raspberry Pi Signal GPIO24 [Pin 18] +V 3,3V [Pin 1] GND Masse [Pin 6]
Published: 27.08.2018 Copyright by Joy -IT 4 Hall Magnetic Field Sensor This is an example program that lights up an LED when a signal is detected on the sensor. The KY-011, KY- 016 or KY-029 modules can also be used as LEDs, for example. You can download the code example here, or copy the following example: 3. CODE EXAMPLE ARDUIN O int Led = 13 ;// Declaration of the LED output pin int Sensor = 10; // Declaration of the sensor input pin int val; // Temporary Variable void setup () pinMode (Led, OUTPUT) ; // Initialization of output pin pinMode (Sensor, INPUT) ; // Sensor pin initialization digitalWrite(Sensor, HIGH); // Activation of internal pull-up resistor void loop () val = digitalRead (Sensor) ; // The current signal at the sensor is read out if (val == HIGH) // If a signal could be detected, the LED is switched on. digitalWrite (Led, LOW); else digitalWrite (Led, HIGH);
Published: 27.08.2018 Copyright by Joy -IT 5 Hall Magnetic Field Sensor You can download the code example for Raspberry Pis here or copy and paste the following section. 4. CODE EXAMPLE RASPBE RRY PI # Required modules are imported and set up import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # The input pin to which the sensor is connected is declared here. In additi- on, the PullUP resistor at the input is also activated GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP) print "Sensor-Test [druecken Sie STRG+C, um den Test zu beenden]" # This output function is executed on signal detection def ausgabeFunktion(null): print("Signal erkannt") # When a signal is detected (falling signal edge), the output function is triggered GPIO.add_event_detect(GPIO_PIN, GPIO.FALLING, callback=ausgabeFunktion, bouncetime=100) # main loop try: while True: time.sleep(1) # Cleanup after the program is finished except KeyboardInterrupt: GPIO.cleanup()
Published: 27.08.2018 Copyright by Joy -IT 6 Hall Magnetic Field Sensor Symbol on electrical and electronic equipment This crossed-out dustbin means that electrical and electronic equipment does not belong in household waste. You must return the old devices to a collection point. Before disposal, you must separate old batteries and accumulators which are not enclosed in the old device from it. Return options As an end user, you can dispose of your old device (which essentially fulfils the same function as the new one purchased from us) free of charge when purchasing a new device. Small appliances where no external dimensions are larger than 25 cm can be delivered in normal household quantities, irrespective of the purchase of a new appliance. Possibility of return at our company location during opening hours Simac Ltd, Pascalstr. 8, 47506 Neukirchen-Vluyn, Germany Possibility of return in your area We will send you a parcel stamp with which you can return the device to us free of charge. Please contact us by e-mail at Service@joy-it.net or by phone. Information about packaging If you do not have suitable packaging material or do not wish to use your own, please contact us and we will send you suitable packaging. 5. INFORMATION AND TAK E-BACK OBLIGATIONS
Published: 27.08.2018 Copyright by Joy -IT 7 Hall Magnetic Field Sensor We also support you after your purchase. If there are any questions left or if you encounter any problems, please feel free to contact us by mail, phone or by our ticket-system on our website. E-Mail: service@joy-it.net Ticket-System: http://support.joy-it.net Phone: +49 (0)2845 98469 – 66 (11- 18 o‘clock) For more information, please visit our website: www.joy-it.net 6. SUPPORT