workshops:archived:arduino_dxmodulepack

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

workshops:archived:arduino_dxmodulepack [2015/12/19 23:20] (current)
Line 1: Line 1:
 +====== Arduino Sensor Modules - Description & photos======
  
 +
 +Cataloging modules from the dx.com [[http://​dx.com/​p/​arduno-37-in-1-sensor-module-kit-black-142834|ARDUINO Compatible 37-in-1 Sensor Module Kit]] (DX SKU 142834.) which was used in the first MHV arduino workshops.
 +
 +{{:​workshops:​arduino:​box_of_modules.jpg?​250}}
 +
 +Some other places with cataloging info are:
 +  * http://​www.arduinosale.com/​buy-arduino/​arduino-sensors.html (individual sensors for sale)
 +  * http://​club.dx.com/​forums/​Forums.dx/​threadid.1202308 (DealExtreme forum thread)
 +
 +{{:​workshops:​arduino:​labelled_modules-2.jpg?​500}} ​
 +
 +
 +===== Modules with red circuit boards =====
 +
 +{{:​workshops:​arduino:​microphone_red_module.jpg?​60}}
 +
 +Including:
 +  * Microphone sound sensor module KY-038
 +  * Hall magnetic sensor module KY-003
 +  * Metal touch sensor module KY-036
 +  * Infrared emission sensor module KY-005 ​
 +
 +These boards are all a common pattern, on a red circuit board. They have two outputs, one is a digital output that triggers Low->​High based on the sensor level and the other is an analog output that is the exact level of the sensor.
 +
 +The boards have two LEDs - one for power (L1) and one connected to the digital "​trigger"​ output (L2.)
 +
 +Turn the screw on the potentiometer (blue module) to tune in the level that the digital output triggers on.
 +
 +|| Pin || Label || Arduino Connection ||
 +|| 1 || AO || Analog input ||
 +|| 2 || G  || Ground (GND) ||
 +|| 3 || +  || 5 volt power ||
 +|| 4 || DO || Digital input ||
 +
 +==== Sample code ====
 +
 +{{:​workshops:​arduino:​microphone_arduino.jpg?​200}}
 +
 +Reads the analog and digital outputs and prints them to the serial port.
 +
 +<code cpp>
 +// Arduino pin numbers
 +const int DO_pin = 2;
 +const int AO_pin = 0;
 +
 +void setup() {
 +  pinMode(DO_pin,​ INPUT);
 +  Serial.begin(115200);​
 +}
 +
 +void loop() {
 +  Serial.print(digitalRead(DO_pin));​
 +  Serial.print("​-"​);​
 +  Serial.println(analogRead(AO_pin));​
 +  delay(5);
 +}
 +</​code>​
 +
 +
 +===== Temperature sensor module KY-001 =====
 +
 +The sensor on this module is DS18B20. This page has a good introduction and sample code - http://​bildr.org/​2011/​07/​ds18b20-arduino/​
 +The only difference is that our module is already mounted with the resistor in the circuit, and a slightly different pinout.
 +The module has pin 1 (-) to ground, pin 2 to 5V and pin 3 (S) to the digital sensor input on the arduino.
 +
 +
 +===== Temperature and humidity sensor module KY-015 =====
 +
 +The sensor on this module is DHT-11. This page has a good introduction and sample code http://​www.hobbyist.co.nz/?​q=documentations/​wiring-up-dht11-temp-humidity-sensor-to-your-arduino
 +
 +Our module has a different pinout to the bare sensor - pin 1 (S) is data signal, pin 2 is 5V power, pin 3 is GND.
 +
 +Some of you have have the bare sensor
 +
 +{{:​workshops:​arduino:​dht11_MED.jpg?​210}}
 +
 +[[http://​learn.adafruit.com/​dht/​overview|This is a nice tutorial for the bare module]]
 +
 +===== Photo resistor module KY-018 =====
 +===== Temperature sensor module KY-013 =====
 +
 +These modules are the same, they'​re all on boards labelled "​S1"​. THE PINS ARE MARKED BACKWARDS ON THESE.
 +
 +Has pin 1 (marked S) (GND), pin 2 (5v power) and pin 3 (marked -) (analog signal.)
 +
 +EDIT 2014/05/23 by Philips
 +I just want to share what I have encountered as a thank you for your providing all this information. I have these KY-013 temperature sensors too (ordered from banggood.com). As of the date of this edit, I have discovered that my units have the labels NOT reversed, i.e. mark S is the analog signal, and mark - is the ground. Center pin remains as the 5V power. Hope this helps.
 +===== 2-color LED module KY-011 =====
 +===== Yin Yi 2-color LED module 3MM KY-029 =====
 +
 +These two modules are the same, just different sized LEDs (KY-011 is big, KY-029 is small.)
 +
 +You can think of the 2-color LED like 2 separate LEDs (a green one and a red one) in one package, sharing one negative lead (this lead is the cathode so these are called '​common cathode'​ LEDs.)
 +
 +Pins are 1 (-) ground, 2 green, 3 red. There are no current limiting resistors on the modules, you need to add resistors. (Some of these modules do have resistors)
 +
 +You can follow the steps for the [[http://​www.arduino.cc/​en/​Tutorial/​Blink|Arduino blink tutorial]]. First connect the red resistor, pin 3 (+) & 1 (-) and then once that works try to expand the sketch to also blink green on pin 2 (+) & 1 (-).
 +
 +===== 3-color LED module KY-016 =====
 +===== 3-color full-color LED SMD modules KY-009 =====
 +
 +You can think of these 3-color LEDs like 3 separate LEDs (a red one, a green one and a blue one) in one package, sharing one negative lead (this lead is the cathode so these are called '​common cathode'​ LEDs.)
 +
 +The positive pins are numbers 1,2,3 and pin 4 Ground. There are no current limiting resistors on the modules, you need to add resistors.
 +
 +There'​s a good example here: http://​wiring.org.co/​learning/​basics/​rgbled.html - only difference is they have different pins on their LED compared to the module.
 +
 +===== Magic light cup module KY-027 =====
 +
 +These modules have two parts - an LED and a mercury tilt switch.
 +
 +Pins are 1 G (ground), 2 + (5V power), 3 S signal and 4 L (LED.)
 +
 +If you wire up 1 & 2 to power, pin 3 (signal) will alternate between 5V (HIGH) and 0V (LOW) as you tilt the module.
 +
 +If you connect a current limiting resistor to L2, you can use it as a blinking LED.
 +
 +You might also be able to have the LED automatically blink with the sensor...
 +
 +===== infrared sensor receiver module KY-022 =====
 +
 +See this page for more information:​ http://​learn.adafruit.com/​ir-sensor/​overview
 +
 +===== Mini magnetic reed modules KY-021 =====
 +
 +THE PINS ARE MARKED BACKWARDS ON THESE.
 +
 +Has pin 1 (marked S) (GND), pin 2 (5v power) and pin 3 (marked -) (digital signal.)
 +
 +The digital signal changes when you move a magnet close to it.
 +
 +===== open mercury KY-017 optical modules =====
 +
 +led comes on when switch is on.
 +
 +===== tilt switch modules KY-020 =====
 +
 +Digital output. Probably just a mercury switch.
 +hahahahahahahah
 +===== Hit sensor module KY-031 =====
 +
 +According to this page http://​www.arduinosale.com/​buy-arduino/​arduino-sensors/​keyes-division-easy-to-hit-the-sensor-module-arduino-ky-031.html
 +
 +... that's what this is. My quick tests didn't reveal how it worked, though...
 +
 +===== 5V relay module KY-019 =====
 +
 +A relay is like an electrically powered switch. Pins on this module are Pin 1 S (digital on/off), Pin 2 + (5V) and Pin 3 - (Ground.)
 +
 +On the other side of the relay are screw terminals that the relay switches between when it changes.
 +
 +There are some good tips about using relays to drive higher power devices like 12V pumps or solenoids here: http://​blog.trossenrobotics.com/​2012/​07/​27/​howto-controlling-solenoids-pumps-and-more-from-your-arduino/​
 +
 +===== Active buzzer module KY-012 =====
 +
 +See http://​arduino.cc/​en/​Reference/​Tone
 +
 +===== XY-axis joystick module KY-023 =====
 +
 +Pins:
 +|| Pin Number || Label || Signal || Connect To ||
 +|| 1 || GND || || Ground ||
 +|| 2 || +5V || || 5V ||
 +|| 3 || VRx || Voltage proportional to X position || An analog input pin ||
 +|| 4 || VRy || Voltage proportional to Y position || An analog input pin ||
 +|| 5 || SW  || Joystick pushbutton || Shorts to ground when switch is pushed ||
 +
 +==== Sample Code ====
 +
 +This code reads the switch and the position of the joystick and prints it to the Arduino serial port.
 +
 +<code cpp>
 +// Arduino pin numbers
 +const int SW_pin = 2; // digital pin connected to switch output
 +const int X_pin = 0; // analog pin connected to X output
 +const int Y_pin = 1; // analog pin connected to Y output
 +
 +void setup() {
 +  pinMode(SW_pin,​ INPUT);
 +  digitalWrite(SW_pin,​ HIGH);
 +  Serial.begin(115200);​
 +}
 +
 +void loop() {
 +  Serial.print(digitalRead(SW_pin));​
 +  Serial.print("​ @ ");
 +  Serial.print(analogRead(X_pin));​
 +  Serial.print("​x"​);​
 +  Serial.println(analogRead(Y_pin));​
 +  delay(10);
 +}
 +</​code>​
 +
 +===== KY004 Press Switch =====
 +
 +<code cpp>
 +// Arduino pin numbers
 +const int DO_pin = 2;
 +
 +void setup() {
 +  pinMode(DO_pin,​ INPUT);
 +  digitalWrite(DO_pin,​HIGH);​
 +  Serial.begin(115200);​
 +}
 +
 +void loop() {
 +  Serial.println(digitalRead(DO_pin));​
 +  delay(5);
 +}
 +</​code>​
 +
 +===== Obstacle avoidance sensor module KY-032 =====
 +
 +There seem to be two of these, one with 4 pins and one with 3 pins. They both use an infrared beam to detect proximity of obstacles.
 +
 +The potentiometers can be used to adjust sensitivity.
 +
 +==== 4 pin version ====
 +
 +Pin 1 is Ground, pin 2 is 5V power, pin 3 is digital output (on/off depending on the beam), 4 is enable (don't know what it does.)
 +
 +==== 3 pin version ====
 +
 +Pin 1 is ground, pin 2 is 5V, pin 3 is digital output (on/off depending on the beam.)
 +
 +===== Detect the heartbeat module KY-039 =====
 +
 +We couldn'​t make this one work. I too tried to get this to work and it does not and my kit came with 2 units both failed..
  • workshops/archived/arduino_dxmodulepack.txt
  • Last modified: 2015/12/19 23:20
  • (external edit)