'LCD2004'에 해당되는 글 31건

  1. 2016.10.05 DZ292 Laser Receiver Module (DZ292) [S035]
  2. 2016.10.04 4-Phase 5-Wire Stepper Motor (28BYJ-48) [D021]
  3. 2016.10.04 SG90 Camera Mount [B051]
  4. 2016.10.04 Tower Pro SG90 Micro Servo (SG90) [D018]
  5. 2016.09.30 9376 Motor Miniatura (9376) [D019]
  6. 2016.09.27 Small Passive buzzer module (KY-006) [D023]
  7. 2016.09.27 Passive Buzzer [D027,D028,D029]
  8. 2016.09.27 Active Buzzer [D026]
  9. 2016.09.21 ACS712T Current Sensor Module 20A (ACS712T) [B039]
  10. 2016.09.21 LCD2004 I2C Green (LCD2004A) [D046]
  11. 2016.09.21 LCD2004 I2C ( LCD2004A) [D017]
  12. 2016.09.19 Bargraph Segment LED Module (SHB10R) [D024]
  13. 2016.09.18 Magic Cup Light Module (KY-027) [D020]
  14. 2016.09.18 MF-A03 Knob + Sheet Scale (MF-A03) [S216]
  15. 2016.09.18 Linear Potentiometer B1K~B1M (B1K~B1M) [S070]
  16. 2016.09.18 Slide Pot 10K Module [S061]
  17. 2016.09.18 Taper Rotary Potentiometer B10K (B10K) [S060]
  18. 2016.09.18 Amp Pot B5K (B5K) [S027]
  19. 2016.09.17 ADXL335 3-axis Accelerometer (GY-61) [S057]
  20. 2016.09.17 Barometric Pressure Altitude BMP180 (BMP180) [S074]
  21. 2016.09.17 4 Channel IR Tracking Module [S075]
  22. 2016.09.17 Tracking Sensor Module Obstacle Avoidance (KY-033) [S026]
  23. 2016.09.17 4 Head Infrared Transmitter Module [S180]
  24. 2016.09.17 IR Transmitter Module [S066]
  25. 2016.09.17 ENC28J60 Ethernet Module (ENC28J60) [S058]
  26. 2016.09.17 Finger Heartbeat Detection Sensor Module (KY-039) [S033]
  27. 2016.09.17 Pulse Sensor [S032]
  28. 2016.09.17 ISD 1820 Voice Recording Module (ISD1820) [S082]
  29. 2016.09.17 Small Sound Detection Module (KY-038) [S053]
  30. 2016.09.17 Big Sound Detection Module (KY-037) [S052]

DZ292 Laser Receiver Module (DZ292) [S035]



https://www.youtube.com/watch?v=iPmirgi-yPs


* GitHubhttps://github.com/rdiot/rdiot-s035.git


* Specs

PCB size:1.52*2.22cm

work voltage:5V

Output:

output high level when receive laser signal;

output low level when not receive laser signal.


* Contents

- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004


int laserPin = 2; // Laser

int laserRcvPin = 7; // Laser Receiver


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(laserPin,OUTPUT);

  pinMode(laserRcvPin,INPUT);


  digitalWrite(laserPin, HIGH);

  delay(1000);


  lcd.clear();

}


void loop()

  lcd.setCursor(0,0);

  lcd.print("S035:DZ292 LaserRCV");


  int rcv = digitalRead(laserRcvPin);


  lcd.setCursor(0,2);

  lcd.print("laser value=" + (String)rcv);


  if(rcv == 1)

  {

    lcd.setCursor(0,3);

    lcd.print("laser detected");

  }

  else

  {  

    lcd.setCursor(0,3);

    lcd.print("                    ");

  }

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

4-Phase 5-Wire Stepper Motor (28BYJ-48) [D021]



https://www.youtube.com/watch?v=YzQ7ImtW9bA


* GitHub : https://github.com/rdiot/rdiot-d021.git

* Specs

Color: Silver

Diameter: 28mm

Voltage: 5V

No-load pull into the frequency: >600Hz

Phase: 4

No-load pull-out frequency: >1000Hz

Reduction ratio: 1/64

Pull-in torque: >34.3mN.m (120Hz)

Step Angle: 5.625 x 1/64

Self-positioning torque: >34.3mN.m

DCR: 200ohm +/- 7% (25'C)

Temperature: <40K (120Hz)

Insulation resistance: >10Mohm (500V)

Noise: <40dB (120Hz, No load, 10cm)

Dielectric Strength: AC 600V / 1mA / 1s

Insulation Class: A

Cable length: 24cm

Suitable for guide wind deflector, portable air conditioner valve, etc

Dimensions: 1.65 in x 1.22 in x 0.79 in (4.2 cm x 3.1 cm x 2.0 cm)

Weight: 1.20 oz (34 g)


* Contents

28BYJ-48 Stepper Motor and ULN2003 Motor Driver


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include <Stepper.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

const int stepsPerRevolution = 2048; // 2048:(360 Degree), 1024:(180 degree)


// ULN2003 IN4, IN2, IN3, IN1

Stepper myStepper(stepsPerRevolution,11,9,10,8); 


int val;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  delay(1000);

  

  myStepper.setSpeed(14); 

  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D021:28BYJ-48");

  lcd.setCursor(0,1);

  lcd.print("B002:X113647");


  // Left 1 round

  myStepper.step(stepsPerRevolution);

  val = stepsPerRevolution;

  lcd.setCursor(0,2);

  lcd.print("right=" + (String)val + "  ");

  delay(500);


  // Right 1 round

  myStepper.step(-stepsPerRevolution);

  val = -stepsPerRevolution;

  lcd.setCursor(0,2);

  lcd.print("left=" + (String)val + "   ");

  delay(500);


}

Posted by RD IoT RDIoT

댓글을 달아 주세요

SG90 Camera Mount [B051]



https://www.youtube.com/watch?v=gk7Mg69mgq4


* GitHub https://github.com/rdiot/rdiot-b051.git


* Specs

Weight : 0.050kg (0.11lb.)

Size : 13cm x 9cm x 8cm (5.12in x 3.54in x 3.15in)


* Contents

- Connect

Top ----- D12

Bottom ----- D11


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include <Servo.h> 


LiquidCrystal_I2C lcd(0x27,20,4);

Servo myservo1;

Servo myservo2;


int servoPin_updown = 12;

int servoPin_leftright = 11;


int pos_updown = 0;

int pos_leftright = 0;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  myservo1.attach(servoPin_updown); 

  myservo2.attach(servoPin_leftright); 

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("B051:SG90 Mount");



  for(pos_leftright = 0; pos_leftright < 180; pos_leftright += 1) 

  { 

    myservo2.write(pos_leftright);

    //lcd.setCursor(0,1);

    //lcd.print("pos0~179=" + (String)pos + "  " );


    delay(10); 

  }


  for(pos_leftright = 180; pos_leftright>=0; pos_leftright-=1)

  { 

    myservo2.write(pos_leftright); 

    //lcd.setCursor(0,2);

    //lcd.print("pos180~1=" + (String)pos + "  " );

    delay(10); 

  } 


  

  for(pos_updown = 80; pos_updown < 180; pos_updown += 1) 

  { 

    myservo1.write(pos_updown);

    //lcd.setCursor(0,1);

    //lcd.print("pos0~179=" + (String)pos + "  " );


    delay(10); 

  }


  for(pos_updown = 180; pos_updown>=80; pos_updown-=1)

  { 

    myservo1.write(pos_updown); 

    //lcd.setCursor(0,2);

    //lcd.print("pos180~1=" + (String)pos + "  " );

    delay(10); 

  } 


}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Tower Pro SG90 Micro Servo (SG90) [D018]



https://www.youtube.com/watch?v=qdUgJtBClZ4


* GitHubhttps://github.com/rdiot/rdiot-d018.git


* Specs

Speed: 0.12 second / 60 degrees rotation

