'2) Sensor'에 해당되는 글 153건

  1. 2016.09.12 GP2Y1010AU0F Compact Optical Dust Sensor + Adapter (GP2Y1010AU0F,DFR0280) [S065]
  2. 2016.09.12 MQ-2 Sensitive for Methane, Butane, LPG, Smoke (MQ-2) [S100]
  3. 2016.09.11 TPM-300 Air Quality Module (TPM-300) [S092]
  4. 2016.09.11 Air Quality Sensor (MQ135) [S037]
  5. 2016.09.11 Micro SD TF Card Memory Module [S059]
  6. 2016.09.11 DS3231 AT24C32 IIC Clock Module (DS3231SN) [S174]
  7. 2016.09.11 RTC DS1302 Module (DS1302) [S030]
  8. 2016.09.11 Tiny RTC DS1307 I2C Module (DS1307) [S029]
  9. 2016.09.09 8 Channel Solid State Relay Module [S168]
  10. 2016.09.09 12V Delay Timer Adjustable Relay Module (NE555) [S165]
  11. 2016.09.09 5V Relay Low Level Trigger [S155]
  12. 2016.09.09 5V 4-Channel Relay Module [S147]
  13. 2016.09.09 5V 2-Channel Relay Module [S116]
  14. 2016.09.09 5V Relay Module (KY-019) [S076]
  15. 2016.09.09 Mini Reed Switch Module (KY-021) [S045]
  16. 2016.09.09 Reed Swtich Module (KY-025) [S044]
  17. 2016.09.09 Photo Interrupter Module LM393 Comparator (FC-03) [S158]
  18. 2016.09.09 Photo Interrupter Module (KY-010) [S041]
  19. 2016.09.09 Linear magnetic Hall sensor (KY-024) [S048]
  20. 2016.09.09 Hall Magnetic Sensor Module (KY-003) [S047]
  21. 2016.09.09 Analog Hall Magnetic Sensor Module (KY-035) [S046]
  22. 2016.09.09 Ceramic Piezo Vibration Sensor [S133]
  23. 2016.09.09 Knock sensor module (KY-031) [S040]
  24. 2016.09.09 Vibration switch module (KY-002) [S039]
  25. 2016.09.08 Round Force Sensing Resistor (FSR402) [S031]
  26. 2016.09.08 Leap Motion Controller [S179]
  27. 2016.09.08 Mini Infrared PIR Motion Sensor (HC-SR505) [S055]
  28. 2016.09.08 PIR Motion Sensor (HC-SR501) Delay Control [S010]
  29. 2016.09.08 RPI-1031 Angle Sensor Four Direction Sensor (RPI-1031) [S183]
  30. 2016.09.08 Tilt Switch Module (KY-020) [S050]

GP2Y1010AU0F Compact Optical Dust Sensor + Adapter  (GP2Y1010AU0F,DFR0280) [S065]



https://www.youtube.com/watch?v=539hINFrDHM


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


* Specs

GP2Y1010AU0F is a dust sensor by optical sensing system An infrared emitting diode (IRED) and an phototransistor are diagonally arranged into this device It detects the reflected light of dust in air. Especially, it is effective to detect very fine particle like the cigarette smoke In addition it can distinguish smoke from house dust by pulse pattern of output voltage Compact, thin package (46.0 × 30.0 × 17.6 mm) Low consumption current (Icc: MAX. 20 mA) The presence of dust can be detected by the photometry of only one pulse Enable to distinguish smoke from house dust Lead-free and RoHS directive compliant Compliant with RoHS directive (2002/95/EC)


* Contents

- Refer Source : ttps://github.com/Trefex/arduino-airquality/blob/master/Module_Dust-Sensor/dustSensor/dustSensor.ino


- Connect

:Adapter

A ----- A0

VCC ----- V5

GND ----- GND

 

D ----- D2

VCC ----- X (One of Two)

GND ----- X (One of Two)


: Dust Sensor

1 (V-LED) ---(P150)--- 5V 

2 (LED_GND) --(220uF 1 Number)--- GND 

3 (LED) ----- D12

4 (S-GND) ----- GND

5 (V0) ----- A0

6 (Vcc) ----- 5V 



- Key Code

int measurePin = A0;

int ledPower = 2;

 

int samplingTime = 280;

int deltaTime = 40;

int sleepTime = 9680;

 

float voMeasured = 0;

float calcVoltage = 0;

float dustDensity = 0;

 

int B = 9; // OUTPUT PIN blue

int R = 11; // OUTPUT PIN red

int G = 10; // OUTPUT PIN green

 


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

  pinMode(ledPower,OUTPUT);

  pinMode(R, OUTPUT);

  pinMode(G, OUTPUT);

  pinMode(B, OUTPUT);

 

  delay(1000);

  lcd.clear();

}


void loop()

{

  lcd.setCursor(0,0);

  lcd.print("S065:Dust GP2Y1010AU0F");

 

  digitalWrite(ledPower,LOW); // power on the LED

  delayMicroseconds(samplingTime);

 

  voMeasured = analogRead(measurePin); // read the dust value

  

  delayMicroseconds(deltaTime);

  digitalWrite(ledPower,HIGH); // turn the LED off

  delayMicroseconds(sleepTime);

 

  // 0 - 5.0V mapped to 0 - 1023 integer values 

  calcVoltage = voMeasured * (5.0 / 1024); 

  

  dustDensity = (0.17 * calcVoltage - 0.1)*1000; 

  

  lcd.setCursor(0,1);

  lcd.print("Signal=" + (String)voMeasured + " ");

  

  lcd.setCursor(0,2);

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

  

  lcd.setCursor(0,3);

  lcd.print("Density=" + (String)dustDensity + "ug/m3 ");

  

  if(dustDensity <= 40)

  {

   // GREEN

   digitalWrite(R, HIGH);

   digitalWrite(G, LOW);

   

  }

  else if(dustDensity <= 80)

  {

   // BLUE

   digitalWrite(G, HIGH);

   digitalWrite(B, LOW);

 

  }

  else if(dustDensity <= 120)

  {

    // RED + GREEN = YELLOW

    digitalWrite(B, HIGH);

    digitalWrite(R, LOW);

    digitalWrite(G, LOW);

  }

  else

  {

    // RED

    digitalWrite(R, LOW);

    digitalWrite(G, HIGH);

    digitalWrite(B, HIGH);   

  }

 

  delay(1000);

 

  // all off

  digitalWrite(B, HIGH);

  digitalWrite(R, HIGH);

  digitalWrite(G, HIGH);

}

Posted by RDIoT
|

MQ-2 Sensitive for Methane, Butane, LPG, Smoke (MQ-2) [S100]



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


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


* Specs

Sensitive for Methane, Butane, LPG, smoke.

This sensor is sensitive for flamable and combustible gasses.

The heater uses 5V.


Sensitive material of MQ-2 gas sensor is SnO2, which with lower conductivity in clean air. When the

target combustible gas exist, The sensor’s conductivity is more higher along with the gas concentration

