Call server API for multiple sensor information [P002]


 

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


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

 

* Parts

- Arduino Uno R3

- Ethernet W5100 Shield (W5100) [B004]

- LCD1602 (HD44780) [D002]

- Temperature and humidity DHT11 sensor module (KY-015) [S008]

- Button

 

* Contents

- Collect multiple (two temperature / humidity) sensor values on one sensor and load them into the server

Posted by RD IoT RDIoT

댓글을 달아 주세요

LCD Keypad Shield Green (LCD1602) [D043]



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


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


* Specs

Useful LCD display for Arduino with 16 symbols and 2 lines. Display background LED is connected to potentiometer regulating screen  brightness and contrast. You can control switching on/off with sketch.

Display has GREEN color.

LCD display uses standard HD44780-compatible driver. Arduino "LiquidCrystal" library is used for display programming and can be found in Arduino IDE  coding environment. You can use standard characters or make your own characters.

LCD display uses digital Arduino digital outputs: 4, 5, 6, 7, 8, 9.

Initialization string in sketch seems as: LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

: ( RS - D8; Enable - D9; LCD4 - D4; LCD5 - D5; LCD6 - D6; LCD7 - D7)

Under LCD there are 5 navigation buttons: Up, Down, Left, Right.

Option. Buttons are connected with A0 analog input only, so you can monitor button status using just one Arduino input. Pay attention: status monitoring is unavailable when several buttons are pressed.

Shield includes  blocks of digital and analog inputs/outputs and also it has A1-A5 analog input blocks (5V/GND/IN) for quick connection to periphery.

Shield is powered with Arduino 5V output. 

Posted by RD IoT RDIoT

댓글을 달아 주세요

LCD Keypad Shield (LCD1602) [D038]



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


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


* Contents

- Pin Out : https://www.dfrobot.com/wiki/images/thumb/5/5e/DFR0009-PIN2.png/900px-DFR0009-PIN2.png

- Ref Url : http://www.dfrobot.com/wiki/index.php/LCD_KeyPad_Shield_For_Arduino_SKU:_DFR0009

- Key Code (Left -> ..)

#include <LiquidCrystal.h>

 

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);           // select the pins used on the LCD panel

 

// define some values used by the panel and buttons

int lcd_key     = 0;

int adc_key_in  = 0;

 

#define btnRIGHT  0

#define btnUP     1

#define btnDOWN   2

#define btnLEFT   3

#define btnSELECT 4

#define btnNONE   5

 

int read_LCD_buttons(){               // read the buttons

    adc_key_in = analogRead(0);       // read the value from the sensor 

 

    // my buttons when read are centered at these valies: 0, 144, 329, 504, 741

    // we add approx 50 to those values and check to see if we are close

    // We make this the 1st option for speed reasons since it will be the most likely result

 

    if (adc_key_in > 1000) return btnNONE; 

 

    // For V1.1 us this threshold

    //if (adc_key_in < 50)   return btnRIGHT;  

    //if (adc_key_in < 250)  return btnUP; 

    //if (adc_key_in < 450)  return btnDOWN; 

    //if (adc_key_in < 650)  return btnLEFT; 

    //if (adc_key_in < 850)  return btnSELECT;  

 

   // For V1.0 comment the other threshold and use the one below:

   

     if (adc_key_in < 50)   return btnRIGHT;  

     if (adc_key_in < 195)  return btnUP; 

     if (adc_key_in < 380)  return btnDOWN; 

     if (adc_key_in < 555)  return btnLEFT; 

     if (adc_key_in < 790)  return btnSELECT;   


    return btnNONE;                // when all others fail, return this.

}

 

void setup(){

   lcd.begin(16, 2);               // start the library

   lcd.setCursor(0,0);             // set the LCD cursor   position 

   lcd.print("D038 - Push BTNs");  // print a simple message on the LCD

}

  