Torque: 1.2-1.4kg @ 4.8V~6V power

Comes with full ranged connectivity accessories and mounting screws

Working temperature: -30 to +60 degrees Celsius

Dead band setting: 7 microseconds


* Contents

- Connect

Brown - GND

Red - 5V

Orange - D12



- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include <Servo.h> 



LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

Servo myservo; 

int servoPin = 12;

int pos = 0; 


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  myservo.attach(servoPin); 

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D018:SG90 Servo");


  for(pos = 0; pos < 180; pos += 1) 

  { 

    myservo.write(pos);

    lcd.setCursor(0,1);

    lcd.print("pos0~179=" + (String)pos + "  " );


    delay(0); // Control Speed by delay time.

  }


  for(pos = 180; pos>=1; pos-=1)

  { 

    myservo.write(pos); 

    lcd.setCursor(0,2);

    lcd.print("pos180~1=" + (String)pos + "  " );

    delay(0); 

  } 

}


Posted by RD IoT RDIoT

댓글을 달아 주세요

9376 Motor Miniatura (9376) [D019]



https://www.youtube.com/watch?v=SpYVBLfMmfI


* GitHubhttps://github.com/rdiot/rdiot-d019.git



* Specs

 
VACIO
MÁXIMA EFICACIA
BLOQUEO
 
V.
R.P.M.
A.
R.P.M.
A.
Kg·cm.
Kg·cm.
A.
 340000.08531900.3417851.35
 685000.170000.54281783
 9123001.11106500.7302204.5
 12165000.125143000.836.52755.2

* Contents

- Connect

Red ----- D7

Black ----- GND

 

Buttton Module

S ----- D2

middle ----- 5V

- ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int R = 2;

byte lastButton = HIGH;

byte nowButton = HIGH;

int servo = 7;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

  pinMode(R, INPUT);

  pinMode(servo, OUTPUT);

 

  digitalWrite(R, HIGH);

 

  digitalWrite(servo, LOW);

  

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D019:9376 Motor");

 

  byte nowButton = digitalRead(R);

 

  lcd.setCursor(0,1);

  lcd.print("value="+(String)nowButton);

 

  if (HIGH == lastButton)

  {

    if (LOW == nowButton)

    {

     lcd.setCursor(0,2);

     lcd.print("running motor  ");

     digitalWrite(servo, HIGH);

    }

  }

  else

  {

    if (HIGH == nowButton)

    {

     lcd.setCursor(0,2);

     lcd.print("stopped motor  ");

    digitalWrite(servo, LOW);

 

    }

  }

 

 lastButton = digitalRead(R);

 delay(100);

 

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Small Passive buzzer module (KY-006) [D023]



https://www.youtube.com/watch?v=ASjVjjn9aGs


* GitHub : https://github.com/rdiot/rdiot-d023.git


* Specs

Buzzer: The Buzzer is an integrated electronic Xiangqi structure, with a DC power supply, widely used in computers, printers, photocopiers, alarms, electronic toys, automotive electronics, telephones, timers, etc. electronic products for sound devices.

Buzzer Category: divided into piezoelectric buzzer and magnetic buzzer

Buzzer circuit pattern symbol: buzzer in the circuit by the letter "H" or "HA" (the old standard with the "FM", "LB", "JD", etc.) respectively.


* Contents

- Connect

S ----- D2

middle ----- 5V

- ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int S = 2 ;// connect the I/O pin on the buzzer to this


// TONES ==========================================

// Start by defining the relationship between 

// note, period, & frequency. 

#define m_c 3830 // 261 Hz 

#define d 3400 // 294 Hz 

#define e 3038 // 329 Hz 

#define f 2864 // 349 Hz 

#define g 2550 // 392 Hz 

#define a 2272 // 440 Hz 

#define b 2028 // 493 Hz 

#define C 1912 // 523 Hz 

// Define a special note, 'R', to represent a rest

#define R 0

 

// MELODY and TIMING =======================================

// melody[] is an array of notes, accompanied by beats[], 

// which sets each note's relative length (higher #, longer note) 

int melody[] = { g, g, a, a, g, g, e, g, g, e, e, d };

int beats[] = { 16, 16, 16, 16, 8, 8, 32, 16, 16, 8, 8, 16 };

int MAX_COUNT = sizeof(melody) / 2; // Melody length, for looping.

 

// Set overall tempo

long tempo = 40000; //10000

// Set length of pause between notes

int pause = 1000; //1000

// Loop variable to increase Rest length

int rest_count = 100; //<-BLETCHEROUS HACK; See NOTES

 

// Initialize core variables

int tone_ = 0;

int beat = 0;

long duration = 0;

 

// PLAY TONE ==============================================

// Pulse the speaker to play a tone for a particular duration