rising. Please use simple electrocircuit, Convert change of conductivity to correspond output signal of

gas concentration.

MQ-2 gas sensor has high sensitity to LPG, Propane and Hydrogen, also could be used to Methane

and other combustible steam, it is with low cost and suitable for different application. 



* Contents

- The MQ-2 at seeed: http://www.seeedstudio.com/wiki/Grove_-_Gas_Sensor%28MQ2%29


- DataSheet : https://www.pololu.com/file/0J309/MQ2.pdf


- Key Code

const int gasPin = A0;

  

void setup()

{

    Serial.begin(9600);

}

 

void loop()

{

    Serial.println(analogRead(gasPin));

    

    if (analogRead(gasPin) > 400)  

    {                                     

        tone(12,2000,1000); 

    }  

    delay(1000);

}

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

TPM-300 Air Quality Module (TPM-300) [S092]  (0) 2016.09.11
Air Quality Sensor (MQ135) [S037]  (0) 2016.09.11
Posted by RDIoT
|

TPM-300 Air Quality Module (TPM-300) [S092]



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


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


* Specs

Module type: TPM-300

sensor: the air quality sensor

gas detection: ammonia, hydrogen, alcohol, carbon monoxide, methane, propane, Gan, styrene, propylene 

glycol, alkyl phenol, toluene, ethylbenzene, xylene, formaldehyde and other volatile organic gases, incense smoke, wood, paper burning smoke

physical interface: XH2.54-4 vertical socket

output data: TTL level (built in 200 ohm current limiting resistor)

input voltage: 5 + 0.2VDC (no reverse voltage protection)

working current: less than 80mA

the preheating time: less than 60 seconds

response time: less than 10 seconds

recovery time: less than 20 seconds

operating temperature: -10 - 40 C

the humidity: less than 95%RH

storage temperature: -20 - 60 C

storage humidity: less than 60%RH

dimensions: 24 x 20 x 15 (L * W * H)

module: weight of about 20 grams

sensitivity: 0.5ppm hydrogen

the sensitivity attenuation: less than 1%/ years

: more than 10 years service life


* Contents

- Connect 

B ----- D3

A ----- D2

5V ----- 5V

GND ----- GND


- Level

A              B            Level

Low            Low           0

Low            High          1

High           Low           2

High           High          3


- Key Code 

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


int pinA = 2; // A

int pinB = 3; // B


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


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(pinA, INPUT);

  pinMode(pinB, INPUT);  

  delay(1000);


  lcd.clear();

}

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S092:TPM-300 Air Q");


  int valueA = digitalRead(pinA);

  int valueB = digitalRead(pinB);

  int airGrade = -1;


  lcd.setCursor(0,1);

  lcd.print("pinA(H/L)=" + (String)valueA + " ");

  

  lcd.setCursor(0,2);

  lcd.print("pinB(H/L)=" + (String)valueB + " ");



  if(valueA == LOW && valueB == LOW)

  {

    airGrade = 0;

  }

  else if(valueA == LOW && valueB == HIGH)

  {

    airGrade = 1;

  }

  else if(valueA == HIGH && valueB == LOW)

  {

    airGrade = 2;

  }

  else if(valueA == HIGH && valueB == HIGH)

  {

    airGrade = 3;

  }


  lcd.setCursor(0,3);

  lcd.print("Air Grade 0~3=" + (String)airGrade + " ");


  delay(300);

}

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

MQ-2 Sensitive for Methane, Butane, LPG, Smoke (MQ-2) [S100]  (0) 2016.09.12
Air Quality Sensor (MQ135) [S037]  (0) 2016.09.11
Posted by RDIoT
|

Air Quality Sensor (MQ135) [S037]



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


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


* Specs

Sensitive material of MQ135 gas sensor is SnO2, which with lower conductivity in clean air. When the

target combustible gas exist, The sensor’s conductivity is more higher along with the gas concentration

rising. Please use simple electrocircuit, Convert change of conductivity to correspond output signal of

gas concentration.

MQ135 gas sensor has high sensitity to Ammonia, Sulfide and Benze steam, also sensitive to smoke

and other harmful gases. It is with low cost and suitable for different application. 



* Contents

- Library : https://github.com/GeorgK/MQ135


- DataSheet : http://www.cooking-hacks.com/skin/frontend/default/cooking/pdf/MQ-135.pdf


- Connect


- Key Code

#include <MQ135.h>

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


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

int pin = A0;

int sensorValue;

int ledPin = 13;


MQ135 gasSensor = MQ135(pin);

float rzero = gasSensor.getRZero();

int ppm = gasSensor.getPPM();


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S037:MQ135");



  sensorValue = analogRead(pin);

  lcd.setCursor(0,1);

  lcd.print("A0=" + (String)sensorValue + " Resis="+(String)gasSensor.getResistance() +" ");


  float rzero = gasSensor.getRZero();

  digitalWrite(ledPin, HIGH);      // turn the ledPin on

  delay(100);                      // stop the program for some time

  digitalWrite(ledPin, LOW);       // turn the ledPin off

  delay(100);  // stop the program for some time

 

  lcd.setCursor(0,2);

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

 


  float co2_ppm = gasSensor.getPPM();

  int ppm = co2_ppm / 4;

  //Vrl = val * ( 5.00 / 1024.0  );      // V

  //Rs = 20000 * ( 5.00 - Vrl) / Vrl ;   // Ohm 

  //ratio =  Rs/Ro;     

  lcd.setCursor(0,3);

  lcd.print("co2 ppm=" + (String)co2_ppm + "    ");

    

  delay(1000);

}

Posted by RDIoT
|

Micro SD TF Card Memory Module [S059]



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


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


* Specs

Features:

Support Micro SD Card, Micro SDHC card (high-speed card)

The level conversion circuit board that can interface level is 5V or 3.3V

Communication interface is a standard SPI interface

Control Interface: A total of six pins (GND, VCC, MISO, MOSI, SCK, CS), GND to ground,

VCC is the power supply, MISO, MOSI, SCK is the SPI bus, CS is the chip select signal pin;

3.3V regulator circuit: LDO regulator output 3.3V as level converter chip, Micro SD card supply;

Level conversion circuit: Micro SD card into the direction of signals into 3.3V, MicroSD card toward the direction of the control interface MISO signal is also converted to 3.3V, general AVR microcontroller system can read the signal;

Micro SD card connector: yes since the bomb deck for easy card insertion and removal.

Positioning holes: 4 M2 screws positioning hole diameter of 2.2mm, easy to install positioning, to achieve inter-module combination;


Specifications:

Power supply:4.5V - 5.5V, 3.3V voltage regulator circuit board

Positioning holes: 4 M2 screws positioning hole diameter of 2.2mm

Control Interface: GND, VCC, MISO, MOSI, SCK, CS

Size:45 x 28mm

Net weight:6g


* Contents

- Connect

CS   ----- D4

SCK  ----- D13

MOSI ----- D11

MISO ----- D12

VCC  ----- 5V

GND  ----- GND

 

- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include <SPI.h>

#include <SD.h> // include the SD library


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


