Browsing Category

Arduino

KY-010 Photo Interrupter module

The KY-010 Photo Interrupter module consists of an optical emitter/detector. If the sensor is broken the LED is turned on. Connection Connect the power line (middle) and ground (left) to +5V and GND. Connect the signal (S) to pin 3 on the Arduino. KY-010 Arduino - (left) GND middle +5V S (right) Pin 3 Code int Led = 13; // define LED pin int buttonpin = 3; // photo interrupter pin int val; void setup() { pinMode(Led, OUTPUT); // LED pin as output pinMode(buttonpin, INPUT); //photo interrupter pin as…

KY-009 RGB Full color LED SMD Module

The KY-009 RGB LED Module can emits a range of colour by mixing red, green and blue. The amount of each primary color is adjusted using the PWM pins on an Arduino. The KY-009 RGB Full Color LED SMD Module consists of a 5050 SMD LED Connection You need to use resistors to prevent burnout, here are some recommended values KY-009 Resistor Arduino R 180Ω resistor Pin 9 G 110Ω resistor Pin 10 B 110Ω resistor Pin 11 - GND Code int redpin = 11; //select the pin for the red LED int bluepin =10; // select…

KY-008 Laser Transmitter Module

The KY-008 Laser Transmitter Module consists  of a 650nm red laser diode head Connection Connect signal (S) to pin 3 on the Arduino and ground (-) to GND. Middle pin is not used in this example. KY-008 Arduino S Pin 3 middle N/A - GND Code void setup () { pinMode (3, OUTPUT); // define the digital output interface 13 feet } void loop () { digitalWrite (3, HIGH); // open the laser head delay (1000); // delay one second digitalWrite (3, LOW); // turn off the laser head delay (1000); // delay one second }…

KY-006 Buzzer Module

The KY-006 Buzzer Module consists of a passive piezoelectric buzzer, it can generate tones between 1.5 to 2.5 kHz by switching it on and off at different frequencies either using delays or PWM. Piezoelectric buzzer is composed of multivibrator, piezoelectric buzzer, impedance matching and resonance box, shell and other components. Some piezoelectric buzzer shell is also equipped with light-emitting diodes. A multivibrator is composed of a transistor or an integrated circuit. When the power supply (1.5 ~ 15V DC…

KY-005 Infrared Transmitter Module

The KY-005 Infrared Transmitter Module consists of just a 5mm IR LED. It works together with the KY-022 IR receiver module. The Arduino IR Transmitter Module Keyes KY-005, emits infrared light at 38kHz. Connection Connect the Power line (middle) and ground (-) to +5 and GND. Connect signal (s) to pin 3 on the Arduino for this example KY-005 Arduino S Pin 3 middle +5V - GND Code The following Arduino sketch uses the IRremote library #include <IRremote.h> IRsend irsend; void setup() { Serial.begin(9600); } void…

KY-004 Key Switch Module

The KY-004 Key Switch Module is a push button that will output a high signal when pressed. Connection Connect the Power line (middle) and ground (-) to +5 and GND. Connect signal (s) to pin 3 on the Arduino for this example KY-004 Arduino S Pin 3 middle +5V - GND Code int led = 13; //Define the LED pin int buttonpin = 3; //Define the push button pin int val; //Define a numeric variable void setup() { pinMode(led,OUTPUT); pinMode(buttonpin,INPUT); } void loop() { val = digitalRead(buttonpin); // check the…

KY-003 Hall magnetic sensor

The KY-003 is a magnetic switch based on a 3144EUA-S sensitive Hall-effect switch. If no magnetic field is present, the signal line of the sensor is HIGH . If a magnetic field is presented to the sensor, the signal line goes LOW, at the same time the LED on the sensor lights up. Connection Connect the Power line (middle) and ground (-) to +5 and GND. Connect signal (s) to pin 3 on the Arduino for this example KY-003 Arduino S Pin 3 middle +5V - GND Code int led = 13;//LED pin int sensor = 3; //sensor pin int…

KY-002 Vibration Shock Sensor

The KY-002 Vibration Shock Sensor This vibration detector switch is OFF in the normal state, when there is enough force then the switch is in an ON state Connection Connect the Power line (middle) and ground (-) to +5 and GND. Connect signal (S) to pin 3 on the Arduino. KY-002 Arduino S Pin 3 middle +5V - GND Code int Led=13; int Shock=3; int val; void setup() { pinMode(Led,OUTPUT); pinMode(Shock,INPUT); } void loop() { val=digitalRead(Shock); if(val==HIGH) { digitalWrite(Led,LOW); } else { digitalWrite(Led,HIGH); } } Links…

Arduino and force sensor example

A force-sensing resistor is a material whose resistance changes when a force or pressure is applied. Force-sensing resistors consist of a conductive polymer, which changes resistance in a predictable manner following application of force to its surface.They are normally supplied as a polymer sheet or ink that can be applied by screen printing. The sensing film consists of both electrically conducting and non-conducting particles suspended in matrix. The particles are sub-micrometre sizes, and are formulated to reduce the…

Arduino and reed switches

The reed switch is an electrical switch operated by an applied magnetic field. It consists of a pair of contacts on ferrous metal reeds in a hermetically sealed glass envelope. The contacts may be normally open, closing when a magnetic field is present, or normally closed and opening when a magnetic field is applied. The switch may be actuated by a coil, making a reed relay,or by bringing a magnet near to the switch. Once the magnet is pulled away from the switch, the reed switch will go back to its original position. An…