void playTone() {

 long elapsed_time = 0;

 if (tone_ > 0) { // if this isn't a Rest beat, while the tone has 

 // played less long than 'duration', pulse speaker HIGH and LOW

 while (elapsed_time < duration) {

 

 digitalWrite(S, HIGH);

 delayMicroseconds(tone_ / 2);

 

 // DOWN

 digitalWrite(S, LOW);

 delayMicroseconds(tone_ / 2);

 

 // Keep track of how long we pulsed

 elapsed_time += (tone_);

 }

 }

 else { // Rest beat; loop times delay

 for (int j = 0; j < rest_count; j++) { // See NOTE on rest_count

 delayMicroseconds(duration);

 }

 }

}


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(S, OUTPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D023:KY006PassiveBuz");


  for (int i = 0; i<MAX_COUNT; i++) {

  tone_ = melody[i];

  beat = beats[i];

 

  duration = beat * tempo; // Set up timing

 

  lcd.setCursor(0,1);

  lcd.print("melody[" + (String)i + "] = " + (String)tone_ + "  ");


  lcd.setCursor(0,2);

  lcd.print("beat[" + (String)i + "] = " + (String)beat + "  ");


  lcd.setCursor(0,3);

  lcd.print("durati[" + (String)i + "] = " + (String)duration + " ");



  playTone();

  // A pause between notes...

  delayMicroseconds(pause); 

  }

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Passive Buzzer [D027,D028,D029]



https://www.youtube.com/watch?v=CLI5iJtxRZ0


* GitHub : https://github.com/rdiot/rdiot-d027.git


* Specs

- Passive Buzzer D12

- Passive Buzzer D22

- Passive Buzzer KPR-G2445 (KPR-G2445)

Rated Voltage 12Vp-p Square Wave

Max.Allowable Voltage 30Vp-p Square Wave

Max.Rated Current 3mA at 4.5KHz/12Vp-p Square Wave

Min.Sound Pressure Level 80dB at 4.5KHz/12Vp-p Square Wave/30cm

Resonant Frequency 4.5 ±0.5KHz

Capacitance at 120Hz 24nF±30%

Operating Temperature -20~+60°C

D(mm) Ø24

H(mm) 4.3

weight 2g


* Contents

- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

#define NOTE_B0  31

#define NOTE_C1  33

#define NOTE_CS1 35

#define NOTE_D1  37

#define NOTE_DS1 39

#define NOTE_E1  41

#define NOTE_F1  44

#define NOTE_FS1 46

#define NOTE_G1  49

#define NOTE_GS1 52

#define NOTE_A1  55

#define NOTE_AS1 58

#define NOTE_B1  62

#define NOTE_C2  65

#define NOTE_CS2 69

#define NOTE_D2  73

#define NOTE_DS2 78

#define NOTE_E2  82

#define NOTE_F2  87

#define NOTE_FS2 93

#define NOTE_G2  98

#define NOTE_GS2 104

#define NOTE_A2  110

#define NOTE_AS2 117

#define NOTE_B2  123

#define NOTE_C3  131

#define NOTE_CS3 139

#define NOTE_D3  147

#define NOTE_DS3 156

#define NOTE_E3  165

#define NOTE_F3  175

#define NOTE_FS3 185

#define NOTE_G3  196

#define NOTE_GS3 208

#define NOTE_A3  220

#define NOTE_AS3 233

#define NOTE_B3  247

#define NOTE_C4  262

#define NOTE_CS4 277

#define NOTE_D4  294

#define NOTE_DS4 311

#define NOTE_E4  330

#define NOTE_F4  349

#define NOTE_FS4 370

#define NOTE_G4  392

#define NOTE_GS4 415

#define NOTE_A4  440

#define NOTE_AS4 466

#define NOTE_B4  494

#define NOTE_C5  523

#define NOTE_CS5 554

#define NOTE_D5  587

#define NOTE_DS5 622

#define NOTE_E5  659

#define NOTE_F5  698

#define NOTE_FS5 740

#define NOTE_G5  784

#define NOTE_GS5 831

#define NOTE_A5  880

#define NOTE_AS5 932

#define NOTE_B5  988

#define NOTE_C6  1047

#define NOTE_CS6 1109

#define NOTE_D6  1175

#define NOTE_DS6 1245

#define NOTE_E6  1319

#define NOTE_F6  1397

#define NOTE_FS6 1480

#define NOTE_G6  1568

#define NOTE_GS6 1661

#define NOTE_A6  1760

#define NOTE_AS6 1865

#define NOTE_B6  1976

#define NOTE_C7  2093

#define NOTE_CS7 2217

#define NOTE_D7  2349

#define NOTE_DS7 2489

#define NOTE_E7  2637

#define NOTE_F7  2794

#define NOTE_FS7 2960

#define NOTE_G7  3136

#define NOTE_GS7 3322

#define NOTE_A7  3520

#define NOTE_AS7 3729

#define NOTE_B7  3951

#define NOTE_C8  4186

#define NOTE_CS8 4435

#define NOTE_D8  4699

#define NOTE_DS8 4978

 

//* 8-ohm speaker on digital pin 8

// http://arduino.cc/en/Tutorial/Tone

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

 

// notes in the melody:

int melody[] = {

  NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4};

 

// note durations: 4 = quarter note, 8 = eighth note, etc.:

int noteDurations[] = { 4, 8, 8, 4, 4, 4, 4, 4 };

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D027~D029:PassiveBuz");

 

  // iterate over the notes of the melody:

  for (int thisNote = 0; thisNote < 8; thisNote++) {

    // to calculate the note duration, take one second 

    // divided by the note type.

    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.

    int noteDuration = 1000/noteDurations[thisNote];

    tone(8, melody[thisNote],noteDuration);

 

    // to distinguish the notes, set a minimum time between them.

    // the note's duration + 30% seems to work well:

    int pauseBetweenNotes = noteDuration * 1.30;

    delay(pauseBetweenNotes);

    // stop the tone playing:

 

    lcd.setCursor(0,1);

    lcd.print("[" + (String)thisNote + "] M="+(String)melody[thisNote]+" D="+(String)noteDuration );

    noTone(8);

  } 

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Active Buzzer [D026]



https://www.youtube.com/watch?v=JzI7O5Gpwgw


* GitHubhttps://github.com/rdiot/rdiot-d026.git


* Specs

5v Magnetic Continuous Tone Active Buzzer. Listing is for 2 buzzers.


* Contents

- Connect

+ ----- 5V

- ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int BUZZER = 8;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(BUZZER,OUTPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

  lcd.setCursor(0,0);

  lcd.print("D026 Active Buzzer");


  digitalWrite(BUZZER,HIGH);

  lcd.setCursor(0,1);

  lcd.print("buzzer HIGH");

  delay(1000);


  digitalWrite(BUZZER,LOW);

  lcd.setCursor(0,1);

  lcd.print("buzzer LOW ");

  delay(1000);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

ACS712T Current Sensor Module 20A (ACS712T) [B039]



https://www.youtube.com/watch?v=6NuyGoSPYO4


* Specs

Supply Voltage (VCC) 5Vdc Nominal

Measurement Range -20 to +20 Amps

Voltage at 0A VCC/2 (nominally 2.5Vdc)

Scale Factor 100 mV per Amp

Chip ACS712ELC-10A


* Contents

- Connect

VCC ---- 5V 

OUT ----- A0 

GND ----- GND 


Power+VCC -> Load/Sensor -> ACS712T (UP)

Power GND  ---------------> ACS712T (DOWN)


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004


const int analogIn = A0;

int mVperAmp = 100; // use 100 for 20A Module and 66 for 30A Module

int RawValue= 0;

int ACSoffset = 2512; // default 2500 but i checked when this is disconnected to 2512

double Voltage = 0;

double Amps = 0;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(analogIn,INPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("B039:ACS712T Current");


  RawValue = analogRead(analogIn);

  Voltage = (RawValue / 1023.0) * 5000; // Gets you mV

  Amps = ((Voltage - ACSoffset) / mVperAmp);


  lcd.setCursor(0,1);

  lcd.print("RawValue=" + (String)RawValue + "  ");


  lcd.setCursor(0,2);

  lcd.print("Voltage=" + (String)Voltage + "");


  lcd.setCursor(0,3);

  lcd.print("=>Current=" + (String)Amps + " A ");  


  delay(1500);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

LCD2004 I2C Green (LCD2004A) [D046]



https://www.youtube.com/watch?v=rVxFB_l_hGc


*GitHub : https://github.com/rdiot/rdiot-d046.git

* Contents

- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x20 for a 16 chars and 2 line display

 

void setup()

{

  lcd.init();                      // initialize the lcd 

  // Print a message to the LCD.

  lcd.backlight();

  lcd.setCursor(4,0);

  lcd.print("Hello, World");

  lcd.setCursor(2,1);

  lcd.print("LCD2004 I2C TEST");

   lcd.setCursor(0,2);

  lcd.print("Arduino LCM IIC 2004");

   lcd.setCursor(2,3);

  lcd.print("Always thank you.");

}

'3) Actuator > LCD' 카테고리의 다른 글

LCD Keypad Shield Green (LCD1602) [D043]  (0) 2016.09.21
LCD Keypad Shield (LCD1602) [D038]  (0) 2016.09.21
LCD2004 I2C Green (LCD2004A) [D046]  (0) 2016.09.21
LCD2004 I2C ( LCD2004A) [D017]  (0) 2016.09.21
LCD1602 I2C (LCD1602) [D016]  (0) 2016.09.21
LCD1602 (HD44780) [D002]  (0) 2016.09.21
Posted by RD IoT RDIoT

댓글을 달아 주세요

LCD2004 I2C ( LCD2004A) [D017]



https://www.youtube.com/watch?v=Yt-eYSfoH1M


*GitHub : https://github.com/rdiot/rdiot-d017.git



* Contents

- DataSheet : http://www.elecrow.com/download/2004%20Datasheet.pdf

- Connect

GND  ------------------  GND

VCC  ------------------   5V

SDA  ------------------   A4

SCL  ------------------   A5

: Mega(SDA-D20, SCL-D21), Leo(SDA-D2, SCL-D3)


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x20 for a 16 chars and 2 line display

 

void setup()

{

  lcd.init();                      // initialize the lcd 

  // Print a message to the LCD.

  lcd.backlight();

  lcd.setCursor(4,0);

  lcd.print("Hello, World");

  lcd.setCursor(2,1);

  lcd.print("LCD2004 I2C TEST");

   lcd.setCursor(0,2);

  lcd.print("Arduino LCM IIC 2004");

   lcd.setCursor(2,3);

  lcd.print("Always thank you.");

}

'3) Actuator > LCD' 카테고리의 다른 글

LCD Keypad Shield Green (LCD1602) [D043]  (0) 2016.09.21
LCD Keypad Shield (LCD1602) [D038]  (0) 2016.09.21
LCD2004 I2C Green (LCD2004A) [D046]  (0) 2016.09.21
LCD2004 I2C ( LCD2004A) [D017]  (0) 2016.09.21
LCD1602 I2C (LCD1602) [D016]  (0) 2016.09.21
LCD1602 (HD44780) [D002]  (0) 2016.09.21
Posted by RD IoT RDIoT

댓글을 달아 주세요

Bargraph Segment LED Module (SHB10R) [D024]



https://www.youtube.com/watch?v=-Qtzp6CA7Cc


*GitHubhttps://github.com/rdiot/rdiot-d024.git


* Specs

These 10 segment bar graph LEDs have many uses. With a compact footprint, and a simple hookup, they are easy for prototyping or finished products. Essentially, they are 10 individual red LEDs housed together.


Forward Current (Per Segment): 25mA

Max Reverse Voltage: 5v

10 segment bar

Color: Super Bright Red

Industrial standard size

Low power consumption

Categorized for luminous intensity 


* Contents

- Connect

1  ----- D2  - R220 - GND

2  ----- D3  - R220 - GND

3  ----- D4  - R220 - GND

4  ----- D5  - R220 - GND

5  ----- D6  - R220 - GND

6  ----- D7  - R220 - GND

7  ----- D8  - R220 - GND

8  ----- D9  - R220 - GND

9  ----- D10  - R220 - GND

10  ----- D11  - R220 - GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

 

int segPins[] = { 2,3,4,5,6,7,8,9,10,11 };

int idxBar = 0;

int minVal = 50;

int maxVal = 350;

int delayTime = 200;

 

byte digitsFill[10][10] = {

  {1,0,0,0,0,0,0,0,0,0},

  {1,1,0,0,0,0,0,0,0,0},

  {1,1,1,0,0,0,0,0,0,0},

  {1,1,1,1,0,0,0,0,0,0},

  {1,1,1,1,1,0,0,0,0,0},

  {1,1,1,1,1,1,0,0,0,0},

  {1,1,1,1,1,1,1,0,0,0},

  {1,1,1,1,1,1,1,1,0,0},

  {1,1,1,1,1,1,1,1,1,0},

  {1,1,1,1,1,1,1,1,1,1}

};

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  for (int i=0; i<11; i++)

  {

    pinMode(segPins[i], OUTPUT);

  }

 

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

  lcd.setCursor(0,0);

  lcd.print("D024:Bargraph LED");

 

  idxBar = map(analogRead(A0), minVal, maxVal, 0, 9);

 

  lcd.setCursor(0,1);

  lcd.print("analog=" + (String)analogRead(A0) + "  ");

 

  for(int j=0; j<10; j++)

  {

    digitalWrite(segPins[j], digitsFill[idxBar][j]);

 

    lcd.setCursor(0,2);

    lcd.print("idxBar="+(String)idxBar+" "); 

  }

   delay(delayTime);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Magic Cup Light Module (KY-027) [D020]



https://www.youtube.com/watch?v=yrBU-JRPk8M


*GitHub : https://github.com/rdiot/rdiot-d020.git


* Specs

Magic Light Cup modules are easy to Interactive Technology Division developed a can and ARDUINO interactive modules, PWM dimming principle is to use the principle of two modules brightness changes. Mercury switches provide a digital signal that triggers the PWM regulator, through the program design, We can see the light like two cups filled with the effect of shuffling back and forth.


* Contents

- Connect

G ----- GND

+ ----- X

S ----- D10

L ----- D11


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

 

int pinLed = 11;

int pinInput = 10;

 

int stateA = 0;

int brightness = 0;

int oldBrightness = 0;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  pinMode(pinLed, OUTPUT);

  pinMode(pinInput, INPUT);  delay(1000);

  digitalWrite(pinInput, HIGH);

 

  lcd.clear();

}

 

void loop()

  lcd.setCursor(0,0);

  lcd.print("D020:Magic Cup Light");

 

  stateA = digitalRead(pinInput);

 

  if (stateA == HIGH && brightness < 255)

    brightness++;

  if (stateA == LOW && brightness >0)

    brightness--;

  if (oldBrightness != brightness)

  {

    lcd.setCursor(0,1);

    lcd.print("brightness=" + (String)brightness + "  ");

  }

  oldBrightness = brightness;

  analogWrite(pinLed, brightness);

  delay(10); 

}

'3) Actuator > LED' 카테고리의 다른 글

Arrow Indicator 14 SMD LED Blue [D077]  (0) 2016.09.19
Bargraph Segment LED Module (SHB10R) [D024]  (0) 2016.09.19
Magic Cup Light Module (KY-027) [D020]  (0) 2016.09.18
RGB LED Module SMD (KY-009) [D008]  (0) 2016.09.18
RGB LED Module DIP (KY-016) [D007]  (0) 2016.09.18
RGB LED (BL-L515) [D006]  (0) 2016.09.18
Posted by RD IoT RDIoT

댓글을 달아 주세요

MF-A03 Knob + Sheet Scale (MF-A03) [S216]



https://www.youtube.com/watch?v=uAHpbNTsiUc


* Specs

A03 dial knob + MF-A03 bakelite knob with scale plate / sheet scale digital potentiometer

Posted by RD IoT RDIoT

댓글을 달아 주세요

Linear Potentiometer B1K~B1M (B1K~B1M) [S070]




https://www.youtube.com/watch?v=XWHGxC1BT80


*GitHub https://github.com/rdiot/rdiot-s070.git



* Contents

- Connect

Left ----- D8

Middle ----- LED + 

 

LED (+) ----- Potentiometer Middle

LED (-) ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int pin=8;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

  pinMode(pin, OUTPUT);


  digitalWrite(pin,HIGH);

  delay(1000);


  lcd.clear();

}