File myFile;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  delay(1000);

  lcd.clear();


  lcd.setCursor(0,0);

  lcd.print("S059:microSD Adapter");


  lcd.setCursor(0,1);

  lcd.print("Initializing SD Card");


  if (!SD.begin(4)) {

    lcd.setCursor(0,1);

    lcd.print("Initialize Failed   ");

    return;

  }


  lcd.setCursor(0,1);

  lcd.print("Initialization done");


  myFile = SD.open("test5.txt", FILE_WRITE);


  // if the file opened okay, write to it:

  if (myFile) {


    lcd.setCursor(0,1);

    lcd.print("Writing to test.txt ");

    myFile.println("text");

    

    // close the file:

    myFile.close();

    lcd.setCursor(0,2);

    lcd.print("writing done.");

  } else {


    lcd.setCursor(0,2);

    lcd.print("error opening test.txt");

  }


  // re-open the file for reading:

  myFile = SD.open("test5.txt");

  if (myFile) {

    lcd.setCursor(0,3);

    lcd.print("Read test.txt:");


    // read from the file until there's nothing else in it:

    while (myFile.available()) {

      lcd.write(myFile.read());


    } 

    // close the file:

    myFile.close();

  } else {

    // if the file didn't open, print an error:

    lcd.setCursor(0,2);

    lcd.print("error opening test.txt");

  }


}

Posted by RDIoT
|

DS3231 AT24C32 IIC Clock Module (DS3231SN) [S174] 




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


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


* Specs

Overview

DS3231 is a low cost and extremely accurate I2C real-time clock, with an integrated crystal and temperature-compensated crystal oscillator (TCXO).  DS3231 can be operated using supply voltages ranging from 2.3 V to 5.5 V and it also features battery backup capabilities.

The DS3231 features an integrated crystal, 2 programmable time-of-day alarms, a temperature sensor, and 32.768 kHz signal output pin.

The AT24C32 EEPROM is a 32K EEPROM that can be used to add non-volatile data storage to your electronic projects and prototypes.

The module also features a battery holder, allowing you to add a backup battery to ensure continuous operation.


Features

Can be connected directly to the microcontroller IO ports

Standard 2.54 mm pins for input and output connections

Two calendars and alarm clock

Two programmable square-wave outputs

Real time clock generator for seconds, minutes, hours, day, date, month, and year timing

Valid until 2100 with leap year compensation

Can be cascaded with other I2C devices

The address can be set using the pins A0/A1/A2 (the default address is 0x57)

Battery socket compatible with LIR2032 batteries

I2C interface

Specifications


Operating voltage: 3.3 V to 5.5 V

Real-time clock chip: DS3231

Clock accuracy: 2 ppm

Memory chip: AT24C32 (32 Kb storage capacity)

On-chip temperature sensor with an accuracy of ±3 ℃

I2C bus interface maximum speed: 400 kHz

Size: 38 x 22 x 14 mm



* Contents

- DataSheet : http://datasheets.maximintegrated.com/en/ds/DS3231.pdf

- Library : https://github.com/kriswiner/DS3231RTC

- Connect

DS3231 Breakout --------- Arduino

3.3V --------------------- 3.3V

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

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

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


- Key Code

   // If device is not busy, read time, date, and temperature

   byte c = readByte(DS3231_ADDRESS, STATUS) & 0x04;

   if(!c) {  // if device not busy

 

  // These interrupts require constant polling of the STATUS register which takes a lot of time, 

  // which the microcontroller might not be able to spare. If the micrcontroller has a lot of other things to do

  // or we want to save power by only waking up the microcontroller when something requires its attention, use the 

  // hardware interrupt routine alarmChange().

   c = readByte(DS3231_ADDRESS, STATUS);           // Read STATUS register of DS3231 RTC

   if(c & 0x01) {                                  // If Alarm1 flag set, take some action

     digitalWrite(outPin1, HIGH);                  // Turn on extenal LED

 

  // play song1

     for (uint8_t entry = 0; entry < 32; entry++) {

       uint8_t data = readEEPROM(AT24C32_ADDRESS, 1, entry);

       tone(outPin2, data, 50);  delay(50);

     }

     noTone(outPin2);                              // End song1

 

     digitalWrite(outPin1, LOW);                   // Turn off external LED

     writeByte(DS3231_ADDRESS, STATUS, c & ~0x01); // clear Alarm 1 flag if already set

   }

   if(c & 0x02) {                                  // If Alarm 2 flag set, take some action

     digitalWrite(outPin1, HIGH);                  // Turn on extenal LED

 

  // play song1

     for (uint8_t entry = 0; entry < 32; entry++) {

       uint8_t data = readEEPROM(AT24C32_ADDRESS, 1, entry);

       tone(outPin2, data, 50); delay(50); 

     }

     noTone(outPin2);                              // End song1

     

     digitalWrite(outPin1, LOW);                   // Turn off extenal LED

     writeByte(DS3231_ADDRESS, STATUS, c & ~0x02); // clear Alarm 2 flag if already set

   }

 

    // get time

    seconds = readSeconds();

    minutes = readMinutes();

    hours   = readHours();

    PM      = readPM();

    

    day     = readDay();

    date    = readDate();

    month   = readMonth();

    year    = readYear();

    century = readCentury();

   

    // get temperature

    temperature = readTempData();  // Read the temperature

   }  

 

    // Serial print and/or display at 0.5 s rate independent of data rates

    delt_t = millis() - count;

    if (delt_t > 300) { // update LCD once per half-second independent of read rate

    digitalWrite(blinkPin, blinkOn);

    

    display.clearDisplay();

  

    display.setCursor(0, 0); display.print("DS3231 RTC");

    

    display.setCursor(0, 10); 

    if(hours < 10)   {display.print("0"); display.print(hours);}   else display.print(hours);

    display.print(":"); 

    if(minutes < 10) {display.print("0"); display.print(minutes);} else display.print(minutes);

    display.print(":"); 

    if(seconds < 10) {display.print("0"); display.print(seconds);} else display.print(seconds);

    if(PM) display.print(" PM"); else display.print(" AM"); 

    

    display.setCursor(0, 20); display.print(month); display.print("/"); display.print(date); display.print("/20"); display.print(year); 

 

    display.setCursor(0, 30); 

    if(day == 1) display.print("Monday");   

    if(day == 2) display.print("Tuesday");  

    if(day == 3) display.print("Wednesday");

    if(day == 4) display.print("Thursday");   

    if(day == 5) display.print("Friday");  

    if(day == 6) display.print("Saturday");  

    if(day == 7) display.print("Sunday");   

    

    display.setCursor(0, 40); display.print("T = "); display.print(temperature, 2); display.print(" C"); 

    display.display();

    

    blinkOn = ~blinkOn;

    count = millis();  

}

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

RTC DS1302 Module (DS1302) [S030]  (0) 2016.09.11
Tiny RTC DS1307 I2C Module (DS1307) [S029]  (0) 2016.09.11
Posted by RDIoT
|

RTC DS1302 Module (DS1302) [S030]



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


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