void loop(){

   lcd.setCursor(9,1);             // move cursor to second line "1" and 9 spaces over

   lcd.print(millis()/1000);       // display seconds elapsed since power-up

 

   lcd.setCursor(0,1);             // move to the begining of the second line

   lcd_key = read_LCD_buttons();   // read the buttons

 

   switch (lcd_key){               // depending on which button was pushed, we perform an action

 

       case btnRIGHT:{             //  push button "RIGHT" and show the word on the screen

            lcd.print("RIGHT ");

            break;

       }

       case btnLEFT:{

             lcd.print("LEFT   "); //  push button "LEFT" and show the word on the screen

             break;

       }    

       case btnUP:{

             lcd.print("UP    ");  //  push button "UP" and show the word on the screen

             break;

       }

       case btnDOWN:{

             lcd.print("DOWN  ");  //  push button "DOWN" and show the word on the screen

             break;

       }

       case btnSELECT:{

             lcd.print("SELECT");  //  push button "SELECT" and show the word on the screen

             break;

       }

       case btnNONE:{

             lcd.print("NONE  ");  //  No action  will show "None" on the screen

             break;

       }

   }

}


- Key Code (Sensor Value)

#include <LiquidCrystal.h>

 

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);        // select the pins used on the LCD panel

 

unsigned long tepTimer ;   

 

void setup(){

    lcd.begin(16, 2);                       // start the library

}

 

void loop(){

    lcd.setCursor(0, 0);                   // set the LCD cursor   position

    int val;                               // variable to store the value coming from the analog pin

    double data;                           // variable to store the temperature value coming from the conversion formula

    val=analogRead(1);                     // read the analog in value:

    data = (double) val * (5/10.24);       // temperature conversion formula

     

    if(millis() - tepTimer > 500){         // output a temperature value per 500ms

             tepTimer = millis();

 

             // print the results to the lcd

             lcd.print("T: ");              

             lcd.print(data);            

             lcd.print("C");             

     }

}

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

LCD 4002 Blue (ERM4002SBS-1) [D051]  (0) 2016.09.21
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
Posted by RD IoT RDIoT

댓글을 달아 주세요

LCD1602 I2C (LCD1602) [D016]



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


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



* Contents

- Connect

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

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

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

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

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


- DataSheet : http://www.elecrow.com/download/LCD1602.pdf


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,16,2);  // 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.print("Hello, world!");

  

  lcd.setCursor(0, 1);

 

  lcd.print("cursor 0,1");

}

'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

댓글을 달아 주세요

LCD1602 (HD44780) [D002]



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


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


* Contents

- DataSheet : http://www.elecrow.com/download/LCD1602.pdf

- Connect

LiquidCrystal lcd(9, 8, 7, 6, 5, 4);

/*

[LCD Pin Number][BreadBoard][Arduino]

1.  Vss------------------ - GND------------------ - GND  ---> GND

2.  Vdd------------------ - VCC------------------ - 5V   ---> 5V (+)

3.  V0------------------ - GND                           ---> R4.7K

4.  RS----------------------------------------------------D13  ------------> RS D9

5.  RW------------------ - GND                           ------------> GND

6.  E----------------------------------------------------D12   ------------> RS D8

7.  DB0(X)

8.  DB1(X)

9.  DB2(X)

10. DB3(X)

11  DB4----------------------------------------------------D11 ----------> 7

12  DB5----------------------------------------------------D10 ----------> 6

13  DB6----------------------------------------------------D9  ----------> 5

14  DB7----------------------------------------------------D8  ----------> 4

15  LEDA------------------ - VCC                         -----> R220 ---- VCC

16  LEDK------------------ - GND                         -----> GND

*/


- Test Example : SerialDisplay

'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

댓글을 달아 주세요

433Mhz Super-regenerative module (FS1000A,MX-JS-05V) [S081]



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


* Specs

Emission head (2SC3357 transistor):

The actual working distance 50-100m

Operating voltage 3-12V

Operating current :10-15mA

Ways of working: AM

Transfer rate: 4KB / S

Transmit power: 10mW

External antenna: 28cm ordinary multi-core or single core line

Pinout from left ? right: (DATA, VCC, GND)