void loop()

{

  lcd.setCursor(0,0);

  lcd.print("S070:B1K~B1M");


  lcd.setCursor(0,1);

  lcd.print("analog=" + (String)analogRead(A0) + " ");

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Slide Pot 10K Module [S061]



https://www.youtube.com/watch?v=cJkjxeIvFuM


*GitHub : https://github.com/rdiot/rdiot-s061.git



* Specs

Two analog outputs, analog outputs 0-VCC voltage signals

Size: 90 * 20mm / 0.39*0.78"

Voltage: 3.3V or 5V

Port: Analog

Resistance: 10K

Quantity:1pc


* Contents

- Connect

GND ----- X 

VCC ----- X

OTB ----- A1

GND ----- GND

VCC -----5V

OTA -----  A0


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int pot1Pin = A0;

int pot2Pin = A1;

 

int val;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  delay(1000);

  lcd.clear();

}

 

void loop()

{

  lcd.setCursor(0,0);

  lcd.print("S061:Slide Pot");

 

  lcd.setCursor(0,1);

  lcd.print("OTA=" + (String)analogRead(pot1Pin) + " -> " + (String)map(analogRead(pot1Pin), 0, 1021, 0, 100)  + "     " );

 

  lcd.setCursor(0,2);

  lcd.print("OTB=" + (String)analogRead(pot2Pin) + " -> " + (String)map(analogRead(pot2Pin), 0, 1021, 0, 100)  + "     ");

 

  delay(10);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Taper Rotary Potentiometer B10K (B10K) [S060]



https://www.youtube.com/watch?v=VMQ_LH0NPps


*GitHubhttps://github.com/rdiot/rdiot-s060.git


* Specs

Manufacturer: ALPHA

Manufacturer Part No: B10K OHM 17mm

Comes with Dust Seal


Specifications

Adjustment Type: Top Adjustment

Power: 1/2W

Resistance: 10K OHM OHMS

Type: Linear

Type B

Features

Knurled Shaft

Suits Most Standard knobs

Shaft Diameter: 6mm

Shaft Length: 10mm

Mounting Hole: 7.5mm

Base Diameter: 16mm


* Contents

- Connect

Left - 5V

Middle - A0 (OUT)

Right - GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int potPin = A0;

int val;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  //pinMode(potPin, INPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

  lcd.setCursor(0,0);

  lcd.print("S060:B10K");


  val = analogRead(potPin);


  lcd.setCursor(0,1);

  lcd.print("analog=" + (String)val + "  " );


  val = map(val, 0, 1021, 100, 1);

 

  lcd.setCursor(0,2);

  lcd.print("val1~100=" + (String)val + "  " );


  delay(10);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Amp Pot B5K (B5K) [S027]



https://www.youtube.com/watch?v=7J1AMx28ROs


* Specs

5k

2W @ 70°C ambient

Non-rotational key

Temp. range: -55°C to +120°C

Shaft length: 0.875" 

Shaft dia.: 0.25"

Mounting hole: 0.375" 

Max. panel thickness: 0.25"


* Contents

- Connect

Potentiometer

LEFT - 5V

MIDDLE - A0 (OUT)

RIGHT - GND


Servo

Black - GND

Red - 5V

Red -  D12


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include <Servo.h> 


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

Servo myservo; 

int servoPin = 12;

int potPin = A0;

int val;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  myservo.attach(servoPin); 

  delay(1000);


  lcd.clear();

}