* Specs

Color: Green

Material: PCB

Voltage: 2v ~ 5.5v

Length: 43mm

Width: 23mm


* Contents

- Connect

VCC ----- 5V

GND ----- GND

CLK ----- D6

DAT ----- D7

RST ----- D8

 

- Setup Default Value

#define SET_DATE_TIME_JUST_ONCE

  seconds    = 0;

  minutes    = 44;

  hours      = 9;

  dayofweek  = 2;  // Day of week, any day can be first, counts 1...7

  dayofmonth = 2; // Day of month, 1...31

  month      = 2;  // month 1...12

  year       = 2016;



- Key Code

// Set your own pins with these defines !

#define DS1302_SCLK_PIN   6    // Arduino pin for the Serial Clock

#define DS1302_IO_PIN     7    // Arduino pin for the Data I/O

#define DS1302_CE_PIN     8    // Arduino pin for the Chip Enable


#define bcd2bin(h,l)    (((h)*10) + (l))

#define bin2bcd_h(x)   ((x)/10)

#define bin2bcd_l(x)    ((x)%10)


#define DS1302_SECONDS           0x80

#define DS1302_MINUTES           0x82

#define DS1302_HOURS             0x84

#define DS1302_DATE              0x86

#define DS1302_MONTH             0x88

#define DS1302_DAY               0x8A

#define DS1302_YEAR              0x8C

#define DS1302_ENABLE            0x8E

#define DS1302_TRICKLE           0x90

#define DS1302_CLOCK_BURST       0xBE

#define DS1302_CLOCK_BURST_WRITE 0xBE

#define DS1302_CLOCK_BURST_READ  0xBF

#define DS1302_RAMSTART          0xC0

#define DS1302_RAMEND            0xFC

#define DS1302_RAM_BURST         0xFE

#define DS1302_RAM_BURST_WRITE   0xFE

#define DS1302_RAM_BURST_READ    0xFF


#define DS1302_D0 0

#define DS1302_D1 1

#define DS1302_D2 2

#define DS1302_D3 3

#define DS1302_D4 4

#define DS1302_D5 5

#define DS1302_D6 6

#define DS1302_D7 7


// Bit for reading (bit in address)

#define DS1302_READBIT DS1302_D0 // READBIT=1: read instruction


// Bit for clock (0) or ram (1) area, 

// called R/C-bit (bit in address)

#define DS1302_RC DS1302_D6


// Seconds Register

#define DS1302_CH DS1302_D7   // 1 = Clock Halt, 0 = start


// Hour Register

#define DS1302_AM_PM DS1302_D5 // 0 = AM, 1 = PM

#define DS1302_12_24 DS1302_D7 // 0 = 24 hour, 1 = 12 hour


// Enable Register

#define DS1302_WP DS1302_D7   // 1 = Write Protect, 0 = enabled


// Trickle Register

#define DS1302_ROUT0 DS1302_D0

#define DS1302_ROUT1 DS1302_D1

#define DS1302_DS0   DS1302_D2

#define DS1302_DS1   DS1302_D2

#define DS1302_TCS0  DS1302_D4

#define DS1302_TCS1  DS1302_D5

#define DS1302_TCS2  DS1302_D6

#define DS1302_TCS3  DS1302_D7


  ds1302_struct rtc;

  char buffer[80];     // the code uses 70 characters.


  // Read all clock data at once (burst mode).

  DS1302_clock_burst_read( (uint8_t *) &rtc);


  sprintf(buffer, "Date=%d-%d-%d [%d]", \

    2000 + bcd2bin( rtc.Year10, rtc.Year), \

    bcd2bin( rtc.Month10, rtc.Month), \

    rtc.Day, \

    bcd2bin( rtc.Date10, rtc.Date));


  lcd.print(buffer);

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

DS3231 AT24C32 IIC Clock Module (DS3231SN) [S174]  (0) 2016.09.11
Tiny RTC DS1307 I2C Module (DS1307) [S029]  (0) 2016.09.11
Posted by RDIoT
|

Tiny RTC DS1307 I2C Module (DS1307) [S029]



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


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


* Specs

DS1307 I2C real-time clock chip (RTC)

24C32 32K I2C EEPROM memory

The using LIR2032 rechargeable lithium battery with charging circuit

Solve the problem DS1307 with backup battery can not read and write.

Fully charged, it can provide the DS1307 timing 1.

Compact design, 27mm * 28mm * 8.4mm

Leads to the a DS1307 clock pin, to provide the clock signal for the microcontroller.

Other I2C devices can be cascaded


* Contents

- Library : https://github.com/adafruit/RTClib


- Connect

GND - GND

VCC - 5V

SDA - SDA

SCL - SCL


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include "RTClib.h"

 

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

RTC_Millis rtc;

String dt;

String ut;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

  

  rtc.begin(DateTime(F(__DATE__), F(__TIME__)));

 

  delay(1000);

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S029:DS1307");

 

  DateTime now = rtc.now();

 

  dt = (String)now.year()+"/";

  dt += (String)now.month()+"/";

  dt += (String)now.day()+" ";

  dt += (String)now.hour()+":";

  dt += (String)now.minute()+":";

  dt += (String)now.second();

 

  lcd.setCursor(0,1);

  lcd.print(dt);

 

  ut = (String)now.unixtime();


  lcd.setCursor(0,2);

  lcd.print("unixtime="+ut);

}



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

DS3231 AT24C32 IIC Clock Module (DS3231SN) [S174]  (0) 2016.09.11
RTC DS1302 Module (DS1302) [S030]  (0) 2016.09.11
Posted by RDIoT
|

8 Channel Solid State Relay Module [S168]




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



* Specs

Description:

5V Omron solid state relays 240V 2A, output with resistive fuse 240V 2A

Size: 103*53*21mm/4.05*2.08*0.82"

The input power supply: 5V DC (160mA)

The input control signal voltage:

(0-2.5V low state relays ON)

(3.3-5V state high relay OFF)

2.54cm pin and blue KF301 terminals connected to the control line is more convenient

Module interface:

Input section:

DC +: positive power supply (relay voltage power supply)

DC-: connect power negative

CH1: 1 signal to trigger the end of the relay module (low level trigger valid)

CH2: 2-way relay module signal triggering end (low level trigger valid)

CH3: 3 relay module signal triggering end (low level trigger valid)

CH4: 4-channel relay module signal triggering end (low level trigger valid)

CH5: 5-way relay module signal triggering end (low level trigger valid)

CH6: 6-way relay module signal triggering end (low level trigger valid)

CH7: 7-way relay module signal triggering end (low level trigger valid)

CH8: 8-channel relay module signal triggering end (low level trigger valid)

Voltage version   quiescent current   working current    trigger voltage     trigger current

   1-way 5V               0mA                  13.8mA                 0-2.5V                2mA

   2-way 5V               0mA                  26.8mA                 0-2.5V                2mA

   3-way 5V               0mA                    37mA                 0-2.5V                 2mA

   4-way 5V               0mA                    48mA                 0-2.5V                 2mA

   5-way 5V               0mA                    59mA                 0-2.5V                 2mA

   6-way 5V               0mA                    70mA                 0-2.5V                 2mA

   7-way 5V               0mA                    81mA                 0-2.5V                 2mA

   8-way 5V               0mA                    90mA                 0-2.5V                 2mA