Size: 1.9CM * 1.9CM * 0.9CM


Receiver Module Technical Data:

Model: MX-05V

Working voltage: DC5V

Quiescent Current: 4MA

Receiving frequency: 433.92MHZ

Receiver sensitivity:-105DB

Size: 30 * 14 * 7mm

External antenna: 32CM single wire, wound into a spiral


* Contents

- Connect

Emission 

ATA0 ----- D4

VCC ----- 5V

GND ----- GND


Receiver

VCC ----- 5V

DATA ----- D2 (data)

X

GD ----- GND


LED ----- D2


- Data Format Define

 : 1=1, 1=2



- Key Code

FS1000A

#include <Wire.h> 

#include <VirtualWire.h>       

#include <Bounce2.h>           

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,16,2); 

 

int buttonPin = 2;  

int sendPin = 4;   

boolean oneTimeFlag = false;        

Bounce bouncer = Bounce();    

 

void setup() {

  lcd.init();                      // initialize the lcd 

 

  lcd.backlight();

  lcd.print("S081-FS1000A Snd");

  

   pinMode(buttonPin, INPUT);

   digitalWrite(buttonPin, HIGH);

   bouncer.attach( buttonPin );

   bouncer.interval(5);

    

   vw_setup(2000);        

   vw_set_tx_pin(sendPin);

   Serial.begin(9600);

}

 

void loop() {

 if ( bouncer.update() && bouncer.read() == LOW) {     

    if( oneTimeFlag == false) {                        

      lcd.setCursor(0, 1);

      lcd.print("ON = Send(1) ");

      Serial.println("on");

      sendMessage("1=1");  

      oneTimeFlag = true;

 

    } else {

      lcd.setCursor(0, 1);

      lcd.print("OFF = Send(2)");

      Serial.println("off");                 

      sendMessage("1=2");    

     oneTimeFlag = false;

 

     }         

  }

}

 

void sendMessage(char *data) {

  if (strlen(data) > 0) {     

   int msgSize = (strlen(data) + 1); 

   char packetData[msgSize];         

 

   vw_send((uint8_t *)data, msgSize);  

   vw_wait_tx();                       

 

  }  

}


MX-JS-05V

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include <VirtualWire.h>

#include <string.h>

 

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

 

byte message[VW_MAX_MESSAGE_LEN];                    

byte messageLength = VW_MAX_MESSAGE_LEN; 

int rcvPin = 2; 

int ledPin = 8; // LED

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  delay(1000);

 

  lcd.clear();

  

  pinMode(ledPin, OUTPUT);

  digitalWrite(ledPin, HIGH);

  delay(1000);

  digitalWrite(ledPin, LOW);

 

  vw_setup(2000);

  vw_set_rx_pin(rcvPin);       

  vw_rx_start();               

 

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("S081:MX-JS-05V Rev");

 

  if (vw_get_message(message, &messageLength)) {       

      

 

    int command = processResponse((char*)message, 1); 

 

 

    if (command) {

      switch (command) {

       case 1:                        

         lcd.setCursor(0,2);

         lcd.print("Receive Value= 1 ");

         digitalWrite(ledPin, HIGH);

         break;

       case 2:                         

         lcd.setCursor(0,2);

         lcd.print("Receive Value= 2 ");

         digitalWrite(ledPin, LOW);

         break;

      }

    }  

  }

 

}

 

int processResponse(char* message, int pinCode) {

  char *p = message;

  char *buf;

  int o = 0;

  int pin;

  int command;

 

      lcd.setCursor(0,1);

      lcd.print("RF msg:"+String(message));

 

  while ((buf = strtok_r(p, "=", &p)) != NULL)  {  

   if (o == 0) {                                 

     pin = atoi(buf);                            

   } else {

     command = atoi(buf);                        

   }

    o++;

  }

 

  if (pinCode == pin && command > 0) {                   

    return command;

  } else {

    return 0; 

  }

}

Posted by RD IoT RDIoT

댓글을 달아 주세요