void loop()

{


  val = analogRead(potPin);

  val = map(val, 0, 1023, 0, 179);

 

  lcd.setCursor(0,0);

  lcd.print("S027:B5K");


  myservo.write(val);

  lcd.setCursor(0,1);

  lcd.print("pos0~179=" + (String)val + "  " );


  delay(10); 

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

ADXL335 3-axis Accelerometer (GY-61) [S057]



https://www.youtube.com/watch?v=VhsJ0hoZzxo


*GitHubhttps://github.com/rdiot/rdiot-s057.git


* Specs

This is a very low cost break out module for the ADXL335 tripple axis accelerometer. This module includes optional header pins and provides easy access to the X, Y and Z axis analogue outputs from the accelerometer. 

It is capable of sensing forces up to 3g in all axis. A 3.3V on-board regulator is also provided allowing the module to be powered from a 3.3 to 5V power supply source.


Model number: HCMODU0070

Supply Range: 3V ~ 5V

3 Axis sensing

Full scale range: +/-3g

Sensitivity: 300mV/g (Typ)

Pinout, schematic and datasheet available after purchase.


* Contents

- Connect

Arduino Uno 

3.3V ----- VCC 

      ----- AREF

ADXL335 

VCC ----- 3.3V 

X-OUT ----- A0 

Y-OUT ----- A1 

Z-OUT ----- A2 

GND ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

const int xpin = A0;                  // x-axis of the accelerometer

const int ypin = A1;                  // y-axis

const int zpin = A2;                  // z-axis (only on 3-axis models)

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  analogReference(EXTERNAL);

  pinMode(xpin, INPUT);

  pinMode(ypin, INPUT);

  pinMode(zpin, INPUT);

 

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S057:ADXL335 3axisA");

 

  int x = analogRead(xpin);

    delay(1);

  int y = analogRead(ypin);

    delay(1);

  int z = analogRead(zpin);

  //zero_G is the reading we expect from the sensor when it detects

  //no acceleration.  Subtract this value from the sensor reading to

  //get a shifted sensor reading.

  float zero_G = 512.0;

  

  //scale is the number of units we expect the sensor reading to

  //change when the acceleration along an axis changes by 1G.

  //Divide the shifted sensor reading by scale to get acceleration in Gs.

  float scale = 102.3;

 

  float xp = ((float)x - zero_G)/scale;

  float yp = ((float)y - zero_G)/scale;

  float zp = ((float)z - zero_G)/scale;

 

  lcd.setCursor(0,1);

  lcd.print("ax="+ (String)x +" x=" + (String)xp);

 

  lcd.setCursor(0,2);

  lcd.print("ay="+ (String)y +" y=" + (String)yp);

 

  lcd.setCursor(0,3);

  lcd.print("az="+ (String)z +" z=" + (String)zp);

 

  delay(500); 

}

'2) Sensor > Accelerometer' 카테고리의 다른 글

ADXL335 3-axis Accelerometer (GY-61) [S057]  (0) 2016.09.17
Posted by RD IoT RDIoT

댓글을 달아 주세요

Barometric Pressure Altitude BMP180 (BMP180) [S074]



https://www.youtube.com/watch?v=XPFTwPbBXpM


*GitHub : https://github.com/rdiot/rdiot-s074.git


* Specs

Measuring the absolute pressure of the enviroment using a digital barometer such as this has some interesting applications. By converting the pressure measured into altitude, you have a reliable sensor for determining the height of your robot, plane or projectile!

Using a sensor as capable as the BMP180 you can achieve accurary of 1m, with noise of only 17cm in ultra high resolution noise. The device will operate at only 0.3uA meaning low current draw for battery powered applications.


The BMP180 comes fully calibrated and ready to use. As the device operates over I2C we've added optional I2C pull ups that can be enabled using the PU (pull up) jumper on the board for your convenience and ease during breadboarding.


Using I2C, the device provides pressure and temperature as 16bit values, which are used along with calibration data within the device are used to provide a temperature compensated altitude calculation.


This device is really easy to use, if your thinking of using it with an  then you need to check out our BMP180 tutorial! 

Features:

1.8V to 3.6V Supply Voltage

Low power consumption - 0.5uA at 1Hz

I2C interface

Max I2C Speed: 3.5Mhz

Very low noise - up to 0.02hPa (17cm)

Full calibrated

Pressure Range: 300hPa to 1100hPa (+9000m to -500m)

Weight: 1.18g

Size: 21mm x 18mm


* Contents

- Connect

VIN ----- 5V

GND ------ GND

SCL ----- A5

SDA ----- A4


- Library : https://github.com/jrowberg/i2cdevlib

 : Sample Test : BMP085, I2Cdev


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

 

// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation

// is used in I2Cdev.h

#include "Wire.h"

 

// I2Cdev and BMP085 must be installed as libraries, or else the .cpp/.h files

// for both classes must be in the include path of your project

#include "I2Cdev.h"

#include "BMP085.h"

 

// class default I2C address is 0x77

// specific I2C addresses may be passed as a parameter here

// (though the BMP085 supports only one address)

BMP085 barometer;

 

float temperature;

float pressure;

float altitude;

int32_t lastMicros;

 

#define LED_PIN 13 // (Arduino is 13, Teensy is 11, Teensy++ is 6)

bool blinkState = false;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  // join I2C bus (I2Cdev library doesn't do this automatically)

  Wire.begin();

  barometer.initialize();

 

  pinMode(LED_PIN, OUTPUT);

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S074:BMP180");

 

    // request temperature

    barometer.setControl(BMP085_MODE_TEMPERATURE);

    

    // wait appropriate time for conversion (4.5ms delay)

    lastMicros = micros();

    while (micros() - lastMicros < barometer.getMeasureDelayMicroseconds());

 

    // read calibrated temperature value in degrees Celsius

    temperature = barometer.getTemperatureC();

 

    // request pressure (3x oversampling mode, high detail, 23.5ms delay)

    barometer.setControl(BMP085_MODE_PRESSURE_3);

    while (micros() - lastMicros < barometer.getMeasureDelayMicroseconds());

 

    // read calibrated pressure value in Pascals (Pa)

    pressure = barometer.getPressure();

 

    // calculate absolute altitude in meters based on known pressure

    // (may pass a second "sea level pressure" parameter here,

    // otherwise uses the standard value of 101325 Pa)

    altitude = barometer.getAltitude(pressure);

 

    // display measured values if appropriate

    lcd.setCursor(0,1);

    lcd.print("Temperature=" + (String)temperature + "  ");

 

    lcd.setCursor(0,2);

    lcd.print("Pressure=" + (String)pressure + "  ");

 

    lcd.setCursor(0,3);

    lcd.print("Altitude=" + (String)altitude + "  ");

 

    // blink LED to indicate activity

    blinkState = !blinkState;

    digitalWrite(LED_PIN, blinkState);

    

    // delay 100 msec to allow visually parsing blink and any serial output

    delay(100); 

}

'2) Sensor > Barometric_Pressure' 카테고리의 다른 글