* Contents

- Key Code

#define RELAY1  9

#define RELAY2  8

#define RELAY3  7

#define RELAY4  6

#define RELAY5  5

#define RELAY6  4

#define RELAY7  3

#define RELAY8  2


void setup()

{    

  pinMode(RELAY1, OUTPUT);       

  pinMode(RELAY2, OUTPUT);

  pinMode(RELAY3, OUTPUT);

  pinMode(RELAY4, OUTPUT);

  pinMode(RELAY5, OUTPUT);

  pinMode(RELAY6, OUTPUT);

  pinMode(RELAY7, OUTPUT);

  pinMode(RELAY8, OUTPUT);


  digitalWrite(RELAY1,LOW);           

  digitalWrite(RELAY2,LOW);           

  digitalWrite(RELAY3,LOW);           

  digitalWrite(RELAY4,LOW);           

  digitalWrite(RELAY5,LOW);           

  digitalWrite(RELAY6,LOW);           

  digitalWrite(RELAY7,LOW);           

  digitalWrite(RELAY8,LOW);           

  delay(2000);


  digitalWrite(RELAY1,HIGH);           

  digitalWrite(RELAY2,HIGH);           

  digitalWrite(RELAY3,HIGH);           

  digitalWrite(RELAY4,HIGH);           

  digitalWrite(RELAY5,HIGH);           

  digitalWrite(RELAY6,HIGH);           

  digitalWrite(RELAY7,HIGH);           

  digitalWrite(RELAY8,HIGH);           

}


void loop()

{

   digitalWrite(RELAY1,HIGH);          // Turns Relay 1 Off

   digitalWrite(RELAY2,HIGH);          // Turns Relay 2 Off


   delay(1000);                        // Wait 1 seconds

   digitalWrite(RELAY1,LOW);           // Turns ON Relays 1   

   digitalWrite(RELAY2,LOW);           // Turns ON Relays 2

   delay(1000); // Wait 1 seconds

}

Posted by RDIoT
|

12V Delay Timer Adjustable Relay Module (NE555) [S165]



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


* Specs

100% brand new and high quality

Input voltage: 12 V

Quantity : 1pcs

Size: 68mmX21mmX18mm

Color : red

Module based on: NE555 chip 

Adjustable time: 0 to 10 seconds

Max. load: 2200W


* Contents

- Connect

+ ----- 12V

- ----- GND

Posted by RDIoT
|

5V Relay Low Level Trigger [S155]



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


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


* Specs

1, the module complies with international safety standards, the load control area and regional isolation tank; 

2, using loose music authentic relay; 

3, with the power and relay instructions, pull off, disconnect does not shine; 

4, when the input signal is a signal, often beginning with a common terminal will be turned on; 

5, can be used as a microcontroller development board module that can be used as home appliance control; 

6, the control DC or AC signal, you can control 220V AC load; 

7, there is a normally open and one normally closed contact; 

8, blue KF301 terminals to the control line is more convenient. 

About  the high and low trigger description.if you don't understand .pls check below 

Means there is a high trigger voltage trigger, can be understood as a way to signal input terminal and VCC between the positive short trigger signal input and ground; 

Refers to a low voltage trigger signal input terminal and ground for OV trigger mode, can be understood as a way to signal input terminal and GND short circuit triggered the negative


* Contents

- Connect


- Key Code

int Relay = 2;


void setup()

{

  pinMode(Relay,OUTPUT);

}


void loop()

{

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

  {

    digitalWrite(Relay,i);

    delay(2000);

  }

}

Posted by RDIoT
|

5V 4-Channel Relay Module [S147]



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


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


* Specs

This item is a 5V 4 Channel Relay board, Can be able to control various appliances, and the other equipments with large current. It can be controlled directly by Microcontroller Arduino , 8051, AVR, PIC, DSP, ARM, ARM, MSP430, TTL logic.

4 Channel Relay interface board.

Each one needs 15-20mA Driver Current.

Equiped with high-current relay : DC30V 10A AC250V 10A AC125V 10A.

Standard interface that can be controlled directly by microcontroller.

Indication LED’s for Relay output status.

Size:75mm x 55mm x 20mm


* Contents

- Connect

VCC

IN4 ----- D8

IN3 ----- D9

IN2 ----- D10

IN1 ----- D11

GND


COM ----- 5V

RIGHT ----- LED+


- Key Code

#define RELAY1  8                        

#define RELAY2  9                        

#define RELAY3  10                        

#define RELAY4  11


void setup()

{    

  pinMode(RELAY1, OUTPUT);       

  pinMode(RELAY2, OUTPUT);

  pinMode(RELAY3, OUTPUT);

  pinMode(RELAY4, OUTPUT);

}

 void loop()

{

   digitalWrite(RELAY1,LOW);           // Turns ON Relays 1

   delay(2000);                        // Wait 2 seconds

   digitalWrite(RELAY1,HIGH);          // Turns Relay Off

   digitalWrite(RELAY2,LOW);           // Turns ON Relays 2

   delay(2000);                        // Wait 2 seconds

   digitalWrite(RELAY2,HIGH);          // Turns Relay Off

   digitalWrite(RELAY3,LOW);           // Turns ON Relays 3

   delay(2000);                        // Wait 2 seconds

   digitalWrite(RELAY3,HIGH);          // Turns Relay Off

   digitalWrite(RELAY4,LOW);           // Turns ON Relays 4

   delay(2000);                        // Wait 2 seconds

   digitalWrite(RELAY4,HIGH);          // Turns Relay Off        

}

Posted by RDIoT
|

5V 2-Channel Relay Module [S116]



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


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


* Specs

Brand new and high quality.

This module can be used with Arduino Special Sensor Shield V4.0.

You can do some simple design about it.

This is 2-Channel 5V Relay Module for Arduino PIC ARM AVR DSP.

It can be able to control various appliances, and other equipments with large current.

Easy to be controlled by a lots of Microcontrollers.

Just use 5v input signal to control.

Equiped with high-current relay, AC250V 10A, AC150V 10A; DC30V 10A , DC28V 10A.

size:3.9cm x 5.1cm (1.54inch x 2.01inch).


* Contents

- Key Code

#define RELAY1  8                        

#define RELAY2  9                        


void setup()

{    

  pinMode(RELAY1, OUTPUT);       

  pinMode(RELAY2, OUTPUT);

}

 

 void loop()

{

   digitalWrite(RELAY1,LOW);           // Turns ON Relays 1

   delay(500);                         // Wait 

   digitalWrite(RELAY1,HIGH);          // Turns Relay Off

 

   digitalWrite(RELAY2,LOW);           // Turns ON Relays 2

   delay(500);                         // Wait

   digitalWrite(RELAY2,HIGH);          // Turns Relay Off

}



