Export: 29.04.2016 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
Dear customer, thank you for purchasing our product. This high quality sensor kit was developed especially for the popular Open-Source platforms. It is compatible to the following single-board computers: Raspberry Pi (all models), Arduino, Banana PI, Cubieboard, Cubietruck, Beaglebone, pcDuino and many more microcontroller-systems (Atmega, MicroChip PIC, STM32 etc.).
Main Page Main Page Click the picture or the description to go to the site of the specific sensor. KY-001 Temperature sensor module KY-002 Vibration-switch module KY-003 Hall Magneticfield-Sensor module Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
Main Page KY-004 Button-module KY-005 Infrared Transmitter module KY-006 Passiv Piezo-Buzzer module KY-009 RGB LED SMD module KY-010 Light barrier-module Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
Main Page KY-011 2-Color (Red+Green) 5mm LED module KY-012 Active Piezo-Buzzer module KY-013 Temperature-Sensor module KY-015 Combi-Sensor Temperature+Humidity KY-016 RGB 5mm LED module Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
Main Page KY-017 Tilt switch module KY-018 Photoresistor module KY-019 5V Relais module KY-020 Tilt switch module KY-021 Mini magnetic Reed module KY-022 Infrared receiver module Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
Main Page KY-023 Joystick module (XY-Axis) KY-024 Linear magnetic Hall sensor KY-025 Reed module KY-026 Flame-sensor module KY-027 Magic light cup module Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
Main Page KY-028 Temperature Sensor module (Thermistor) KY-029 2-Color (Red+Green) 3mm LED module KY-031 Knock-sensor module KY-032 Obstacle-detect module KY-033 Tracking sensor module Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
Main Page KY-034 7 Colour LED flash-module KY-035 Bihor magnetic sensor module KY-036 Metal-touch sensor module KY-037 Microphone sensor module (high sensitivity) KY-038 Microphone sound sensor module KY-039 Heartbeat sensor module Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
Main Page KY-040 Rotary encoder KY-050 Ultrasonic-distance-sensor KY-051 Voltage translator / Level shifter KY-052 Pressure-sensor / Temperature-sensor (BMP280) KY-053 Analog digital converter Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-001 Temperature sensor module KY-001 Temperature sensor module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical Data / Short description ....................................................................................................................... 1 3 Pinout ..............................................................................................
KY-001 Temperature sensor module Pinout Code example Arduino You need 2 additional libraries for the following example: - [OneWire Library] from Paul Stoffregen | published under the MIT license. - [Dallas Temperature Control Library] from Miles Burton | published under LGPL Both libraries are part of the package and needs to be copied into the "Library" folder before starting the Arduino IDE. You can find the path at C:\user\[username]\documents\Arduino\libraries by default.
KY-001 Temperature sensor module void loop() { // temperature measurment will be started... sensors.requestTemperatures(); // ... and measured temperature will be displayed Serial.print("Temperature: "); Serial.print(sensors.getTempCByIndex(0)); Serial.write(176); // UniCode of the char-symbol "°-Symbol" Serial.
KY-001 Temperature sensor module # here you can modify the break between the measurements sleeptime = 1 # the one-wire input pin will be declared and the integrated pullup-resistor will be enabled GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.IN, pull_up_down=GPIO.PUD_UP) # After the enabling of the resistor you have to wait till the communication has started print 'wait for initialisation...' base_dir = '/sys/bus/w1/devices/' while True: try: device_folder = glob.
KY-001 Temperature sensor module KY-001_RPi_TemperatureSensor.zip To start the program use the command: sudo python KY-001_RPi_TemperaturSensor.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-002 Vibration-switch module KY-002 Vibration-switch module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical Data / Short discription ........................................................................................................................ 1 3 Pinout .................................................................................................
KY-002 Vibration-switch module Pinout Code example Arduino This example will activate a LED as soon as the sensor detects a signal. The modules KY-011, KY-016 or KY-029 can be used as a LED.
KY-002 Vibration-switch module Sensor +V = [Pin 5V] Sensor - = [Pin GND] Example program download SensorTest_Arduino Code example for Raspberry Pi # needed modules will be imported import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # The input pin of the Sensor will be declared. The pullup resistor will be activated. GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.
KY-003 Hall Magneticfield-Sensor module KY-003 Hall Magneticfield-Sensor module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical Data / Short description ....................................................................................................................... 1 3 Pinout ................................................................................
KY-003 Hall Magneticfield-Sensor module Pinout Code example Arduino This example will light up a LED as soon as the sensor is near a magnetic field. The module KY-011, KY-016 or KY-029 can be used as a LED.
KY-003 Hall Magneticfield-Sensor module Sensor +V = [Pin 5V] Sensor - = [Pin GND] Example program download: SensorTest_Arduino Code example for Raspberry Pi # needed modules will be imported import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # The input pin of the sensor will be declared. The pull-up resistor will be activated. GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.
KY-004 Button-module KY-004 Button-module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ......................................................................................................................
KY-004 Button-module Pinout Code example Arduino This example will light up a LED after the button is pressed. The module KY-011, KY-016 or KY-029 can be used as a LED.
KY-004 Button-module Sensor +V = [Pin 5V] Sensor - = [Pin GND] Example program download: SensorTest_Arduino Code example Raspberry Pi # needed modules will be imported import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # The input pin of the Sensor will be declared. The pull-up resistor will be activated. GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP) print "Sensor-Test [press ctrl+c to end it]" # This output function will be started at signal detection.
KY-005 Infrared Transmitter module KY-005 Infrared Transmitter module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..........................................................................................
KY-005 Infrared Transmitter module emitted wavelength: 940nm (not visible for the human eye) Pre-resistor: Rf (3,3V) = 120Ω [used with ARM CPU-Core based microcontroller] Rf (5V) = 220Ω [used with Atmel Atmega based microcontroller] Pinout You can directly solder a resistor to the circuit board. In that case, the central pin (2), which includes the resistor, can be used. Code example Arduino With both sensor modules, KY-005 and KY-022, you can build an infrared remote + infrared receiver system.
KY-005 Infrared Transmitter module Code for the receiver: // Arduino-IRremote library will be added #include #include // You can declare the input pin for the signal output of the KY-022 here int RECV_PIN = 11; // Arduino-IRremote library will be initialized IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.
KY-005 Infrared Transmitter module KY-005_KY-022_Infrared-Modules_ARD Connections Arduino 1 [Receiver]: KY-022 Signal = [Pin 11] +V = [Pin 5V] GND = [Pin GND] Connections Arduino 2 [Transmitter]: KY-005 Signal = [Pin 3 (Arduino Uno) | Pin 9 (Arduino Mega)] GND+resistor = [Pin GND*] GND = [Pin GND] * Only if resistor was soldered to the circuit board.
KY-005 Infrared Transmitter module KY-022 Signal = GPI18 [Pin 12] +V = 3,3V [Pin 17] GND = GND [Pin 25] Lirc Installation Open a terminal at the desktop or use SSH to log into your Raspberry Pi. To install lirc, enter the following command: sudo apt-get install lirc -y [For this the Raspberry Pi has to be connected to the internet] To use the lirc module immediately after starting the OS, you have to add the following line to the end of the file "/boot/config.
KY-005 Infrared Transmitter module # /etc/lirc/hardware.conf # # Arguments which will be used when launching lircd LIRCD_ARGS="" #Don't start lircmd even if there seems to be a good config file #START_LIRCMD=false #Don't start irexec, even if a good config file seems to exist. #START_IREXEC=false #Try to load appropriate kernel modules LOAD_MODULES=true # Run "lircd --driver=help" for a list of supported drivers.
KY-005 Infrared Transmitter module pulse space pulse space pulse ... 603 95239 9020 2208 603 You can restart lirc with the following command: sudo /etc/init.d/lirc start Remote teach To register an infrared-remote at the lirc system, you have to configure the file "/etc/lirc"lircd.conf". In this file, all command assignments of the infrared codes are saved. To get a good formatted lircd.conf, use the lirc assistant software which creates the file automatically.
KY-005 Infrared Transmitter module sudo nano ~/MeineFernbedienung.conf Here you have to change the line: name /home/pi/MeineFernbedienung.conf to name MeineFernbedienung Please don't use any spaces or additional characters in the name. You can save and close the file with the key sequence [ctrl+x ---> y ---> enter]. After creating the configuration, you can make a backup for original lircd.conf with the following command: sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd.conf.
KY-005 Infrared Transmitter module which assigments are available for the remote. Now we can send the command [KEY_0] with the command: irsend SEND_ONCE MeineFernbedienung KEY_0 You can have the example above in other variations like , instead of sending the signal only once , it will be send multiple times. irsend SEND_START MeineFernbedienung KEY_0 After this, the code [KEY_0] will be repeatly send out until we end it with the following command: irsend SEND_STOP MeineFernbedienung KEY_0 Export: 16.06.
KY-006 Passiv Piezo-Buzzer module KY-006 Passiv Piezo-Buzzer module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ............................................................................................
KY-006 Passiv Piezo-Buzzer module Pinout Code example Arduino This is an example program which will start an alarm signal on the buzzer via square wave voltage. int buzzer = 8 ; // Declaration of the buzzer-output pin void setup () { pinMode (buzzer, OUTPUT) ;// Initialization of the output pin. } void loop () { unsigned char i; while (1) { // The buzzer will be controlled by 2 different frequencies in this program. // The signal is a square wave signal.
KY-006 Passiv Piezo-Buzzer module Connections Arduino: Sensor signal = [Pin 8] Sensor - = [Pin GND] Example program download KY-006_Buzzer Code example Raspberry Pi This example program uses software-PWM, to generate a square wave with defined frequency. The buzzer will generate a sound which is nearly the sound of the square wave frequency. #Needed modules will be imported and configured. import RPi.GPIO as GPIO GPIO.setmode(GPIO.
KY-009 RGB LED SMD module KY-009 RGB LED SMD module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ............................................................................................................
KY-009 RGB LED SMD module Rf (3,3V) [Green]= 100Ω Rf (3,3V) [Red]= 180Ω Rf (3,3V) [Blue]= 100Ω [for example using of ARM CPU-Core based microcontroller like Raspberry-Pi] Rf (5V) [Green] = 100Ω Rf (5V) [Red] = 180Ω Rf (5V) [Blue] = 100Ω [for example using of Atmel Atmega based microcontroller like Arduino] Pinout Code example Arduino Code example ON/OFF In this example you will see how the LEDs will be switched on with a defined output pin, in a 3 second clock pulse.
KY-009 RGB LED SMD module digitalWrite (Led_Green, LOW); // LED will be switched off digitalWrite (Led_Blue, LOW); // LED will be switched off delay (3000); // Waitmode for 3 seconds digitalWrite (Led_Red, LOW); // LED will be switched off digitalWrite (Led_Green, HIGH); // LED will be switched on digitalWrite (Led_Blue, LOW); // LED will be switched off delay (3000); // Waitmode for another 3 seconds in which the LED status will be shifted.
KY-009 RGB LED SMD module Example program PWM download: KY-009_LED_PWM Connections Arduino: LED Red = [Pin 10] LED Green = [Pin 11] LED Blue = [Pin 12] Sensor GND = [Pin GND] Code example Raspberry Pi Code example ON/OFF In this example you will see how the LEDs will be switched on with a defined output pin, in a 3 second clock pulse. # Needed modules will be imported and configured. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.
KY-009 RGB LED SMD module Example program ON/OFF download KY009_RPi_ON-OFF To start, enter the command: sudo python KY009_RPI_ON-OFF.py Code example PWM You can regulate the brightness of the LEDs via pulse-width modulation. The LEDs will be switched ON and OFF for specific time periods, in which the relation between ON and OFF leads to a relative brightness, because of the Inertia of the human eyesight, the human eye interprets the ON/OFF as a brightness change.
KY-009 RGB LED SMD module try: while True: for x in range(0,2): for y in range(0,2): for z in range(0,2): print (x,y,z) for i in range(0,101): LED_color((x*i),(y*i),(z*i),.02) # Scavenging work after the end of the program. except KeyboardInterrupt: GPIO.cleanup() Example program PWM download: KY-009_RPi_PWM To start, enter the command: sudo python KY-009_RPi_PWM.py Connections Raspberry Pi: LED Red = GPIO6 [Pin 22] LED Green = GPIO5 [Pin 18] LED Blue = GPIO4 [Pin 16] Sensor GND = GND Export: 16.
KY-010 Light barrier-module KY-010 Light barrier-module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ........................................................................................................
KY-010 Light barrier-module Pinout Code example Arduino In this program, a LED will flash up, if a signal was detected at the sensor. You can also use the modules KY011, KY-016 or KY-029 as LEDs.
KY-010 Light barrier-module Example program download SensorTest_Arduino_inverted Code example Raspberry Pi # Needed modules will be imported and configured import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # The input pin which is connected with the sensor. GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.
KY-011 2-Color (Red+Green) 5mm LED module KY-011 2-Color (Red+Green) 5mm LED module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ............................................................................
KY-011 2-Color (Red+Green) 5mm LED module Rf (3,3V) [Green]= 120Ω Rf (3,3V) [Red]= 120Ω [for example using ARM CPU-Core based microcontroller like Raspbarry Pi] Rf (5V) [Green] = 220Ω Rf (5V) [Red] = 220Ω [for example using Atmel Atmega based microcontroller like Arduino] Pinout Code example Arduino Code example ON/OFF int Led_Red = 10; int Led_Green = 11; void setup () { // Output pin initialization for the LEDs pinMode (Led_Red, OUTPUT); pinMode (Led_Green, OUTPUT); } void loop () //Main program loop
KY-011 2-Color (Red+Green) 5mm LED module Example program ON/OFF download: KY-011_LED_ON-OFF Code example PWM You can regulate the brightness of the LEDs via pulse-width modulation. The LEDs will be switched ON and OFF for specific time periods, in which the relation between ON and OFF leads to a relative brightness, because of the Inertia of the human eyesight, the human eye interprets the ON/OFF as a brightness change. For more information to that theme visit: [Artikel von mikrokontroller.
KY-011 2-Color (Red+Green) 5mm LED module # Needed modules will be imported and configured. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # Output pin declaration for the LEDs. LED_Red = 5 LED_Green = 4 GPIO.setup(LED_Red, GPIO.OUT, initial= GPIO.LOW) GPIO.setup(LED_Green, GPIO.OUT, initial= GPIO.LOW) print "LED-Test [press ctrl+c to end the test]" # Main program loop try: while True: print("LED Red will be on for 3 seconds") GPIO.output(LED_Red,GPIO.HIGH) #LED will be switched on GPIO.
KY-011 2-Color (Red+Green) 5mm LED module GPIO.setup(LED_Red, GPIO.OUT) GPIO.setup(LED_Green, GPIO.OUT) Freq = 100 #Hz # The specific colors will be initialized. RED = GPIO.PWM(LED_Red, Freq) GREEN = GPIO.PWM(LED_Green, Freq) RED.start(0) GREEN.start(0) # # # # This function generate the actually color You can change the color with the specific color variable. After the configuration of the color is finished, you will time.sleep to configure how long the specific will be displayed.
KY-012 Active Piezo-Buzzer module KY-012 Active Piezo-Buzzer module Contents 1 Pictures ................................................................................................................................................................ 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ............................................................................................
KY-012 Active Piezo-Buzzer module Pinout Code example Arduino In this example, you will see how the buzzer will be ON for 4 seconds and then will be OFF for 2 seconds.
KY-012 Active Piezo-Buzzer module import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # Output pin declaration for the Buzzer. Buzzer_PIN = 24 GPIO.setup(Buzzer_PIN, GPIO.OUT, initial= GPIO.LOW) print ("Buzzer-test [press ctrl+c to end the test]") # Main program loop try: while True: print("Buzzer will be on for 4 seconds") GPIO.output(Buzzer_PIN,GPIO.HIGH) #Buzzer will be switched on time.sleep(4) #Waitmode for 4 seconds print("Buzzer wil be off for 4 seconds") GPIO.output(Buzzer_PIN,GPIO.
KY-013 Temperature-Sensor module KY-013 Temperature-Sensor module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..............................................................................................
KY-013 Temperature-Sensor module You can draw near to the resistant change via maths and convert it into a linear course. With that you can determine the temperature coefficient (addicted from resistant change to temperature change). With that you can determine the actual temperature if you know the current resistance. This resistor can be determinded via voltage devider, where a known voltage splits up between a known resistor and an unknown (variable) resistor.
KY-013 Temperature-Sensor module Pinout Code example Arduino The program measures the actual voltage from the NTC, calculate the temperature and translates the result to °C for the serial output. #include int sensorPin = A5; // Declaration of the input pin // These function translates the recorded analog measurement double Thermistor(int RawADC) { double Temp; Temp = log(10000.0 * ((1024.0 / RawADC - 1))); Temp = 1 /(0.001129148 + (0.000234125 + (0.
KY-013 Temperature-Sensor module void setup() { Serial.begin(9600); } // The program measures the current voltage value on the NTC // and translates it intp °C for the serial output void loop() { int readVal = analogRead(sensorPin); double temp = Thermistor(readVal); // Output on the serial interface Serial.print("Current temperature is:"); Serial.print(temp); Serial.print(char(186)); //Output <°> Symbol Serial.println("C"); Serial.
KY-013 Temperature-Sensor module ### ### ### ### ### ### Copyright by Joy-IT Published under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License Commercial use only after permission is requested and granted KY-053 Analog Digital Converter - Raspberry Pi Python Code Example # This code is using the ADS1115 and the I2C Python Library for Raspberry Pi # This was published on the following link under the BSD license # [https://github.
KY-013 Temperature-Sensor module # # # # ######## Main Loop ######## Reading the values from the input pins and print to console try: while True: #read temp0 temp1 temp2 temp3 voltage-value and calculate temperature = round(calcTemp(adc.readADCSingleEnded(adc_channel_0, = round(calcTemp(adc.readADCSingleEnded(adc_channel_1, = round(calcTemp(adc.readADCSingleEnded(adc_channel_2, = round(calcTemp(adc.
KY-015 Combi-Sensor Temperature+Humidity KY-015 Combi-Sensor Temperature+Humidity Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..............................................................................
KY-015 Combi-Sensor Temperature+Humidity Pinout Software example Arduino This sensor is not sending it's measurements analog. The measured data is transferred digital. The best way to use this sensor is with the Adafruit_DHT library from the company Adafruit which is published under the following Link under the OpenSource MIT-Lizenz.
KY-015 Combi-Sensor Temperature+Humidity // Two second break between measurements delay(2000); // Measurement of humidity float h = dht.readHumidity(); // Measurement of temperature float t = dht.readTemperature(); // The measurements will be tested of errors here // If an error is detected, an error message will be displayed if (isnan(h) || isnan(t)) { Serial.println("Error while reading the sensor"); return; } } // Output at the serial console Serial.
KY-015 Combi-Sensor Temperature+Humidity You can download and unzip the current version of the library with the command... git clone https://github.com/adafruit/Adafruit_Python_DHT.git After that you need to enter the downloaded folder with... cd Adafruit_Python_DHT/ ... and install the library with ... sudo python setup.py install In order that the Raspberry Pi can communicate with the sensor via I2C-bus, you have to activate the I2C function from the Raspberry Pi.
KY-015 Combi-Sensor Temperature+Humidity try: while(1): # Measurement will be started and the result will be written into the variables humid, temper = Adafruit_DHT.read_retry(DHTSensor, GPIO_Pin) print("-----------------------------------------------------------------") if humid is not None and temper is not None: # The result will be shown at the console print('temperature = {0:0.1f}°C | rel. humidity = {1:0.1f}%'.
KY-016 RGB 5mm LED module KY-016 RGB 5mm LED module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ............................................................................................................
KY-016 RGB 5mm LED module Rf (3,3V) [Green]= 100Ω Rf (3,3V) [Red]= 180Ω Rf (3,3V) [Blue]= 100Ω [e.g. by using with ARM CPU-core based microcontroller like Raspberry-Pi] Rf (5V) [Green] = 100Ω Rf (5V) [Red] = 180Ω Rf (5V) [Blue] = 100Ω [e.g. by using with Atmel Atmega based mocrocontroller like Arduino] Pinout Code example Arduino Code example ON/OFF In this example you will see how the LED is turned on by an output pin, in a 3 second clock pulse.
KY-016 RGB 5mm LED module digitalWrite (Led_Rot, LOW); // LED will be switched OFF digitalWrite (Led_Gruen, HIGH); // LED wwill be switched ON digitalWrite (Led_Blau, LOW); // LED will be switched OFF delay (3000); // Waitmode for another 3 seconds in which the LEDs will be shifted.
KY-016 RGB 5mm LED module KY-016_PWM.zip Connections Arduino: LED Red = [Pin 10] LED Green = [Pin 11] LED Blue = [Pin 12] Sensor GND = [Pin GND] Code example Raspberry Pi Code example ON/OFF In this example you will see how the LED is turned on by an output pin, in a 3 second clock pulse. # Needed modules will be imported import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # The output pins will be declared, which are connected with the LEDs. LED_RED = 6 LED_GREEN = 5 LED_BLUE = 4 GPIO.
KY-016 RGB 5mm LED module sudo python KY016_RPI_ON-OFF.py Code example PWM You can regulate the brightness of the LEDs via pulse-width modulation. The LEDs will be switched ON and OFF for specific time periods, in which the relation between ON and OFF leads to a relative brightness, because of the Inertia of the human eyesight, the human eye interprets the ON/OFF as a brightness change. For more information to that theme visit: [Artikel von mikrokontroller.net].
KY-016 RGB 5mm LED module for y in range(0,2): for z in range(0,2): print (x,y,z) for i in range(0,101): LED_color((x*i),(y*i),(z*i),.02) # Scavenging work after the end of the program except KeyboardInterrupt: GPIO.cleanup() Example program PWM download: KY-016_RPi_PWM.zip To start, enter the command: sudo python KY-016_RPi_PWM.py Connections Raspberry Pi: LED Red = GPIO6 [Pin 22] LED Green = GPIO5 [Pin 18] LED Blue = GPIO4 [Pin 16] Sensor GND = GND Export: 16.06.
KY-017 Tilt switch module KY-017 Tilt switch module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ............................................................................................................
KY-017 Tilt switch module Pinout Code example Arduino This example will light up a LED as soon as the tilt module is in the right angle. The modules KY-011, KY-016 or KY-029 can be used as LED.
KY-017 Tilt switch module Sensor - = [Pin GND] Example program download SensorTest_Arduino_withoutPullUP Code example Raspberry Pi # Needed modules will be imported. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # The input pin of the Sensor will be declared. The pullup resistor will be activated GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.
KY-018 Photoresistor module KY-018 Photoresistor module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ........................................................................................................
KY-018 Photoresistor module Pinout Code example Arduino The example will measure the current sensors voltage and calculates the current resisitance of the sensor. int sensorPin = A5; // Declaration of the input pin // Serial output in 9600 Baud void setup() { Serial.begin(9600); } // The program measures the current voltage at the sensor , // takes the value of the known resistor and calculates the current resistance of the sensor. // After that it show the result via serial output.
KY-018 Photoresistor module Example program download Single_Analog_Sensor Code example Raspberry Pi !! Attention !! Analog Sensor !! Attention !! Unlike the Arduino, the Raspberry Pi doesn't provide an ADC (Analog Digital Converter) on its Chip. This limits the Raspbery Pi if you want to use a non digital Sensor. To evade this, use our Sensorkit X40 with the KY-053 module, which provides a 16 Bit ADC, which can be used with the Raspberry Pi, to upgrade it with 4 additional analog input pins.
KY-018 Photoresistor module ADS1015 = 0x00 ADS1115 = 0x01 # 12-bit ADC # 16-bit # choosing the gain = 4096 # # gain = 2048 # gain = 1024 # gain = 512 # gain = 256 amplifing gain +/- 4.096V # +/- 2.048V # +/- 1.024V # +/- 0.512V # +/- 0.
KY-018 Photoresistor module Analog Signal = Analog 0 [Pin A0 (ADS1115 - KY-053)] ADS1115 - KY-053: VDD = 3,3V [Pin 17] GND = GND [Pin 09] SCL = GPIO03 / SCL [Pin 05] SDA = GPIO02 / SDA [Pin 03] A0 = look above [Sensor: analog signal] Example program download KY-053_RPi_AnalogDigitalConverter To start, enter the command: sudo python RPi_Single_Analog_Sensor.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-019 5V Relais module KY-019 5V Relais module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ................................................................................................................
KY-019 5V Relais module - The first one is tagged with NC for "normally closed" which means that it's connected through by default. - The second one is tagged with NO for "normally open" wich means it's not connected through by default. To switch both, you need a signal. Pinout Code example Arduino The program imitates a direction indicator - it switchs the status of the output terminals in a specific time period (delayTime).
KY-019 5V Relais module // The program imitates a direction indicator void loop () { digitalWrite (relay, HIGH); // "NO" is now connected through delay (delayTime * 1000); digitalWrite (relay, LOW); // "NC" is now connected through delay (delayTime * 1000); } Connections Arduino: Sensor - = [Pin GND] Sensor + = [Pin 5V] Sensor Signal = [Pin 10] Example program download KY-019_Relais Code example Raspberry Pi The program imitates a direction indicator - it switchs the status of the output terminals in
KY-019 5V Relais module Example program download KY-019_RPi_Relais To start, enter the command: sudo python KY-019_RPi_Relais.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-020 Tilt switch module KY-020 Tilt switch module Contents 1 Pircture ................................................................................................................................................................ 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ............................................................................................................
KY-020 Tilt switch module Pinout Code example Arduino This example will light up a LED after a sensor detected a signal. the modules KY-011, KY-016 or KY-029 could be used as LED too for example.
KY-020 Tilt switch module Sensor - = [Pin GND] Example program download SensorTest_Arduino_withoutPullUP Code example Raspberry Pi # Needed modules will be imported and configured import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # Declaration of the input pin which is connected with the sensor. GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN) print "Sensor-test [press ctrl+c to end]" # This outFunction will be started at signal detection.
KY-021 Mini magnetic Reed module KY-021 Mini magnetic Reed module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..............................................................................................
KY-021 Mini magnetic Reed module Pinout Code example Arduino This example will activate a LED if the sensor is close to a magnetic field. The modules KY-011, KY-016 or KY-029 can be used as a LED. int Led = 13 ;// Declaration of the LED output pin.
KY-021 Mini magnetic Reed module Sensor - = [Pin GND] Example program download SensorTest_Arduino_withoutPullUP Code example Raspberry Pi # Needed modules will be imported and configured import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # Declaration of the input pin which is connected with the sensor. GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN) print "Sensor-test [press ctrl+c to end]" # This outFunction will be started after a signal was detected.
KY-022 Infrared receiver module KY-022 Infrared receiver module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ................................................................................................
KY-022 Infrared receiver module Pinout Code example Arduino With both sensor modules, KY-005 and KY-022, you can build an infrared remote + infrared receiver system. In order to do this, you will need the two sensor modules as well as two Arduinos. The first one will handle the receiver system and the second one will handle the transmitter system.
KY-022 Infrared receiver module void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Infrared receiver will start } // main program loop void loop() { } // It will be checked if the receiver has gotten a signal. if (irrecv.decode(&results)) { //At signal input, the received and decoded signal will show via serial console. Serial.println(results.value, HEX); irrecv.resume(); } Code for the transmitter: //Arduino-IRremote library will be added #include #include //...
KY-022 Infrared receiver module Connections Arduino 2 [Transmitter]: KY-005 Signal = [Pin 3 (Arduino Uno) | Pin 9 (Arduino Mega)] GND+resistor = [Pin GND*] GND = [Pin GND] * Only if resistor was soldered to the circuit board. Code example Raspberry Pi Code example remote Because of its progressive processor architecture, the Raspberry Pi has a big advantage, compared to the Arduino. It can run a full Linux OS.
KY-022 Infrared receiver module sudo apt-get install lirc -y [For this the Raspberry Pi has to be connected to the internet] To use the lirc module immediately after starting the OS, you have to add the following line to the end of the file "/boot/config.txt": dtoverlay=lirc-rpi,gpio_in_pin=18,gpio_out_pin=17,gpio_in_pull=up The "gpio_in_pin=18" will be defined as an input pin of the IR-receiver and the "gpio_out_pin=17" as an output pin of the IR-transmitter.
KY-022 Infrared receiver module # Run "lircd --driver=help" for a list of supported drivers. DRIVER="default" # usually /dev/lirc0 is the correct setting for systems using udev DEVICE="/dev/lirc0" MODULES="lirc_rpi" # Default configuration files for your hardware if any LIRCD_CONF="" LIRCMD_CONF="" After that we reboot the Raspberry Pi with the following command: sudo reboot IR-Receiver Test To test the connected receiver, you have to close lirc first with the following command: sudo /etc/init.
KY-022 Infrared receiver module In this file, all command assignments of the infrared codes are saved. To get a good formatted lircd.conf, use the lirc assistant software which creates the file automatically. To start this process you have to stop lirc first by using the command: sudo /etc/init.d/lirc stop With the following command, we can start the assistant: irrecord -d /dev/lirc0 ~/MeineFernbedienung.
KY-022 Infrared receiver module You can save and close the file with the key sequence [ctrl+x ---> y ---> enter]. After creating the configuration, you can make a backup for original lircd.conf with the following command: sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd.conf.bak With the command sudo cp ~/MeineFernbedienung.conf /etc/lirc/lircd.conf you can use the before created file for the lirc system. Now you can start the lirc system again with the command: sudo /etc/init.
KY-022 Infrared receiver module irsend SEND_START MeineFernbedienung KEY_0 After this, the code [KEY_0] will be repeatly send out until we end it with the following command: irsend SEND_STOP MeineFernbedienung KEY_0 Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-023 Joystick module (XY-Axis) KY-023 Joystick module (XY-Axis) Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..............................................................................................
KY-023 Joystick module (XY-Axis) In the non-operating mode, the potentiometer is in the middle so that resistor1=resistor2, so that the voltage will equally split to both resistors - e.g. Measurement of +V=5V -> 2,5V. If one of the axis changes, like the x-axis for example, the values of the resistors will change - e.g. value of resistor 1 will raise than the value of resistor 2 will fall or the value of resistor 1 will fall and the value of resistor 2 will raise.
KY-023 Joystick module (XY-Axis) Code example Arduino This program measures the value at the input pins, converts them into a voltage value (0-1023 -> 0V-5V) and prints these at the serial ouput.
KY-023 Joystick module (XY-Axis) Example program download: KY-023_Joystick_Modul Code example Raspberry Pi !! Attention !! Analog Sensor !! Attention !! Unlike the Arduino, the Raspberry Pi doesn't provide an ADC (Analog Digital Converter) on its Chip. This limits the Raspbery Pi if you want to use a non digital Sensor. To evade this, use our Sensorkit X40 with the KY-053 module, which provides a 16 Bit ADC, which can be used with the Raspberry Pi, to upgrade it with 4 additional analog input pins.
KY-023 Joystick module (XY-Axis) # choosing the gain = 4096 # # gain = 2048 # gain = 1024 # gain = 512 # gain = 256 amplifing gain +/- 4.096V # +/- 2.048V # +/- 1.024V # +/- 0.512V # +/- 0.
KY-023 Joystick module (XY-Axis) X-position = Analog 0 [Pin A0 (ADS1115 - KY-053)] +V = 3,3V [Pin 1 (RPi)] GND = GND [Pin 6 (RPi)] ADS1115 - KY-053: VDD = 3,3V [Pin 01] GND = GND [Pin 09] SCL = GPIO03 / SCL [Pin 05 (RPi)] SDA = GPIO02 / SDA [Pin 03 (RPi)] A0 = look above [Sensor: X-position (KY-023)] A1 = look above [Sensor: Y-position (KY-023)] Example program download KY-023_Joystick_RPi To start, enter the command: sudo python KY-023_Joystick_RPi.py Export: 16.06.
KY-024 Linear magnetic Hall Sensor KY-024 Linear magnetic Hall Sensor Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..........................................................................................
KY-024 Linear magnetic Hall Sensor LED2: Shows that the sensor detects a magnetic field Pinout Functionality of the sensor The sensor has 3 main components on its circuit board. First, the sensor unit at the front of the module which measures the area physically and sends an analog signal to the second unit, the amplifier. The amplifier amplifies the signal, according to the resistant value of the potentiometer, and sends the signal to the analog output of the module.
KY-024 Linear magnetic Hall Sensor This sensor doesn't show absolute values (like exact temperature in °C or magneticfield strenght in mT). It is a relative measurement: you define an extreme value to a given normal environment situation and a signal will be send if the measurement exceeds the extreme value. It is perfect for temperature control (KY-028), proximity switch (KY-024, KY-025, KY-036), detecting alarms (KY-037, KY-038) or rotary encoder (KY-026).
KY-024 Linear magnetic Hall Sensor pinMode (Digital_Eingang, INPUT); } Serial.begin (9600); // Serielle output with 9600 bps // The program reads the current value of the input pins // and output it via serial out void loop () { float Analog; int Digital; // Current value will be read and converted to the voltage Analog = analogRead (Analog_Eingang) * (5.0 / 1023.0); Digital = digitalRead (Digital_Eingang); // and outputted here Serial.print ("Analog voltage value:"); Serial.print (Analog, 4); Serial.
KY-024 Linear magnetic Hall Sensor !! Attention !! Analog Sensor !! Attention !! The program uses the specific ADS1x15 and I2C python-libraries from the company Adafruit to control the ADS1115 ADC. You can find these here: [https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code] published under the BSD-License [Link]. You can find the needed libraries in the lower download package. The program reads the current values of the input pins and outputs it at the terminal in [mV].
KY-024 Linear magnetic Hall Sensor adc_channel_3 = 3 # Channel 3 # initialise ADC (ADS1115) adc = ADS1x15(ic=ADS1115) # Input pin for the digital signal will be picked here Digital_PIN = 24 GPIO.setup(Digital_PIN, GPIO.IN, pull_up_down = GPIO.
KY-024 Linear magnetic Hall Sensor sudo python RPi_AnalogSensor.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-025 Reed module KY-025 Reed module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..........................................................................................................................
KY-025 Reed module Because of that we will get an electrical connection and send the signal. Digital Out: After detecting a magnetic field, a signal will be outputted Analog Out: Direct measurement of the sensor unit LED1: Shows that the sensor is connected with power LED2: Shows that the sensor detects a magnetic field Pinout Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-025 Reed module Functionality of the sensor The sensor has 3 main components on its circuit board. First, the sensor unit at the front of the module which measures the area physically and sends an analog signal to the second unit, the amplifier. The amplifier amplifies the signal, according to the resistant value of the potentiometer, and sends the signal to the analog output of the module.
KY-025 Reed module It is perfect for temperature control (KY-028), proximity switch (KY-024, KY-025, KY-036), detecting alarms (KY-037, KY-038) or rotary encoder (KY-026). Code example Arduino The program reads the current voltage value which will be measured at the output pin and shows it via serial interface. Additionally, the status of the digital pin will be shown at the terminal.
KY-025 Reed module Example program download Analoger_Sensor Code example Raspberry Pi !! Attention !! Analog Sensor !! Attention !! Unlike the Arduino, the Raspberry Pi doesn't provide an ADC (Analog Digital Converter) on its Chip. This limits the Raspbery Pi if you want to use a non digital Sensor. To evade this, use our Sensorkit X40 with the KY-053 module, which provides a 16 Bit ADC, which can be used with the Raspberry Pi, to upgrade it with 4 additional analog input pins.
KY-025 Reed module ADS1015 = 0x00 ADS1115 = 0x01 # 12-bit ADC # 16-bit # choosing the gain = 4096 # # gain = 2048 # gain = 1024 # gain = 512 # gain = 256 amplifing gain +/- 4.096V # +/- 2.048V # +/- 1.024V # +/- 0.512V # +/- 0.
KY-025 Reed module +V = 3,3V [Pin 1 (RPi)] GND = GND [Pin 06 (RPi)] analog signal = Analog 0 [Pin A0 (ADS1115 - KY-053)] ADS1115 - KY-053: VDD = 3,3V [Pin 01] GND = GND [Pin 09] SCL = GPIO03 / SCL [Pin 05] SDA = GPIO02 / SDA [Pin 03] A0 = look above [Sensor: analog signal] Example program download KY-025_Reed_module_RPi To start, enter the command: sudo python KY-025_Reed_module_RPi.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-026 Flame-sensor module KY-026 Flame-sensor module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..........................................................................................................
KY-026 Flame-sensor module Pinout Functionality of the sensor The sensor has 3 main components on its circuit board. First, the sensor unit at the front of the module which measures the area physically and sends an analog signal to the second unit, the amplifier. The amplifier amplifies the signal, according to the resistant value of the potentiometer, and sends the signal to the analog output of the module.
KY-026 Flame-sensor module This sensor doesn't show absolute values (like exact temperature in °C or magneticfield strenght in mT). It is a relative measurement: you define an extreme value to a given normal environment situation and a signal will be send if the measurement exceeds the extreme value. It is perfect for temperature control (KY-028), proximity switch (KY-024, KY-025, KY-036), detecting alarms (KY-037, KY-038) or rotary encoder (KY-026).
KY-026 Flame-sensor module Additionally, the status of the digital pin will be shown at the terminal which means if the extreme value was exceeded or not. // Declaration and initialization of the input pins int Analog_Eingang = A0; // X-axis-signal int Digital_Eingang = 3; // Button void setup () { pinMode (Analog_Eingang, INPUT); pinMode (Digital_Eingang, INPUT); } Serial.
KY-026 Flame-sensor module Unlike the Arduino, the Raspberry Pi doesn't provide an ADC (Analog Digital Converter) on its Chip. This limits the Raspbery Pi if you want to use a non digital Sensor. To evade this, use our Sensorkit X40 with the KY-053 module, which provides a 16 Bit ADC, which can be used with the Raspberry Pi, to upgrade it with 4 additional analog input pins. This module is connected via I2C to the Raspberry Pi.
KY-026 Flame-sensor module # sps # sps # sps sps = # sps # sps # sps # sps = 8 = 16 = 32 64 # = 128 = 250 = 475 = 860 # 8 Samples per second # 16 Samples per second # 32 Samples per second 64 Samples per second # 128 Samples per second # 250 Samples per second # 475 Samples per second # 860 Samples per second # assigning the adc_channel_0 = adc_channel_1 = adc_channel_2 = adc_channel_3 = ADC-Channel (1-4) 0 # Channel 0 1 # Channel 1 2 # Channel 2 3 # Channel 3 # initialise ADC (ADS1115) adc = ADS1x15(i
KY-026 Flame-sensor module SCL = GPIO03 / SCL [Pin 05] SDA = GPIO02 / SDA [Pin 03] A0 = look above [Sensor: analog signal] Example program download KY-026_Flame-sensor_RPi To start, enter the command: sudo python KY-026_Flame-sensor_RPir.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-027 Magic light cup module KY-027 Magic light cup module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ....................................................................................................
KY-027 Magic light cup module [used with Atmel Atmega based microcontroller like Arduino] Pinout Code example Arduino 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 output pin pinMode (Sensor, INPUT) ; // Initialization sensor pin digitalWrite(Sensor, HIGH); // Activating of the internal pull-up resistor } void loop () { val = digitalRead (Sensor) ; // The cu
KY-027 Magic light cup module Example program download SensorTest_Arduino Code example Raspberry Pi # Needed modules will be imported and configured. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # Declaration of the LED and sensor pins LED_PIN = 24 Sensor_PIN = 23 GPIO.setup(Sensor_PIN, GPIO.IN) GPIO.setup(LED_PIN, GPIO.OUT) print "Sensor-test [press ctrl+c to end the test]" # This output function will be started at signal detection def ausgabeFunktion(null): GPIO.
KY-028 Temperature Sensor module (Thermistor) KY-028 Temperature Sensor module (Thermistor) Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ....................................................................
KY-028 Temperature Sensor module (Thermistor) Pinout Functionality of the sensor The sensor has 3 main components on its circuit board. First, the sensor unit at the front of the module which measures the area physically and sends an analog signal to the second unit, the amplifier. The amplifier amplifies the signal, according to the resistant value of the potentiometer, and sends the signal to the analog output of the module.
KY-028 Temperature Sensor module (Thermistor) This sensor doesn't show absolute values (like exact temperature in °C or magneticfield strenght in mT). It is a relative measurement: you define an extreme value to a given normal environment situation and a signal will be send if the measurement exceeds the extreme value. It is perfect for temperature control (KY-028), proximity switch (KY-024, KY-025, KY-036), detecting alarms (KY-037, KY-038) or rotary encoder (KY-026).
KY-028 Temperature Sensor module (Thermistor) pinMode (Analog_Eingang, INPUT); pinMode (Digital_Eingang, INPUT); } Serial.begin (9600); // serial output with 9600 bps // The program reads the current values at the input pins // and outputs them at the serial output void loop () { float Analog; int Digital; // Current values will be read and converted to voltage Analog = analogRead (Analog_Eingang) * (5.0 / 1023.0); Digital = digitalRead (Digital_Eingang); //... and outputted here Serial.
KY-028 Temperature Sensor module (Thermistor) !! Attention !! Analog Sensor !! Attention !! The program uses the specific ADS1x15 and I2C python-libraries from the company Adafruit to control the ADS1115 ADC. You can find these here: [https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code] published under the BSD-License [Link]. You can find the needed libraries in the lower download package. The program reads the current values of the input pins and outputs it at the terminal in [mV].
KY-028 Temperature Sensor module (Thermistor) # initialise ADC (ADS1115) adc = ADS1x15(ic=ADS1115) # Input pin for the digital signal will be picked here Digital_PIN = 24 GPIO.setup(Digital_PIN, GPIO.IN, pull_up_down = GPIO.
KY-028 Temperature Sensor module (Thermistor) sudo python KY-028_Temperature-sensor-module_RPi.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-029 2-Color (Red+Green) 3mm LED module KY-029 2-Color (Red+Green) 3mm LED module Contents 1 Pircture ................................................................................................................................................................ 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ............................................................................
KY-029 2-Color (Red+Green) 3mm LED module Pinout Code example Arduino Code example ON/OFF This example shows how you can switch the LEDs on and off in a 3 seconds time period via defined output pin.
KY-029 2-Color (Red+Green) 3mm LED module You can regulate the brightness of the LEDs via pulse-width modulation. The LEDs will be switched ON and OFF for specific time periods, in which the relation between ON and OFF leads to a relative brightness, because of the Inertia of the human eyesight, the human eye interprets the ON/OFF as a brightness change. For more information to that theme visit: [Artikel von mikrokontroller.net].
KY-029 2-Color (Red+Green) 3mm LED module GPIO.setmode(GPIO.BCM) # The output pins will be declared, which are connected with the LEDs. LED_RED = 5 LED_GREEN = 4 GPIO.setup(LED_RED, GPIO.OUT, initial= GPIO.LOW) GPIO.setup(LED_GREEN, GPIO.OUT, initial= GPIO.LOW) print "LED-Test [press ctrl+c to end]" # main program loop try: while True: print("LED RED is on for 3 seconds") GPIO.output(LED_ROT,GPIO.HIGH) #LED will be switched on GPIO.output(LED_GRUEN,GPIO.LOW) #LED will be switched off time.
KY-029 2-Color (Red+Green) 3mm LED module Freq = 100 #Hz # The different colors will be initialized. RED = GPIO.PWM(LED_Red, Freq) GREEN = GPIO.PWM(LED_Green, Freq) RED.start(0) GREEN.start(0) # # # # This function generate the actually color You can change the color with the specific color variable After the configuration of the color is finished, you will use time.sleep to configure how long the specific color will be displayed def LED_color(Red, Green, pause): RED.ChangeDutyCycle(Red) GREEN.
KY-031 Knock-sensor module KY-031 Knock-sensor module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..........................................................................................................
KY-031 Knock-sensor module Pinout Code example Arduino This example will light up a LED after the sensor detected a knock or vibration. The modules KY-011, KY-016 or KY-029 can be used as an LED.
KY-031 Knock-sensor module Sensor - = [Pin GND] Example program download SensorTest Arduino Code example Raspberry Pi # Needed modules will be imported and configured import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # The input pin of the sensor will be declared. GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN) print "Sensor-Test [press ctrl+c to end]" # This output function will be started at signal detection def outFunction(null): print("Signal detected") GPIO.add_event_detect(GPIO_PIN, GPIO.
KY-032 Obstacle-detect module KY-032 Obstacle-detect module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Code example Arduino ......................................................................................
KY-032 Obstacle-detect module Condition 2: Detector detects an obstacle [LED on the module: ON] [Sensor Signal= Digital Off] This sensor allows you to activate and deactivate the obstacle detection by manipulating the enable-pin. It is activated by default which means that the sensor is in detection mode by default. If you don't want that, you need to remove the jumper with the label "EN" and put a control signal on the enable pin. Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-032 Obstacle-detect module Code example Arduino This program reads the status of the sensor pin and prints it to the serial terminal if an obstacle was detected. int Sensor = 10; // Declaration of the sensor input pin void setup () { Serial.
KY-032 Obstacle-detect module Code example Raspberry Pi # Needed modules will be imported and configured import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # Declaration of the input pin which is connected with the sensor. GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP) # Break between the results will be defined here (in seconds) delayTime = 0.5 print "Sensor-Test [press ctrl+c to end]" # main program loop try: while True: if GPIO.
KY-033 Tracking sensor module KY-033 Tracking sensor module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ....................................................................................................
KY-033 Tracking sensor module Condition 2: Line Tracker not on a line (reflecting area) [LED on the module: ON] [Sensor signal= Digital Off] Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-033 Tracking sensor module Pinout Code example Arduino int Sensor = 10; // Declaration of the sensor input pin void setup () { Serial.
KY-033 Tracking sensor module Code example Raspberry Pi # Needed modules will be imported and configured import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # Declaration of the input pin which is connected with the sensor GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP) # Break between the results will be defined here (in seconds) delayTime = 0.5 print "Sensor-Test [press ctrl+c to end]" # main program loop try: while True: if GPIO.
KY-034 7 Colour LED flash-module KY-034 7 Colour LED flash-module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..............................................................................................
KY-034 7 Colour LED flash-module Pinout Code example Arduino This code example shows how you can switch a LED on for 4 seconds and than off for 2 seconds via defined output pin.
KY-034 7 Colour LED flash-module Code example Raspberry Pi # Needed modules will be imported and configured import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # Declaration of the input pin which is connected with the sensor. # Additional to that the pull up resistor from the input will be activated. LED_PIN = 24 GPIO.setup(LED_PIN, GPIO.OUT, initial= GPIO.LOW) print "LED-Test [press ctrl+c to end]" # main program loop try: while True: print("LED is on for 4 seconds") GPIO.output(LED_PIN,GPIO.
KY-035 Bihor magnetic sensor module KY-035 Bihor magnetic sensor module Contents 1 Pictures ................................................................................................................................................................ 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ........................................................................................
KY-035 Bihor magnetic sensor module Pinout Code example Arduino The program measures the current voltage value at the sensor, calculates with it and a known resistor the resistance from the sensor and shows the results via serial output. int sensorPin = A5; // Declaration of the input pin // Serial OUT in 9600 baud void setup() { Serial.
KY-035 Bihor magnetic sensor module Sensor Signal = [Pin A5] Example program download KY-035_Bihor-magnetic-sensor-module Code example Raspberry Pi !! Attention !! Analog Sensor !! Attention !! Unlike the Arduino, the Raspberry Pi doesn't provide an ADC (Analog Digital Converter) on its Chip. This limits the Raspbery Pi if you want to use a non digital Sensor.
KY-035 Bihor magnetic sensor module ADS1015 = 0x00 ADS1115 = 0x01 # 12-bit ADC # 16-bit # choosing the gain = 4096 # # gain = 2048 # gain = 1024 # gain = 512 # gain = 256 amplifing gain +/- 4.096V # +/- 2.048V # +/- 1.024V # +/- 0.512V # +/- 0.
KY-035 Bihor magnetic sensor module analog Signal = Analog 0 [Pin A0 (ADS1115 - KY-053)] ADS1115 - KY-053: VDD = 3,3V [Pin 17] GND = GND [Pin 09] SCL = GPIO03 / SCL [Pin 05] SDA = GPIO02 / SDA [Pin 03] A0 = look above [Sensor: analog Signal] Example program download KY-053_RPi-AnalogDigitalConverter To start, enter the command: sudo python KY-053_RPi-AnalogDigitalConverter.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-036 Metal-touch sensor module KY-036 Metal-touch sensor module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..............................................................................................
KY-036 Metal-touch sensor module Pinout Functionality of the sensor The sensor has 3 main components on its circuit board. First, the sensor unit at the front of the module which measures the area physically and sends an analog signal to the second unit, the amplifier. The amplifier amplifies the signal, according to the resistant value of the potentiometer, and sends the signal to the analog output of the module.
KY-036 Metal-touch sensor module This sensor doesn't show absolute values (like exact temperature in °C or magneticfield strenght in mT). It is a relative measurement: you define an extreme value to a given normal environment situation and a signal will be send if the measurement exceeds the extreme value. It is perfect for temperature control (KY-028), proximity switch (KY-024, KY-025, KY-036), detecting alarms (KY-037, KY-038) or rotary encoder (KY-026).
KY-036 Metal-touch sensor module pinMode (Analog_Eingang, INPUT); pinMode (Digital_Eingang, INPUT); } Serial.begin (9600); // Serial output with 9600 bps // The program reads the current value of the input pins // and outputs it via serial out void loop () { float Analog; int Digital; // Current value will be read and converted to the voltage Analog = analogRead (Analog_Eingang) * (5.0 / 1023.0); Digital = digitalRead (Digital_Eingang); // and outputted here Serial.print ("Analog voltage value:"); Serial.
KY-036 Metal-touch sensor module !! Attention !! Analog Sensor !! Attention !! The program uses the specific ADS1x15 and I2C python-libraries from the company Adafruit to control the ADS1115 ADC. You can find these here: [https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code] published under the BSD-License [Link]. You can find the needed libraries in the lower download package. The program reads the current values of the input pins and outputs it at the terminal in [mV].
KY-036 Metal-touch sensor module # initialise ADC (ADS1115) adc = ADS1x15(ic=ADS1115) # Input pin for the digital signal will be picked here Digital_PIN = 24 GPIO.setup(Digital_PIN, GPIO.IN, pull_up_down = GPIO.PUD_OFF) ######################################################################################## # # # # # ######## main program loop ######## The program reads the current value of the input pin and shows it at the terminal try: while True: #Current values will be recorded analog = adc.
KY-037 Microphone sensor module (high sensitivity) KY-037 Microphone sensor module (high sensitivity) Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..........................................................
KY-037 Microphone sensor module (high sensitivity) Pinout Functionality of the sensor The sensor has 3 main components on its circuit board. First, the sensor unit at the front of the module which measures the area physically and sends an analog signal to the second unit, the amplifier. The amplifier amplifies the signal, according to the resistant value of the potentiometer, and sends the signal to the analog output of the module.
KY-037 Microphone sensor module (high sensitivity) This sensor doesn't show absolute values (like exact temperature in °C or magneticfield strenght in mT). It is a relative measurement: you define an extreme value to a given normal environment situation and a signal will be send if the measurement exceeds the extreme value. It is perfect for temperature control (KY-028), proximity switch (KY-024, KY-025, KY-036), detecting alarms (KY-037, KY-038) or rotary encoder (KY-026).
KY-037 Microphone sensor module (high sensitivity) pinMode (Analog_Eingang, INPUT); pinMode (Digital_Eingang, INPUT); } Serial.begin (9600); // Serial output with 9600 bps // The program reads the current value of the input pins // and outputs it via serial out void loop () { float Analog; int Digital; // Current value will be read and converted to voltage Analog = analogRead (Analog_Eingang) * (5.0 / 1023.0); Digital = digitalRead (Digital_Eingang); //... and outputted here Serial.
KY-037 Microphone sensor module (high sensitivity) !! Attention !! Analog Sensor !! Attention !! The program uses the specific ADS1x15 and I2C python-libraries from the company Adafruit to control the ADS1115 ADC. You can find these here: [https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code] published under the BSD-License [Link]. You can find the needed libraries in the lower download package. The program reads the current values of the input pins and outputs it at the terminal in [mV].
KY-037 Microphone sensor module (high sensitivity) adc_channel_3 = 3 # Channel 3 # initialise ADC (ADS1115) adc = ADS1x15(ic=ADS1115) # Input pin for the digital signal will be picked here Digital_PIN = 24 GPIO.setup(Digital_PIN, GPIO.IN, pull_up_down = GPIO.
KY-037 Microphone sensor module (high sensitivity) sudo python KY-037_Microphone_sensor_module_RPi.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-038 Microphone sound sensor module KY-038 Microphone sound sensor module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ....................................................................................
KY-038 Microphone sound sensor module Pinout Functionality of the sensor The sensor has 3 main components on its circuit board. First, the sensor unit at the front of the module which measures the area physically and sends an analog signal to the second unit, the amplifier. The amplifier amplifies the signal, according to the resistant value of the potentiometer, and sends the signal to the analog output of the module.
KY-038 Microphone sound sensor module This sensor doesn't show absolute values (like exact temperature in °C or magneticfield strenght in mT). It is a relative measurement: you define an extreme value to a given normal environment situation and a signal will be send if the measurement exceeds the extreme value. It is perfect for temperature control (KY-028), proximity switch (KY-024, KY-025, KY-036), detecting alarms (KY-037, KY-038) or rotary encoder (KY-026).
KY-038 Microphone sound sensor module pinMode (Analog_Eingang, INPUT); pinMode (Digital_Eingang, INPUT); } Serial.begin (9600); // Serial output with 9600 bps // The program reads the current value of the input pins // and outputs it via serial out void loop () { float Analog; int Digital; // Current value will be read and converted to voltage Analog = analogRead (Analog_Eingang) * (5.0 / 1023.0); Digital = digitalRead (Digital_Eingang); //... and outputted here Serial.
KY-038 Microphone sound sensor module !! Attention !! Analog Sensor !! Attention !! The program uses the specific ADS1x15 and I2C python-libraries from the company Adafruit to control the ADS1115 ADC. You can find these here: [https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code] published under the BSD-License [Link]. You can find the needed libraries in the lower download package. The program reads the current values of the input pins and outputs it at the terminal in [mV].
KY-038 Microphone sound sensor module # initialise ADC (ADS1115) adc = ADS1x15(ic=ADS1115) # Input pin for the digital signal will be picked here Digital_PIN = 24 GPIO.setup(Digital_PIN, GPIO.IN, pull_up_down = GPIO.PUD_OFF) ######################################################################################### # # # # # ######## main program loop ######## The program reads the current value of the input pin and shows it at the terminal try: while True: #Current values will be recorded analog = adc.
KY-038 Microphone sound sensor module sudo python KY-038_Microphone_sensor_module_RPir.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-039 Heartbeat sensor module KY-039 Heartbeat sensor module Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ..................................................................................................
KY-039 Heartbeat sensor module If you switch a resistor and a transistor in row, you will see a special behavior if you measure the voltage at the transistor: if much light shines at the transistor, you will measure a very low voltage (near 0V). If the transistor stays in the dark, you will measure a voltage near +V. With this sensor module, which contains a phototransistor and an infrared diode, you can measure a pulse. For that, you have to put a finger between the diode and the transistor.
KY-039 Heartbeat sensor module This shows, the changes of the voltage at the phototransistor - and with it the brightness change which comes from the flowing blood. The peaks above show the heartbeat. If you calculate the measured beats per recorded time, you will nearly get 71 beats per minute (bpm). Additionally to that, you can see that the signal from the transistor is really low or the transistor is really sensitive to measure the small signal.
KY-039 Heartbeat sensor module To increase the sensitivity of the sensor, we advise to fix it at your finger with tape. Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-039 Heartbeat sensor module The heartbeat will be measured really good if the sensor is exactly above a big vein. To get a better signal, we advise you to change the position of the sensor, if necessary. Pinout Pinout: Gray -> GND White -> +V Black -> Signal Code example Arduino The following code example was written by Dan Truong. He published it under the following [[1]] . It is available under the [|MIT OpenSource License].
KY-039 Heartbeat sensor module //////////////////////////////////////////////////////////////////////// // German Comments by Joy-IT //////////////////////////////////////////////////////////////////////// /// @param[in] IRSensorPin Analog PI which is connected with the sensor /// @param[in] delay (msec) The delay between the calls of the sample function // You will get the best results if take 5 sample for each heart beat /// Not slower than 150 mSec for 70 BPM pulse /// Better take 60 mSec for a pulse of
KY-039 Heartbeat sensor module { } // The included LED of the Arduino (Digital 13), will be used as output here. pinMode(ledPin,OUTPUT); // Serial output initialization Serial.begin(9600); Serial.println("Heartbeat detection example code"); const int delayMsec = 60; // 100msec per sample // The main program has two tasks: // - The LED will light up after detecting a heart beat // - Calculating of the pulse and outputting of it at the serial out.
KY-039 Heartbeat sensor module To evade this, use our Sensorkit X40 with the KY-053 module, which provides a 16 Bit ADC, which can be used with the Raspberry Pi, to upgrade it with 4 additional analog input pins. This module is connected via I2C to the Raspberry Pi. It measures the analog data and converts it into a digital signal which is suitable for the Raspberry Pi. So we recommend to use the KY-053 ADC if you want to use analog sensors along with the Raspberry Pi.
KY-039 Heartbeat sensor module ADS1015 = 0x00 ADS1115 = 0x01 # 12-bit ADC # 16-bit # Amplification (Gain) will be picked gain = 4096 # +/- 4.096V # gain = 2048 # +/- 2.048V # gain = 1024 # +/- 1.024V # gain = 512 # +/- 0.512V # gain = 256 # +/- 0.
KY-039 Heartbeat sensor module if rawValue < maxValue - schwelle: isPeak = False # Here the max value will be decreased at each run # because if you don't do that the value would be every time lower or the same. # Also if you move the finger a bit the signal would be weaker without that. maxValue = maxValue - schwelle/2 # If a heartbeat was detected above, the Output will start.
KY-039 Heartbeat sensor module SCL = GPIO03 / SCL [Pin 05] SDA = GPIO02 / SDA [Pin 03] A0 = look above [Sensor: Signal] Example program download KY-039_Heartbeat-sensor_RPi To start, enter the command: sudo python KY-039_Heartbeat-sensor_RPi.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-040 Rotary encoder KY-040 Rotary encoder Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Encoding ..................................................................................................................
KY-040 Rotary encoder A B 0 0 1 0 1 1 0 1 0 0 Counterclockwise [B will change first] -> Pin_DT A B 0 0 0 1 1 1 1 0 0 0 Pinout Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-040 Rotary encoder Code example Arduino The program checks which pin has changed first, to get the rotational direction, after detecting a change at the pin status. You will get the rotational direction after you compare the current status of the pins with the last status. After detecting the rotational direction, the steps from the start will be counted and outputted. Pushing the button of the rotary encoder will reset the current position.
KY-040 Rotary encoder Serial.println ("Rotation detected: "); Serial.print ("Rotational direction: "); if (Richtung) { Serial.println ("Clockwise"); } else { Serial.println("Counterclockwise"); } Serial.print("Current position: "); Serial.println(Counter); Serial.println("------------------------------"); } // Preparation for the next run: // The current value will be the last value for the next run.
KY-040 Rotary encoder PIN_DT = 15 BUTTON_PIN = 14 GPIO.setup(PIN_CLK, GPIO.IN, pull_up_down = GPIO.PUD_UP) GPIO.setup(PIN_DT, GPIO.IN, pull_up_down = GPIO.PUD_UP) GPIO.setup(BUTTON_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP) # Needed variables will be initialised Counter = 0 Richtung = True PIN_CLK_LETZTER = 0 PIN_CLK_AKTUELL = 0 delayTime = 0.01 # Initial reading of Pin_CLK PIN_CLK_LETZTER = GPIO.
KY-040 Rotary encoder Connections Raspberry Pi: CLK = GPIO16 [Pin 36] DT = GPIO15 [Pin 10] SW = GPIO14 [Pin 8] + = 3,3V [Pin 1] GND = GND [Pin 6] Example program download KY-040_rotary-encoder_RPi To start, enter the command: sudo python KY-040_rotary-encoder_RPi.py Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-050 Ultrasonic-distance-sensor KY-050 Ultrasonic-distance-sensor Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ............................................................................................
KY-050 Ultrasonic-distance-sensor With this fact you can make the distance measurement to a time measurement, which can be easiely taken from microcontrollers. The Ultrasonicspeaker sends 8x 40KHz signals, which will be reflected by objects and recorded with the microphone, in this sensor module. Ultrasonic is being used because you are not able to hear it with the human sense of hearing (Human sense of hearing is nearly 20HZ - 22.000Hz).
KY-050 Ultrasonic-distance-sensor Code example Arduino The example program activates the distance measurement and measures the time of the ultrasonic signal. This time will be taken as a base to calculate the distance - after that the result will be printed to the serial output. If the signal is not in the measurement range, an error message will be printed..
KY-050 Ultrasonic-distance-sensor Dauer = pulseIn(Echo_EingangsPin, HIGH); // Now the distance will be calculated with the recorded time Abstand = Dauer/58.2; // Check if the measured value is in the permitted range if (Abstand >= maximumRange || Abstand <= minimumRange) { // An error message will be shown if it's not Serial.println("Distance is not in the permitted range"); Serial.println("-----------------------------------"); } else { // The calculated distance will be shown at the serial output Serial.
KY-050 Ultrasonic-distance-sensor # coding=utf-8 # Needed modules will be imported and configured import time import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) # You can pick the input and output pins here Trigger_AusgangsPin = 17 Echo_EingangsPin = 27 # You can set the delay (in seconds) between the single measurements here sleeptime = 0.8 # Here, the input and output pins will be configured GPIO.setup(Trigger_AusgangsPin, GPIO.OUT) GPIO.setup(Echo_EingangsPin, GPIO.IN) GPIO.
KY-050 Ultrasonic-distance-sensor Trigger = Pin B1 [KY-051-Voltage Translator] Echo = Pin B2 [KY-051-Voltage Translator] GND = GND [Pin 6 (RPi)] KY-051- Voltage Translator: VCCb = 5V [Pin 04(RPi)] Pin B1 = Trigger [KY-050-UltrasonicSensor] Pin B2 = Echo [KY-050-UltrasonicSensor] VCCa = 3,3V [Pin 01(RPi)] Pin A1 = GPIO17 [Pin 11(RPi)] Pin A2 = GPIO27 [Pin 13(RPi)] GND = GND [Pin 06(RPi)] You must not connect the other pins of the KY-051-Voltage-Translator-Modul (OE,B3,B4,A3,A4).
KY-051 Voltage Translator / Level Shifter KY-051 Voltage Translator / Level Shifter Picture Technical data / Short description This level-shifter modulates the voltage of a digital signal into a higher or lower voltage. 4 channels are available which can be modulated. There are many microcontroller-systems which are operating in different voltage ranges: older systems, like Arduino, are using 5V for their in/output pins and new systems, like Raspberry Pis, are using 3.3V.
KY-051 Voltage Translator / Level Shifter Example: Arduino OUTPUT -> Digital [ON] = 5V @ B1 >>>>>>> 3.3V @ B2 -> Raspberry Pi INPUT No additional software or code is needed that it works, The module works autonomously. Please pay attention that VCCb has to be higher or equal to VCCa ( Example: VCCb=5V - VCCa=3, 3V) Example connection between Arduino and Raspberry Pi: Connections Arduino: VCCb = [Pin 5V] B1 = [Pin 03] B2 = [Pin 04] B3 = [Pin 05] B4 = [Pin 06] GND = [Pin GND] Export: 16.
KY-051 Voltage Translator / Level Shifter Connections Raspberry Pi: VCCa = 3,3V [Pin 01] A1 = GPIO18 [Pin 12] A2 = GPIO03 / SCL [Pin 05] A3 = GPIO02 / SDA [Pin 01] A4 = GPIO14 [Pin 08] GND = GND [Pin 09] Please take attention that both systems are connected with the same GND - you don't need to use OE with this module Export: 16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.
KY-052 Pressure-sensor / Temperature-sensor (BMP280) KY-052 Pressure-sensor / Temperature-sensor (BMP280) Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ......................................................
KY-052 Pressure-sensor / Temperature-sensor (BMP280) Pinout *You can connect this sensor to 5V systems and to 3,3V systems. Please pay attention that only one of the power supply pins is connected to the desired voltage - you can get additional informations at the example below: Connection Arduino (5V) and Connection Raspberry-Pi (3,3V). Software example Arduino An additional Arduino library is needed to use this sensor.
KY-052 Pressure-sensor / Temperature-sensor (BMP280) } if (!bmp.begin()) { Serial.println(F("Could not find a valid BMP280 sensor, check wiring!")); while (1); } void loop() { Serial.print(F("Temperature = ")); Serial.print(bmp.readTemperature()); Serial.println(" *C"); Serial.print(F("Pressure = ")); Serial.print(bmp.readPressure()); Serial.println(" Pa"); } Serial.
KY-052 Pressure-sensor / Temperature-sensor (BMP280) git clone https://github.com/bastienwirtz/Adafruit_Python_BMP After that we can jump into the downloaded folder with the command... cd Adafruit_Python_BMP/ ... and install the library with .... sudo python setup.py install Now you are ready to use the library. In order that the Raspberry Pi and the sensor can communicate via I2C-bus, you have to start the I2Cfunction of the Raspberry Pi first.
KY-052 Pressure-sensor / Temperature-sensor (BMP280) SDA = GPIO02 / SDA [Pin 03] 3.3 = 3,3V [Pin 01] Example program downlaod KY-052_BMP280_RPi To start, enter the command: sudo python KY-052_BMP280_RPi.py If your example is not working, you might need to change the I2C-Address in the example-code. In order to do this, after wiring the sensor, check the I2C-Address by entering: sudo i2cdetect -y 1 for newer Raspberry Pis or sudo i2cdetect -y 1 for older Raspberry Pis.
KY-053 Analog digital converter KY-053 Analog digital converter Contents 1 Picture ................................................................................................................................................................. 1 2 Technical data / Short description ....................................................................................................................... 1 3 Pinout ................................................................................................
KY-053 Analog digital converter Pinout The Pin connections are printed on the module board Code example Arduino The Arduino board includes a 10-bit-ADC with 6 channels by default. If you need more channels or a higher precision you can use the KY053 analog digital converter module to expand the channel by 4 with a precision of 12-bit which will connected with the Arduino via I2C.
KY-053 Analog digital converter Serial.println("ADC Range: +/- 6.144V (1 bit = 0.1875mV)"); // The module includes signal amplifier at the inputs // ADS1115 // ------ads.setGain(GAIN_TWOTHIRDS); // 2/3x gain +/- 6.144V 1 bit = 0.1875mV // ads.setGain(GAIN_ONE); // 1x gain +/- 4.096V 1 bit = 0.125mV // ads.setGain(GAIN_TWO); // 2x gain +/- 2.048V 1 bit = 0.0625mV // ads.setGain(GAIN_FOUR); // 4x gain +/- 1.024V 1 bit = 0.03125mV // ads.setGain(GAIN_EIGHT); // 8x gain +/- 0.512V 1 bit = 0.015625mV // ads.
KY-053 Analog digital converter A3 = [peak Analog 3] Code example Raspberry Pi The Raspberry Pi has no ADC (Analog Digital Converter) included on its chip. It is a disadvantage if you want to use sensors which doesn't send digital signals like : Voltage range exceeded -> digital ON | Voltage range deceeded -> digital OFF | Example: Button pushed [ON], Button released [OFF], instead of that you get a continuously changing value ( example: potentiometer -> different position = different voltage value).
KY-053 Analog digital converter ALRT = N.C.