Barometric Pressure Altitude BMP180 (BMP180) [S074]  (0) 2016.09.17
Posted by RD IoT RDIoT

댓글을 달아 주세요

4 Channel IR Tracking Module [S075]



https://www.youtube.com/watch?v=MOsxmBge2wU


*GitHubhttps://github.com/rdiot/rdiot-s075.git


* Specs

Working voltage: DC 3.3V-5V

Working current: try to choose more than 1A power supply

Working temperature: - 10oC - +50oC

Mounting aperture: M3 screws

Detection range: 1mm to 60 CM adjustable, the closer the performance more stable, white reflects the farthest distance.

Size: in the control panel of 42mm * 38mm * 12mm (length * width * height)

Small forward 25mm * 12mm * 12mm (length * width * height)

Output interface: 6 wire interface (1234 to 4 signal output ends, + positive power, - for the negative power is ground)

The output signal: TTL level (can be directly connected to I/0 microcontroller, infrared light reflected back to the sensor induction, the red indicator light, output low level; no infrared light, the indicator light does not shine, the output high.)


* Contents

- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int IN1 = 2;

int IN4 = 5;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(IN1,INPUT);

  pinMode(IN4,INPUT);


  delay(1000);


  lcd.clear();

}


void loop()

{

  lcd.setCursor(0,0);

  lcd.print("S075:4CHIR Tracking");


  String val1str = "";

  String val4str = "";


  int in1_val = digitalRead(IN1);

  int in4_val = digitalRead(IN4);


  if(in1_val == 0)

    val1str = " detected";

  else 

    val1str = "         ";


  if(in4_val == 0)

    val4str = " detected";

  else

    val4str = "         ";


  lcd.setCursor(0,1);

  lcd.print("IN1=" + (String)in1_val + val1str);


  lcd.setCursor(0,2);

  lcd.print("IN4=" + (String)in4_val + val4str);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Tracking Sensor Module Obstacle Avoidance (KY-033) [S026]



https://www.youtube.com/watch?v=11V1Tuf-Sc8


*GitHub https://github.com/rdiot/rdiot-s026.git


* Specs

Operating voltage: 2.5V - 12V(cannot over 12V)

Working current: 18mA - 20mA at 5V

Output electrical level signal: low level when detecting objects / high level when no objects / 0 or 1 decides if objects exist.


* Contents

- Connect

GND ----- GND

OUT ----- D2

VCC ----- 5V


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004


int T = 2; // INPUT PIN

int count = 0;

String dot = ".";


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(T, INPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{


  if(count >= 20)

  {

    dot = "";

    lcd.clear();

    count = 0;

  }

 

  lcd.setCursor(0,0);

  lcd.print("S026:KY-033 Tracking");


  if (LOW == digitalRead(T))

  {

    dot += "Detected";


    lcd.setCursor(0,1);

    lcd.print(dot);

    count = count+8;

  }

  else

  {

    dot += ".";

    lcd.setCursor(0,1);

    lcd.print(dot);

    count++;

  }

  delay(100);


}

Posted by RD IoT RDIoT

댓글을 달아 주세요

4 Head Infrared Transmitter Module [S180]




https://www.youtube.com/watch?v=ZpDeUjWLtsM


*GitHubhttps://github.com/rdiot/rdiot-s180.git


* Specs

Dimensions : 35 * 35mm

Weight : 4g

Voltage : 5V

Ports : Digital Level

Modulation : Direct emission unmodulated

Emission head : 4

Transmitting distance : 1-3m

Wavelength : 940nm


Four launch, multi-directional signal synchronization

A wide range of signal radiation 

With the transmitted signal indicating LED, easy to observe debugging 

Small infrared signal transmitter can be used as the source


* Contents

- Connect

GND ----- GND

VCC ----- 5V

DAT ----- D3


- Key Code

#include <IRremote.h>

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x20 for a 16 chars and 2 line display


//* An IR LED must be connected to Arduino PWM pin 3.

IRsend irsend;

 

void setup()

{

  lcd.init();    // initialize the lcd 

  // Print a message to the LCD.

  lcd.backlight();

}


int count = 0;

void loop() {

 

  int khz = 38; // 38kHz carrier frequency for the NEC protocol

  unsigned int  rawData[67] = {4500,4400, 600,1650, 550,1650, 650,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,1650, 600,1650, 550,1650, 600,550, 550,550, 550,550, 550,550, 550,550, 600,500, 600,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,550, 600,1600, 600,550, 550,1650, 600,1650, 550,1650, 600,1650, 600,1650, 550,1650, 600};  // SAMSUNG E0E040BF

unsigned int  data = 0xE0E040BF;

 

  irsend.sendRaw(rawData, sizeof(rawData) / sizeof(rawData[0]), khz); //Note the approach used to 


automatically calculate the size of the array.

  

  lcd.setCursor(0,0);

  lcd.print("S180:4 Head IR Trans.");

  lcd.setCursor(0,1);

  count++;

  lcd.print("every 5sec count: "+(String)count+" ");

  lcd.setCursor(0,2);

  lcd.print("data=0xE0E040BF");

 

  delay(5000); //In this example, the signal will be repeated every 5 seconds, approximately.

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

IR Transmitter Module [S066]



https://www.youtube.com/watch?v=dSP6zp6fjdE


*GitHubhttps://github.com/rdiot/rdiot-s066.git



* Specs

Product Name IR Transmitter Module

Working Voltage DC 5V

Pin Quantity 3

Body Size 21 x 22 x 5mm/0.83" x 0.87" x 0.2"(L*W*T)

Material Plastic, Electronic Part

Main Color As Picture Show

Net Weight 5g

Package Content 1 x IR Transmitter Module


* Contents

- Connect

Transmitter

GND - GND

VCC - 5V

DAT - D3 (When RAW)


Receiver

pin- - GND

middle pin - 5V

S - D11


- Key Code

Transmitter

#include <IRremote.h>

//* An IR LED must be connected to Arduino PWM pin 3.

IRsend irsend;

void loop() {

 

  int khz = 38; // 38kHz carrier frequency for the NEC protocol

 

  unsigned int  rawData[67] = {4500,4400, 600,1650, 550,1650, 650,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,1650, 600,1650, 550,1650, 600,550, 550,550, 550,550, 550,550, 550,550, 600,500, 600,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,550, 600,1600, 600,550, 550,1650, 600,1650, 550,1650, 600,1650, 600,1650, 550,1650, 600};  // SAMSUNG E0E040BF

  unsigned int  data = 0xE0E040BF;

 

  irsend.sendRaw(rawData, sizeof(rawData) / sizeof(rawData[0]), khz); //Note the approach used to automatically calculate the size of the array.

 

  delay(5000); //In this example, the signal will be repeated every 5 seconds, approximately.

}


Receiver

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include "IRremote.h"

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int receiver = 11; // pin 1 of IR receiver to Arduino digital pin 11

 

IRrecv irrecv(receiver);           // create instance of 'irrecv'

decode_results results;            // create instance of 'decode_results'

String str_hex = "";

String str_value = "";

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  irrecv.enableIRIn(); // Start the receiver

 

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S066:IR Transmitter");

  

  if (irrecv.decode(&results)) // have we received an IR signal?

  {

    //    Serial.println(results.value, HEX);  UN Comment to see raw values

    translateIR(); 

 

    lcd.setCursor(0,1);

    lcd.print("str_hex=" + (String)str_hex);

    lcd.setCursor(0,2);

    lcd.print("str_value=" + (String)str_value);

 

    irrecv.resume(); // receive the next value

  }   

}

 

void translateIR() // takes action based on IR code received

{

  switch(results.value)

  {

 

  case 0xE0E040BF:  

    str_hex = "0xE0E040BF";

    str_value = "power off ";

    break;

 

  default: 

    str_hex = (String)results.value;

    str_value = "NONE      ";

 

  } 

  delay(500);

 

} //END translateIR

Posted by RD IoT RDIoT

댓글을 달아 주세요

ENC28J60 Ethernet Module (ENC28J60) [S058]





https://www.youtube.com/watch?v=CQpMqNqUW_8


*GitHubhttps://github.com/rdiot/rdiot-s058.git


* Specs

The ENC28J60 Ethernet Module utilizes the new Microchip ENC28J60 Stand-Alone Ethernet Controller IC featuring a host of features to handle most of the network protocol requirements. The board connects directly to most microcontrollers with a standard SPI interface with a transfer speed of up to 20MHz.

ENC28J60 Ethernet chips, SOP28 package

SPI Interface

2X5 connector, can be easily mounted with the MCU

Power indicator

Single Supply: +3.3 V

PCB size: 55x36 mm


* Contents

- Connect (Uno)

VCC -   3.3V

SCK - Pin 13

SO  - Pin 12

SI  - Pin 11

CS  - Pin  8 # Selectable with the ether.begin() function

GND - GND


- Connect (Mega)

VCC -   3.3V

GND -    GND

SCK - Pin 52

SO  - Pin 50

SI  - Pin 51

CS  - Pin 53 # Selectable with the ether.begin() function

# The default CS pin defaults to 8, so you have to set it on a mega:

ether.begin(sizeof Ethernet::buffer, mymac, 53)


- Library : https://github.com/ice3x2/ethercard

- Library Download : https://github.com/jcw/ethercard/archive/master.zip


- Key Code

#include <EtherCard.h>

#define REQUEST_RATE 5000 // milliseconds


// ethernet interface mac address

static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };

// remote website name

const char website[] PROGMEM = "sports.news.naver.com";


byte Ethernet::buffer[700];

static long timer;


  if (!ether.dhcpSetup())

    Serial.println("DHCP failed");

  

  ether.printIp("My IP: ", ether.myip);

  // ether.printIp("Netmask: ", ether.mymask);

  ether.printIp("GW IP: ", ether.gwip);

  ether.printIp("DNS IP: ", ether.dnsip);


  timer = - REQUEST_RATE; // start timing out right away


// called when the client request is complete

static void my_result_cb (byte status, word off, word len) {

  Serial.print("<<< reply ");

  int val = millis() - timer;

  Serial.print(val);

  Serial.println(" ms");

  Serial.println((const char*) Ethernet::buffer + off);


  lcd.setCursor(0,3);

  lcd.print("reply=" + (String)val + " ms   ");

}

'2) Sensor > Ethernet' 카테고리의 다른 글

ENC28J60 Ethernet Module (ENC28J60) [S058]  (0) 2016.09.17
Posted by RD IoT RDIoT

댓글을 달아 주세요

Finger Heartbeat Detection Sensor Module (KY-039) [S033]




https://www.youtube.com/watch?v=PlpGS6BdtK4


*GitHubhttps://github.com/rdiot/rdiot-s033.git


* Specs

KY-039 Finger Detector Heartbeat Detection Sensor Module For Arduino

Specification:

Working voltage: 5V

Use IR LED and optical transistor to detect pulsation in fingers

Used for synthesized teaching experiment

Dimensions: 25 x 22 x 17mm

Weight: 2g


* Contents 



- Connect

S ----- A0

Middle ----- 5V

- ----- GND


Schematic



- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#define HBDEBUG(i)

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

 

int sensorPin = A0;

double alpha = 0.75;

int period = 100;

double change = 0.0;

double minval = 0.0;

const int delayMsec = 60; // 100msec per sample


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

  Serial.begin(9600);

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S033:KY-039");

 

 

  static double oldValue = 0;

  static double oldChange = 0;

  int rawValue = analogRead (sensorPin);

  double value = alpha * oldValue + (1 - alpha) * rawValue;

 

  lcd.setCursor(0,1);

  lcd.print("rawValue=" + (String)rawValue + "   ");

 

  oldValue = value;

 

 

  static int beatMsec = 0;

  int heartRateBPM = 0;

  

  if (heartbeatDetected(sensorPin, delayMsec)) {

    heartRateBPM = 60000 / beatMsec;

    //digitalWrite(ledPin,1);

 

    // Print msec/beat and instantaneous heart rate in BPM

    //Serial.print(beatMsec);

    

    lcd.setCursor(0,2);

    lcd.print("beatMsec=" + (String)beatMsec + "    ");

 

 

    lcd.setCursor(0,3); 

     lcd.print("BPM=" + (String)heartRateBPM + "    ");

 

    beatMsec = 0;

  } else {

    //digitalWrite(ledPin,0);

  }


  delay(delayMsec);

  beatMsec += delayMsec;

 

 

  //delay (period);

}

 