Posted by RDIoT
|

5V Relay Module (KY-019) [S076]




https://www.youtube.com/watch?v=nW7LC4X-6sc


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


* Specs

The company produces relay module can be connected to 240V AC or 28V DC power into a variety of other electrical parts. The relay can be used in anti-theft alarm, toys, etc. Relay is an electrically controlled device. It has a control system (also known as the input circuit) and the control system (Also known as the output circuit).

Commonly used in automation control circuit, it is actually a small Current to control a large current operation "automatic switch." Therefore, the circuit automatically adjusts the play, safety protection, transfer Conversion circuit and so on. Particularly suitable for single-chip control strong electric devices. In the control and use is also very convenient, just give input corresponding output relay different levels, you can Achieved by controlling the relay control purposes other devices, in addition, in the multi-channel relay PCB layout on the use of two lines Layout, user-lead connections. While in the circuit of a DC diode added greatly improved relay

Module to engage current ability to prevent the transistor being burned. In addition, we added a relay this power indicator Lights (except relay all the way), the indicator is red. In brightest relay also adds a status indicator.


* Contents

- Connect

Left

Middle ----- Connect

Right ----- Connect


S ----- D10

+ ----- 5V

- ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


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

int pin = 10;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(pin,OUTPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S076:5V relay KY-019");


  lcd.setCursor(0,1);

  digitalWrite (pin, HIGH); // relay conduction;

  lcd.print("D10=" + (String)digitalRead(pin) + " - HIGH");

  delay (2000);

 

  lcd.setCursor(0,1); 

  digitalWrite (pin, LOW); // relay switch is turned off;

  lcd.print("D10=" + (String)digitalRead(pin) + " - LOW ");

  delay (2000);


}

Posted by RDIoT
|

Mini Reed Switch Module (KY-021) [S045]



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


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


* Specs

A reed module is a magnetic sensor that is normally open and get closed when exposed to a magnetic field.

In our example turn off the buildin LED on pin 13 if the sensor is closed. For this you need to keep a magnet near the sensor.

The module includes a 10 K Ohm resistor, so no additional parts needed.


* Contents

- Connect

S ----- D2

Middle ----- 5V

- ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

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

int pin = 2;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  pinMode(pin,INPUT);

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S045:Mini ReadSwtich");

 

  int val = digitalRead(pin);

 

  lcd.setCursor(0,1);

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

 

  if(val==LOW)

  {

    lcd.setCursor(0,2);

    lcd.print("detected");    

  }

  else

  {

    lcd.setCursor(0,2);

    lcd.print("        ");    

  } 

}

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

Reed Swtich Module (KY-025) [S044]  (0) 2016.09.09
Posted by RDIoT
|

Reed Swtich Module (KY-025) [S044]



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


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


* Specs

Reed module and the interface comes with digital 13 LED build a simple circuit to produce a Reed warning lamp 13 comes with digital interfaces of the LED, the Reed sensor access number 3 interface, when Reed sensors Sensed a key signal (magnetic field change near the module), LED lights, otherwise off.


* Contents

- Connect

A0 ----- X

G ----- GND

+ ----- 5V

D0 ----- D2


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


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

int pin = 2;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(pin,INPUT);

  delay(1000);


  lcd.clear();

}


void loop()

  lcd.setCursor(0,0);

  lcd.print("S044:Read Swtich");


  int val = digitalRead(pin);


  lcd.setCursor(0,1);

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


  if(val==1)

  {

    lcd.setCursor(0,2);

    lcd.print("detected");    

  }

  else

  {

    lcd.setCursor(0,2);

    lcd.print("        ");    

  }

}

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

Mini Reed Switch Module (KY-021) [S045]  (0) 2016.09.09
Posted by RDIoT
|

Photo Interrupter Module LM393 Comparator (FC-03) [S158]




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


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


* Specs

Module Features:

Use imported groove coupler sensor

Groove Width: 5mm

Output state indicator lights

Obscured output high; unobstructed output low

The comparator output, the signal is clean, the waveform, driving ability, more than 15mA

Operating Voltage: 3.3V-5V

The output in the form: Digital switching outputs (0 and 1)

A fixed bolt hole for easy installation

Small plates PCB Dimensions: 3.2 x 1.4cm / 1.25 * 0.55"

Using a wide voltage LM393 comparator

Module Using The Instructions:

Module slot unobstructed, receiver tube conduction module DO output low, shelter, DO output high

Module DO connected to the relay, composed of the limit switch functions can also be connected to the active buzzer module, composed 


Pins Connection:

VCC: positive power supply 3.3-5V;

GND: Ground;

DO:  Output frequency pulses;

AO:  analog output, real-time output voltage signal. (not useful)


* Contents

- Connect

VCC ----- 5V

GND ----- GND

D0 ----- D2


- Key Code

#define encdpin   2

volatile int count, countold;

unsigned long ignoremilli = 10;  

unsigned long oldtime = 0;

unsigned long time = 0;


  count = 0;

  countold = 0; 

  oldtime = millis();


  attachInterrupt(digitalPinToInterrupt(encdpin), sensor1, FALLING);


  if(countold != count)

  {

    Serial.println(count);

    lcd.setCursor(0,1);

    lcd.print("CNT : "+(String)count+" ");

    countold = count;

  }

Posted by RDIoT
|

Photo Interrupter Module (KY-010) [S041]



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


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


* Specs

Photo interupter module use the buildin arduino led. If the sensor is broken the LED is turned on.

Device senses a signal, LED lights, otherwise off.


* Contents

- Connect

S ----- D2

Middle ----- 5V

G ----- GND


- Key Code

int pin = 2;


void loop()

{

  int val = digitalRead(pin);

  Serial.println("digital=" + (String)val + " ");


  if(HIGH == val)

  {

    Serial.println("interrupt=detected---------------------------------------------------------");

    delay(100);

  }

  else{

    Serial.println("interrupt=NONE   ");

    delay(100);

  }

}



Posted by RDIoT
|

Linear magnetic Hall sensor (KY-024) [S048]



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


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



* Specs

Linear Hall magnetic module and a digital interface, built-in 13 LED build a simple circuit to produce a magnetic field warning lamp 13 comes with digital interfaces of the LED, the linear Hall sensor magnetometer access number 3 interface, when linear Hall magnetometer Sensor senses a key signal, LED lights, otherwise off.


* Contents

- Connect

: Analog 

A0 ----- A0


G ----- GND

+ ----- 5V

D0 ----- X

 

: Digital

A0 ----- X

G ----- GND

+ ----- 5V

D0 ----- D2 



- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


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

int pin = A0;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(pin,INPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S048:Linear Mag Hall");


  int val = analogRead(pin);


  lcd.setCursor(0,1);

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


  if(val >= 527 && val <= 528)

  {

    lcd.setCursor(0,2);

    lcd.print("nomally = 527~528");    

  }

  else if (val < 527)

  {

    lcd.setCursor(0,2);

    lcd.print("under 527 : N     ");    

  }

  else if (val > 528)

  { 

    lcd.setCursor(0,2);

    lcd.print("over 527 : S      ");       

  }

  delay(200);

}