bool heartbeatDetected(int IRSensorPin, int delay)

{

  static int maxValue = 0;

  static bool isPeak = false;

  int rawValue;

  bool result = false;

    

  rawValue = analogRead(IRSensorPin);

  // Separated because analogRead() may not return an int

  rawValue *= (1000/delay);

  HBDEBUG(Serial.print(isPeak); Serial.print("p, "));

  HBDEBUG(Serial.print(rawValue); Serial.print("r, "));

  HBDEBUG(Serial.print(maxValue); Serial.print("m, "));

 

  // If sensor shifts, then max is out of whack.

  // Just reset max to a new baseline.

  if (rawValue * 4L < maxValue) {

    maxValue = rawValue * 0.8;

    HBDEBUG(Serial.print("RESET, "));

  }

  

  // Detect new peak

  if (rawValue > maxValue - (1000/delay)) {

    if (rawValue > maxValue) {

      maxValue = rawValue;

    }

    // Only return true once per peak.

    if (isPeak == false) {

      result = true;

      Serial.print(result); Serial.print(",  *");

    }

    isPeak = true;

  } else if (rawValue < maxValue - (3000/delay)) {

    isPeak = false;

    maxValue-=(1000/delay);

 }

  HBDEBUG(Serial.print("\n"));

  return result;

}

'2) Sensor > Heartbeat_Pulse' 카테고리의 다른 글

Finger Heartbeat Detection Sensor Module (KY-039) [S033]  (0) 2016.09.17
Pulse Sensor [S032]  (0) 2016.09.17
Posted by RD IoT RDIoT

댓글을 달아 주세요

Pulse Sensor [S032]



https://www.youtube.com/watch?v=S2rxaMF0KfY


*GitHubhttps://github.com/rdiot/rdiot-s032.git


* Specs

Heart rate data can be really useful whether you’re designing an exercise routine, studying your activity or anxiety levels or just want your shirt to blink with your heart beat. The problem is that heart rate can be difficult to measure. Luckily, the Pulse Sensor Amped can solve that problem!


The Pulse Sensor Amped is a plug-and-play heart-rate sensor for Arduino. It can be used by students, artists, athletes, makers, and game & mobile developers who want to easily incorporate live heart-rate data into their projects.It essentially combines a simple optical heart rate sensor with amplification and noise cancellation circuitry making it fast and easy to get reliable pulse readings. Also, it sips power with just 4mA current draw at 5V so it’s great for mobile applications.


Simply clip the Pulse Sensor to your earlobe or finger tip and plug it into your 3 or 5 Volt Arduino and you’re ready to read heart rate! The 24" cable on the Pulse Sensor is terminated with standard male headers so there’s no soldering required. Of course Arduino example code is available as well as a Processing sketch for visualizing heart rate data.


* Contents

- Arduino Source : https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino (ZIP)

- Processing Source : https://github.com/WorldFamousElectronics/PulseSensor_Amped_Processing_Visualizer  (ZIP)


- Connect

White - A0

Black - 5V / 3V

Blue - GND


- in processing 

port = new Serial(this, "COM4", 115200);  // make sure Arduino is talking serial at this baud rate


- Key Code

//  Variables

int pulsePin = 0;                 // Pulse Sensor purple wire connected to analog 


pin 0

int blinkPin = 13;                // pin to blink led at each beat

int fadePin = 5;                  // pin to do fancy classy fading blink at each beat