Posted by RDIoT
|

Hall Magnetic Sensor Module (KY-003) [S047]



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


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



* Specs

The KY-003 is a magnetic switch. If no magnetic field is present, the signal line of the sensor is HIGH (3.5 V). 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. The polarity of the magnetic field is of influence to the switching action. The front side of the sensor needs the opposite polarity as the back of the sensor to switch on.

In the example program the led on the Arduino (pin 13) will be turned on when a magnetic field is present.


* Contents

- Connect

- ----- GND

middle ----- 5V

S ----- A0


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

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

int pin = A0;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  pinMode(pin,INPUT);

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S047:Hall Magnetic");

 

  int val = analogRead(pin);

 

  lcd.setCursor(0,1);

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

 

  if(val>=750)

  {

    lcd.setCursor(0,2);

    lcd.print("nomally >= 750      ");    

  }

  else

  {

    lcd.setCursor(0,2);

    lcd.print("detected : under 100");    

 

  } 

  delay(200); 

}

Posted by RDIoT
|

Analog Hall Magnetic Sensor Module (KY-035) [S046]



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


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



* Specs

KY-035 is an analog magnetic field sensor module. The strength of the field is given by an analog voltage at the signal pin of the module KY-035. The sensor is connected to gnd and 5V of the Arduino board. The output voltage is measured by analog pin A5 on the Arduino board.

The example program measures the output voltage of the sensor en presents the measured value in the serial monitor of the Arduino.

The led on the board flashes in a speed depending on the strength of the magnetic field. With a small magnet this can be demonstrated.



* Contents

- Connect

- ----- GND

middle ----- 5V

S ----- A0


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


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

int pin = A0;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(pin,INPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S046:Analog Hall Mag");


  int val = analogRead(pin);


  lcd.setCursor(0,1);

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


  if(val >= 527 && val <= 528)

  {

    lcd.setCursor(0,2);

    lcd.print("nomally = 527~528");    

  }

  else if (val < 527)

  {

    lcd.setCursor(0,2);

    lcd.print("under 527 : N     ");    

  }

  else if (val > 528)

  { 

    lcd.setCursor(0,2);

    lcd.print("over 527 : S      ");       

  }

  delay(200);

}

Posted by RDIoT
|

Ceramic Piezo Vibration Sensor [S133]



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


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



* Specs

his ALSRobotBase Ceramic Piezo Vibration Piece Sensor buffers a piezoelectric transducer that responds to strain changes by generating a measurable output voltage change which is propotional with the strength of vibration.So you can know the extent of vibration. Different from digital vibration sensor that only accounts times, this analog one can tell extent of vibration.

When the piezoelectric ceramic shocking will generate an electrical signal, Arduino Controller analog port can be perceived slight vibration signals, Also can be realized with vibration interactions related works, such as electronic drums.


Working Voltage: 3.3V or 5V

Working Current: <1mA

Operating Temperature Range: -10 ~ + 70

Interface Type: Analog Output

Item Size: 30mm x 23mm

Item Weight: 5g

GPIO: S; signal output, +; power supply (VCC), -; ground (GND)

Input: Positive electrode of the piezoelectric ceramic

Gnd: Negative electrode of the piezoelectric ceramic

S-port is connected with the controller\'s analog input pin

5V and GND are respectively connected the power supply of + 5V and GND

Input and Gnd are already connected with the piezoelectric ceramics\' positive and negative


* Contents

- Connect

S ----- D2

+ ----- 5V

- ----- GND


- Key Code

lcd.print("Value=" + (String)digitalRead(2) + " ");

Posted by RDIoT
|

Knock sensor module (KY-031) [S040]



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


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


* Specs

13 knock sensor module and a digital interface, built-in LED build a simple circuit to produce percussion flasher. 13 Interface comes with digital LED, will knock sensor connected digital 3 interface, when percussion sensor senses Measure To percussive signals, LED flashing light.


* Contents

- Connect

S ----- D3

middle ----- 5V

- ----- GND



- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

int pin = 3;

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

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  pinMode(pin,INPUT);

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S040:Knock sensor");

 

  int vibration = digitalRead(pin);

 

  lcd.setCursor(0,1);

  lcd.print("digital=" + (String)vibration + "  ");

 

  if(vibration == LOW)

  {

    lcd.setCursor(0,2);

    lcd.print("knock=detected");

  }

  else{

    lcd.setCursor(0,2);

    lcd.print("knock=NONE    ");

  }


  delay(500)

}

Posted by RDIoT
|

Vibration switch module (KY-002) [S039]



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


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


* Specs

This switch is OFF in the resting state, when the external force to touch and to achieve a proper vibration, meet the appropriate speed or from the (partial) heart, conductive pin will momentarily conduction (ON) status, make changes in electric property, and disappear when the external force electric property open (OFF) state is restored

Omnidirectional, any Angle can trigger job

Component model: SW-18015P



* Contents

- Connect

S ----- D2

middle ----- 5V

- ----- GND

 

- Key Code

int pin = 2;

int vibration = digitalRead(pin);


  if(vibration == LOW)

  {

    lcd.setCursor(0,2);

    lcd.print("vibration=detected");

    delay(100);

  }

  else{

    lcd.setCursor(0,2);

    lcd.print("vibration=NONE    ");

  }

Posted by RDIoT
|

Round Force Sensing Resistor (FSR402) [S031]

 


 

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


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

 

* Specs
Actuation force as low as 0.1N and sensitivity range to 10N.
Easily customizable to a wide range of sizes
Highly repeatable force reading; as low as 2% of initial reading with repeatable actuation system
Cost effective
Ultra thin; 0.45mm
Robust; up to 10 million actuations
Simple and easy to integrate

 

* Contents
- Connect
Right ----- 5V
Left ----- P10K ---- GND
             A0 

 

- Key Code
int fsrAnalogPin = A0; // FSR pin Analog 0
int fsrValue; 
 
fsrValue= analogRead(fsrAnalogPin);
float voltage = fsrValue* (5.0 / 1023.0);
 
lcd.print("Volt=" + (String)voltage + " ");

Posted by RDIoT
|

Leap Motion Controller [S179]




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


* Specs

Leap Motion 3D Somatosensory controller mouse Gesture Motion Control for PC or MAC Brand New FreeShipping


Features:

The Leap Motion Controller senses your hands and fingers and follows their every move.

It lets them move in all that wide-open space between you and your computer. So you can do almost anything without touching anything

It's the tiny device that just might change the way you use technology.

It's a super-wide 150° field of view and a Z-axis for depth. That means you can move your hands in 3D, just like you do in the real world.

The Leap Motion Controller can track your movements at a rate of over 200 frames per second.


Package Includes:

1, Leap motion Controller

2, 2 custom-length USB 2.0 cables

3, Welcome card

4, Important Information guide


Minimum System Requirements:

Windows 7 or 8 or Mac OS X 10.7