int fadeRate = 0;                 // used to fade LED on with PWM on fadePin

 

// Volatile Variables, used in the interrupt service routine!

volatile int BPM;                   // int that holds raw Analog in 0. updated every 2mS

volatile int Signal;                // holds the incoming raw data

volatile int IBI = 600;             // int that holds the time interval between beats! Must be seeded! 

volatile boolean Pulse = false;     // "True" when User's live heartbeat is detected. "False" when not a "live beat". 

volatile boolean QS = false;        // becomes true when Arduoino finds a beat.

 

// Regards Serial OutPut  -- Set This Up to your needs

static boolean serialVisual = false;   // Set to 'false' by Default.  Re-set to 'true' to see Arduino Serial Monitor ASCII Visual Pulse 

 

 

/* interruptsetup */

volatile int rate[10];                    // array to hold last ten IBI values

volatile unsigned long sampleCounter = 0;          // used to determine pulse timing

volatile unsigned long lastBeatTime = 0;           // used to find IBI

volatile int P =512;                      // used to find peak in pulse wave, seeded

volatile int T = 512;                     // used to find trough in pulse wave, seeded

volatile int thresh = 525;                // used to find instant moment of heart 


beat, seeded

volatile int amp = 100;                   // used to hold amplitude of pulse 


waveform, seeded

volatile boolean firstBeat = true;        // used to seed rate array so we startup 


with reasonable BPM

volatile boolean secondBeat = false;      // used to seed rate array so we startup with reasonable BPM

 


interruptSetup();                 // sets up to read Pulse Sensor signal every 2mS 

'2) Sensor > Heartbeat_Pulse' 카테고리의 다른 글

Finger Heartbeat Detection Sensor Module (KY-039) [S033]  (0) 2016.09.17
Pulse Sensor [S032]  (0) 2016.09.17
Posted by RD IoT RDIoT

댓글을 달아 주세요

ISD 1820 Voice Recording Module (ISD1820) [S082]



https://www.youtube.com/watch?v=cj9h0Bzwcok


*GitHub : 


* Specs

ISD1820 Voice Recording Module is another very interesting stuff. You don't need to prepare a speaker and a mic - both are included in this module! After connecting to the power, you can press REC to record a 10 second voice. Press PLAYE to play the complete voice once. Press and hold PLAYL it will play the voice and it stop when the button is released. It can also be controlled by Arduino. Combined with Laser Detector and Laser Module, you can make a doorbell, security system, and power-saving light along corridor for instance.


* Contents

- Connect

VCC ----- 5V

GND ----- GND

P-E ----- D13

REC ----- D11


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004


int Rec = 11;

int Play = 13;


void setup()

  pinMode(Rec, OUTPUT); 

  pinMode(Play, OUTPUT);


  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  delay(1000);


  lcd.clear();

}


void loop()

{

  lcd.setCursor(0,0);

  lcd.print("S082:ISD1820 Module");


  digitalWrite(Rec, HIGH); // record 10sec

  lcd.setCursor(0,1);

  lcd.print("Rec: HIGH ");


  delay(10000);

  digitalWrite(Rec, LOW); // end record 

  lcd.setCursor(0,1);

  lcd.print("Rec: LOW  ");

  delay(5000);


  digitalWrite(Play, HIGH); // play 

  lcd.setCursor(0,1);

  lcd.print("Play: HIGH");

  delay(100);


  digitalWrite(Play, LOW); // stop play

  lcd.setCursor(0,1);

  delay(10000);

  lcd.print("Play: LOW ");      

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Small Sound Detection Module (KY-038) [S053]



https://www.youtube.com/watch?v=WFB0QkhGm20


* GitHub : https://github.com/rdiot/rdiot-s053.git


* Specs

Dimensions: 1.38 in x 0.59 in x 0.51 in (3.5 cm x 1.5 cm x 1.3 cm)

Weight: 0.11 oz (3 g)

Main chip: LM393

Electret condenser microphone

Working voltage: DC 4-6V

Interface definition:

AO: analog output sensor

GND: ground

VCC: Power supply input range: 3V-24V.

DO: Digital Output (comparator output)

Two red LED indication: POWER and SENSOR. POWER: Power is off.

SENSOR: When the microphone senses sound reaches a certain value, this LED light.


Single channel signal output

Low level output signal used for sound control light

Great module for sound alarm system

LM393 main chip

Electric condenser microphone


* Contents

- Connect

A0 ----- A0

G ----- GND

+ ----- 5V

D0 ----- X


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004


int threshold = 30; 


int led1 = 2;

int led2 = 3;

int led3 = 4;

int led4 = 5;

int led5 = 6;


int pin = A0;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(pin,INPUT);


  pinMode(led1,OUTPUT);

  pinMode(led2,OUTPUT);

  pinMode(led3,OUTPUT);

  pinMode(led4,OUTPUT);

  pinMode(led5,OUTPUT);


  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S052:SoundDetect");


  int val = analogRead(pin);


  lcd.setCursor(0,1);

  lcd.print("val=" + (String)val + "  ");


  if(val <= threshold)

  { 

    lcd.setCursor(0,2);

    lcd.print("                    ");

  }

  else

  {

    lcd.setCursor(0,2);

    lcd.print("Small Sound Detected");

    delay(100);  

  }


  digitalWrite(led1, LOW); 

  digitalWrite(led2, LOW); 

  digitalWrite(led3, LOW); 

  digitalWrite(led4, LOW); 

  digitalWrite(led5, LOW); 

 

  if(val > 30) { digitalWrite(led1, HIGH); }

  if(val > 31) { digitalWrite(led2, HIGH); }

  if(val > 32) { digitalWrite(led3, HIGH); }

  if(val > 35) { digitalWrite(led4, HIGH); }

  if(val > 40) { digitalWrite(led5, HIGH); }


  delay(50);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

Big Sound Detection Module (KY-037) [S052]



https://www.youtube.com/watch?v=jjT-qJG5OhY


* Specs

For sound detection module has two outputs: 

1. AO, analog output, real-time output voltage signal of the microphone 

2. DO, when the sound intensity reaches a certain threshold, the output high and low signal 


Module features: 

1. there is a mounting screw hole 3mm 

2. the use 5v DC power supply 

3. with analog output 

4. there are threshold level output flip 

5. high sensitive microphone and high sensitivity. 

6. a power indicator light 

7. the comparator output is light


* Contents

- Connect

A0 ----- A0

G ----- GND

+ ----- 5V

D0 ----- X 


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

 

int threshold = 600; 

 

int led1 = 2;

int led2 = 3;

int led3 = 4;

int led4 = 5;

int led5 = 6;

 

int pin = A0;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  pinMode(pin,INPUT);

 

  pinMode(led1,OUTPUT);

  pinMode(led2,OUTPUT);

  pinMode(led3,OUTPUT);

  pinMode(led4,OUTPUT);

  pinMode(led5,OUTPUT);

 

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S052:SoundDetect");

 

  int val = analogRead(pin);

 

  lcd.setCursor(0,1);

  lcd.print("val=" + (String)val + "  ");

 

  if(val <= threshold)

  { 

    lcd.setCursor(0,2);

    lcd.print("                  ");

  }

  else

  {

    lcd.setCursor(0,2);

    lcd.print("Big Sound Detected");

    delay(100);  

  }

 

  digitalWrite(led1, LOW); 

  digitalWrite(led2, LOW); 

  digitalWrite(led3, LOW); 

  digitalWrite(led4, LOW); 

  digitalWrite(led5, LOW); 

 

  if(val > 600) { digitalWrite(led1, HIGH); }

  if(val > 605) { digitalWrite(led2, HIGH); }

  if(val > 610) { digitalWrite(led3, HIGH); }

  if(val > 615) { digitalWrite(led4, HIGH); }

  if(val > 620) { digitalWrite(led5, HIGH); }

 

  delay(50);

 

}

Posted by RD IoT RDIoT

댓글을 달아 주세요