AMD PhenomTM II or Intel® CoreTM i3 / i5 / i7 Processor

2 GB RAM

USB 2.0 port

Internet connection


* Contents

Basic Leap Motion Test.

Posted by RDIoT
|

Mini Infrared PIR Motion Sensor (HC-SR505) [S055]



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


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



* Specs

Operating temperature range: -20℃~+70℃

Working voltage: DC 5V~9V

Working current: 5mA

Static current: <50uA

Output high voltage: 4V

Out type: High/low level

Retention time of high level output: 20 secs

Detective range: 2~3m (Normal)

Detective angle: <140°

Triggering method: repeated triggering

PCB Dimension: 27mm x12mm


* Contents

- Connect

-  ----- GND

out ----- D2

+ ----- 5V


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

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

int pin = 2;

int count = 0;

int led = 13;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  pinMode(pin,INPUT);

  pinMode(led,OUTPUT);

 

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S055:mini PIR");

 

  int val = digitalRead(pin);

 

  lcd.setCursor(0,1);

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

 

 

  lcd.setCursor(0,2);

  lcd.print("count=" + (String)count + " sec  ");

  

  if(val == 1)

  {

    digitalWrite(led, HIGH);

    count++;

  }

  else

  {

    digitalWrite(led, LOW);

    count = 0;  

  }

  delay(1000);

}

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

PIR Motion Sensor (HC-SR501) Delay Control [S010]  (0) 2016.09.08
Posted by RDIoT
|

PIR Motion Sensor (HC-SR501) Delay Control [S010]



- Delay Control : https://www.youtube.com/watch?v=wF7I4zXJE9Y



- H(Repeat Trigger) : https://www.youtube.com/watch?v=IUh-8-ZBjNA


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


* Specs

Voltage: 5V – 20V

Power Consumption: 65mA

TTL output: 3.3V, 0V

Delay time: Adjustable (.3->5min)

Lock time: 0.2 sec

Trigger methods: L – disable repeat trigger, H enable repeat trigger

Sensing range: less than 120 degree, within 7 meters

Temperature: – 15 ~ +70

Dimension: 32*24 mm, distance between screw 28mm, M2, Lens dimension in diameter: 23mm


* Contents

- DataSheet : https://www.mpja.com/download/31227sc.pdf


- Key Code

int pirPin = A0; //PIR

int ledPin = 13; //LED 

int val;

int val2; // Counter & DelayTime

 

void setup() {

  Serial.begin(9600);

  pinMode(pirPin, INPUT); 

  pinMode(ledPin, OUTPUT);

}

 

void loop() {    

  val = digitalRead(pirPin); //read state of the PIR

  Serial.print("PIR Value=" + (String)val);

  Serial.print(",Delay Count=" + (String)val2);

  Serial.println(",Delay Time=" + (String)(val2*0.1) + "sec");

 

if (val == LOW) {

  digitalWrite(ledPin, LOW);  

  val2 = 0;

}

else {

  digitalWrite(ledPin, HIGH);

  val2++;

}

delay(100);

}

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

Mini Infrared PIR Motion Sensor (HC-SR505) [S055]  (0) 2016.09.08
Posted by RDIoT
|

RPI-1031 Angle Sensor Four Direction Sensor (RPI-1031) [S183]



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


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


* Specs

1. Optical principle: There are one infrared LED and two photosensitive triode receiver and a cylindrical shade inside as picture.

2. The status of RPI-1031 is controlled by cylindrical shade between infrared LED and receiver.

3. AS show,infrared is blocked.So two receivers can not receive signal.So sensor's status is OFF as low level and both output low level.

4. AS show,one receiver is blocked so it can receive signal and it output low level.Otherside,another receiver's status is ON,so it output high level.

5. AS show,LED or receiver are not blocked both,so output two high level.


* Contents

- Connect

5V ----- 5V

S1 ----- D2

S2 ----- D3

GND ----- GND


' LED

TOP ----- D8

RIGHT ----- D9

BOTTOM -----  D10

LEFT ----  D11



- Key Code

//For the RPI-1031 - http://www.sparkfun.com/products/10621

int tilt_s1 = 2;

int tilt_s2 = 3;

int led_top = 8;

int led_right = 9;

int led_bottom = 10;

int led_left = 11;


void setup(){

 pinMode(tilt_s1, INPUT);

 pinMode(tilt_s2, INPUT);

 pinMode(led_top, OUTPUT);

 pinMode(led_right, OUTPUT);

 pinMode(led_bottom, OUTPUT);

 pinMode(led_left, OUTPUT);

  

 Serial.begin(9600);

}

void loop(){

  int position = getTiltPos();

  Serial.println(position);

  //top

  if(position == 0)

  {

    digitalWrite(led_top, HIGH); 

    digitalWrite(led_right, LOW);

    digitalWrite(led_bottom, LOW);

    digitalWrite(led_left, LOW);

  }

  //right

  else if(position == 2)

  {

    digitalWrite(led_top, LOW); 

    digitalWrite(led_right, HIGH);

    digitalWrite(led_bottom, LOW);

    digitalWrite(led_left, LOW);

  }

  //left

  else if(position == 1)

  {

    digitalWrite(led_top, LOW); 

    digitalWrite(led_right, LOW);

    digitalWrite(led_bottom, LOW);

    digitalWrite(led_left, HIGH);

  }

  //bottom

  else if(position == 3)

  {

    digitalWrite(led_top, LOW); 

    digitalWrite(led_right, LOW);

    digitalWrite(led_bottom, HIGH);

    digitalWrite(led_left, LOW);

  }  

  delay(200); //only here to slow down the serial output

}


int getTiltPos(){

   int s1 = digitalRead(tilt_s1);

   int s2 = digitalRead(tilt_s2);

   return (s1 << 1) | s2; //bitwise math to combine the values

}

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

Tilt Switch Module (KY-020) [S050]  (0) 2016.09.08
Mini Mercury Switch Module (KY-017) [S049]  (0) 2016.09.08
Tilt SW-520D Sensor (SW-520D) [S067]  (0) 2016.09.08
Tilt SW-200D Sensor (W-200D) [S051]  (0) 2016.09.08
Posted by RDIoT
|

Tilt Switch Module (KY-020) [S050]



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


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


* Specs

Tilt sensor

Working voltage: 3.3V~5V

Digital Switch Output (0 & 1)

High sensitivity

With fixed bolt hole for easy installation

Works with Official Arduino Boards

Forum link: https://www.facebook.com/123Neonado

Material: PCB

Dimensions: 25 x 16 x 8 mm / 0.98 x 0.63 x 0.31 inch

Weight: 1 g / 0.04 oz

Color: Black


* Contents

- Connect

S ----- D2

middle ----- 5V

- ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

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

 

int pin = 2;

int val = digitalRead(pin);

 

  if(val == LOW)

  { 

    lcd.setCursor(0,2);

    lcd.print("Tilt CLOSE");

  }

  else

  {

    lcd.setCursor(0,2);

    lcd.print("Tilt OPEN ");  

  }

Posted by RDIoT
|