Development Board Learning Kit Multifungsi (Multifuction Shield)

Papan fungsi shield untuk uji komponen dengan empat 7-segment.

Gambar 1.

Gambar 2. [sumber]

Gambar 3. [sumber]

Jumpers:

J1 is used for a 10 k pull up resistor to pin 2 of U5  (to connect a DS1820 temperature sensor [not included with the shield]) (Arduino Pin A4 ?)  {Location C4 in the picture} 

J2 is needed if you want to use the switches S1 S2 and S3 (connected to A1 A2 and A3 of the Arduino. {Location C1 in picture}

A SFH506-38 IR receiver (Pin D2) {Location C3 in picture} is also not included with this shield and can be connected to U4

I expect the 7 pin header {Location B/C1 in picture} with the Chinese characters is the header 7 pin header marked on the shield with “APC220 Bluetooth Voice Recognition Module”. (Pin D0 and D1 ?)

Pin D5 D6 D9 and A5 are accessible by 4 3 pin header connectors next to +5V and GND

D3 is connected to the Buzzer using a transistor! {Location D3 in picture}

 The 4 * 7segement displays are connected using two MC74HC595AD shift registers
D4 7segment Latch
D7 7segment CLK
D8 7segment Data

D10 Led4 {Location A2 in picture}
D11 Led3
D12 Led2
D13 Led1

A0 Pot1 (potentiometer) {Location B/C1 in picture}

A1 Button1 {Location C/D1 in picture}
A2 Button2
A3 Button3

  1. All LEDs blinking
    int led1 = 13;
    int led2 = 12;
    int led3 = 11;
    int led4 = 10;
     
    void setup()
    {
    // initialize the digital pin as an output.
    pinMode(led1, OUTPUT);
    pinMode(led2, OUTPUT);
    pinMode(led3, OUTPUT);
    pinMode(led4, OUTPUT);
    }
     
    void loop()
    {
    digitalWrite(led1, HIGH);
    digitalWrite(led2, HIGH);
    digitalWrite(led3, HIGH);
    digitalWrite(led4, HIGH);
    delay(1000);
    digitalWrite(led1, LOW);
    digitalWrite(led2, LOW);
    digitalWrite(led3, LOW);
    digitalWrite(led4, LOW);
    delay(1000);
    }
  2. Switches example
    const byte LED[] = {13,12,11,10};
     
    #define BUTTON1 A1
    #define BUTTON2 A2
     
    void setup()
    {
    	// initialize the digital pin as an output.
    	/* Set each pin to outputs */
    	pinMode(LED[0], OUTPUT);
    	pinMode(LED[1], OUTPUT);
    	pinMode(LED[2], OUTPUT);
    	pinMode(LED[3], OUTPUT);
    }
     
    void loop()
    {
    	if(!digitalRead(BUTTON1))
    	{
    		digitalWrite(LED[0], HIGH);
    		digitalWrite(LED[1], HIGH);
    		digitalWrite(LED[2], HIGH);
    		digitalWrite(LED[3], HIGH);
    	}
     
    	if(!digitalRead(BUTTON2))
    	{
    		digitalWrite(LED[0], LOW);
    		digitalWrite(LED[1], LOW);
    		digitalWrite(LED[2], LOW);
    		digitalWrite(LED[3], LOW);
    		}
    }
  3. Potentiometer 1
    #define Pot1 0
     
    void setup()
    {
    	Serial.begin(9600);
    }
     
    /* Main Program */
    void loop()
    {
     
    	Serial.print("Potentiometer reading: ");
    	Serial.println(analogRead(Pot1));
    	/* Wait 0.5 seconds before reading again */
    	delay(500);
    }
  4. Pot and led
    const byte LED[] = {13,12,11,10};
    #define Pot1 0
     
    void setup()
    {
    	Serial.begin(9600);
    	// initialize the digital pin as an output.
    	/* Set each pin to outputs */
    	pinMode(LED[0], OUTPUT);
    	pinMode(LED[1], OUTPUT);
    	pinMode(LED[2], OUTPUT);
    	pinMode(LED[3], OUTPUT);
    }
     
    /* Main Program */
    void loop()
    {
    	int PotValue;
    	//Serial.print("Potentiometer reading: ");
    	PotValue = analogRead(Pot1);
    	/* Wait 0.5 seconds before reading again */
    	if(PotValue < 400)
    	{
    		digitalWrite(LED[0], LOW);
    		digitalWrite(LED[1], LOW);
    		digitalWrite(LED[2], LOW);
    		digitalWrite(LED[3], LOW);
    		Serial.print("Potentiometer: ");
    		Serial.println(PotValue);
    	}
    	else
    	{
    		digitalWrite(LED[0], HIGH);
    		digitalWrite(LED[1], HIGH);
    		digitalWrite(LED[2], HIGH);
    		digitalWrite(LED[3], HIGH);
    		Serial.print("Potentiometer: ");
    		Serial.println(PotValue);
    	}
    		delay(500);
    }
    
    
  5. Segment display
    /* Define shift register pins used for seven segment display */
    #define LATCH_DIO 4
    #define CLK_DIO 7
    #define DATA_DIO 8
     
    /* Segment byte maps for numbers 0 to 9 */
    const byte SEGMENT_MAP[] = {0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0X80,0X90};
    /* Byte maps to select digit 1 to 4 */
    const byte SEGMENT_SELECT[] = {0xF1,0xF2,0xF4,0xF8};
     
    void setup ()
    {
    	/* Set DIO pins to outputs */
    	pinMode(LATCH_DIO,OUTPUT);
    	pinMode(CLK_DIO,OUTPUT);
    	pinMode(DATA_DIO,OUTPUT);
    }
     
    /* Main program */
    void loop()
    {
     
    	/* Update the display with the current counter value */
    	WriteNumberToSegment(0 , 0);
    	WriteNumberToSegment(1 , 1);
    	WriteNumberToSegment(2 , 2);
    	WriteNumberToSegment(3 , 3);
    }
     
    /* Write a decimal number between 0 and 9 to one of the 4 digits of the display */
    void WriteNumberToSegment(byte Segment, byte Value)
    {
    	digitalWrite(LATCH_DIO,LOW);
    	shiftOut(DATA_DIO, CLK_DIO, MSBFIRST, SEGMENT_MAP[Value]);
    	shiftOut(DATA_DIO, CLK_DIO, MSBFIRST, SEGMENT_SELECT[Segment] );
    	digitalWrite(LATCH_DIO,HIGH);
    }
  6. Read pot and display value on display
    /* Define shift register pins used for seven segment display */
    #define LATCH_DIO 4
    #define CLK_DIO 7
    #define DATA_DIO 8
     
    #define Pot1 0
     
    /* Segment byte maps for numbers 0 to 9 */
    const byte SEGMENT_MAP[] = {0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0X80,0X90};
    /* Byte maps to select digit 1 to 4 */
    const byte SEGMENT_SELECT[] = {0xF1,0xF2,0xF4,0xF8};
     
    void setup ()
    {
    	Serial.begin(9600);
    	/* Set DIO pins to outputs */
    	pinMode(LATCH_DIO,OUTPUT);
    	pinMode(CLK_DIO,OUTPUT);
    	pinMode(DATA_DIO,OUTPUT);
    }
     
    /* Main program */
    void loop()
    {
    	int PotValue;
    	PotValue = analogRead(Pot1);
    	Serial.print("Potentiometer: ");
    	Serial.println(PotValue);
    	/* Update the display with the current counter value */
    	WriteNumberToSegment(0 , PotValue / 1000);
    	WriteNumberToSegment(1 , (PotValue / 100) % 10);
    	WriteNumberToSegment(2 , (PotValue / 10) % 10);
    	WriteNumberToSegment(3 , PotValue % 10);
    }
     
    /* Write a decimal number between 0 and 9 to one of the 4 digits of the display */
    void WriteNumberToSegment(byte Segment, byte Value)
    {
    	digitalWrite(LATCH_DIO,LOW);
    	shiftOut(DATA_DIO, CLK_DIO, MSBFIRST, SEGMENT_MAP[Value]);
    	shiftOut(DATA_DIO, CLK_DIO, MSBFIRST, SEGMENT_SELECT[Segment] );
    	digitalWrite(LATCH_DIO,HIGH);
    }
  7. Read pot and display value on display (modifikasi untuk meratakan tingkat terang tampilan)
    /* Define shift register pins used for seven segment display */
    #define LATCH_DIO 4
    #define CLK_DIO 7
    #define DATA_DIO 8
     
    #define Pot1 0
     
    /* Segment byte maps for numbers 0 to 9 */
    const byte SEGMENT_MAP[] = {0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0X80,0X90};
    /* Byte maps to select digit 1 to 4 */
    const byte SEGMENT_SELECT[] = {0xF1,0xF2,0xF4,0xF8};
     
    void setup ()
    {
      Serial.begin(9600);
      /* Set DIO pins to outputs */
      pinMode(LATCH_DIO,OUTPUT);
      pinMode(CLK_DIO,OUTPUT);
      pinMode(DATA_DIO,OUTPUT);
    }
     
    /* Main program */
    void loop()
    {
      int PotValue;
      PotValue = analogRead(Pot1);
      Serial.print("Potentiometer: ");
      Serial.println(PotValue);
      /* Update the display with the current counter value */
      WriteNumberToSegment(0 , PotValue / 1000);
      delay(5);
      WriteNumberToSegment(1 , (PotValue / 100) % 10);
      delay(5);
      WriteNumberToSegment(2 , (PotValue / 10) % 10);
      delay(5);
      WriteNumberToSegment(3 , PotValue % 10);
    //  delay(4);
    }
     
    /* Write a decimal number between 0 and 9 to one of the 4 digits of the display */
    void WriteNumberToSegment(byte Segment, byte Value)
    {
      digitalWrite(LATCH_DIO,LOW);
      shiftOut(DATA_DIO, CLK_DIO, MSBFIRST, SEGMENT_MAP[Value]);
      shiftOut(DATA_DIO, CLK_DIO, MSBFIRST, SEGMENT_SELECT[Segment] );
      digitalWrite(LATCH_DIO,HIGH);
    }

Sumber lain:
Hackatronics: Using an Arduino Multi-function Shield

 

 

DFRobot LCD shield

Catatan untuk penggunaan LCD shield.

Ada dua versi dari LCD shield dari DFRobot yaitu versi 1.0 dan versi 1.1. Gambar 1 adalah V1.0 dan Gambar 2 adalah versi V1.1.

 

Gambar 1. [sumber]

File:DFR0009LCD KeyPad Shield mapping.pngGambar 2. [sumber]

 

Pada beberapa bagian kedua versi papan ini memiliki kesaamaan.

Gambar 3. [sumber]

DFR0009-PIN2.pngGambar 4. [sumber]

Contoh kode 01 [sumber]:

/*************************************************************************************

  Mark Bramwell, July 2010

  This program will test the LCD panel and the buttons.When you push the button on the shield,
  the screen will show the corresponding one.
 
  Connection: Plug the LCD Keypad to the UNO(or other controllers)

**************************************************************************************/

#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("Push the buttons");  // 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;
       }
   }
}

Contoh kode 02 [sumber]:

/*******************************************************

   Description:
   Reads an analog input on pin 1, prints the result to the LCD.
   This program takes the temperture sensor LM35 for example. 
  
   Connection:
   Plug the LCD Keypad to the UNO(or other controllers)
   Temperture sensor:
   S(blue) -- A1()  
     Note: A0 has been occupied.
   VCC(red) -- VCC
   GND(black) -- GND

********************************************************/

#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");              
     } 
}

Contoh kode 03 [sumber]:

/*
DFRobot LCD Shield for Arduino
Key Grab v0.2
Written by Glendon Klassen
gjklassen@gmail.com
http://www.sourceforge.net/users/ecefixer
http://ecefixer.tumblr.com

Displays the currently pressed key on the LCD screen.

Key Codes (in left-to-right order):

None   - 0
Select - 1
Left   - 2
Up     - 3
Down   - 4
Right  - 5

*/

#include <LiquidCrystal.h>
#include <DFR_Key.h>

//Pin assignments for DFRobot LCD Keypad Shield
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); 
//---------------------------------------------

DFR_Key keypad;

int localKey = 0;
String keyString = "";
                 
void setup() 
{ 
  lcd.begin(16, 2);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Key Grab v0.2");
  delay(2500);
  
  /*
  OPTIONAL
  keypad.setRate(x);
  Sets the sample rate at once every x milliseconds.
  Default: 10ms
  */
  keypad.setRate(10);

}

void loop() 
{ 
  /*
  keypad.getKey();
  Grabs the current key.
  Returns a non-zero integer corresponding to the pressed key,
  OR
  Returns 0 for no keys pressed,
  OR
  Returns -1 (sample wait) when no key is available to be sampled.
  */
  localKey = keypad.getKey();
  
  if (localKey != SAMPLE_WAIT)
  {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Current Key:");
    lcd.setCursor(0, 1);
    lcd.print(localKey);
  }
}

Relay shield

Papan relay shield dijual dengan lebih dari satu rating tegangan listrik, berikut dua contoh.

Gambar 1. Arduino Relay Shield v1.0 5V 4-Channel Relay Module [sumber]

 

https://images-na.ssl-images-amazon.com/images/I/71JfWudPY9L._SL1067_.jpgGambar 2. Seeed Arduino Relay Shield V2.0 [sumber]

 

Gambar 1 dan Gambar 2 menunjukkan dua sistem relay yang berbeda, tetapi pengoperasiannya sama. Berikut kutipan data untuk relay HJR4102.

Gambar 3. [sumber]

Gambar 4. [sumber]

Relay HJR4102 by Sunu Pradana on Scribd

ESP13 Shield

[ [ Links ] ]

Gambar 1. Arduino Compatible ESP-13 Wifi Shield (CAT.NO: XC4614) [Sumber]

Gambar 2. Arduino Compatible ESP-13 Wifi Shield (CAT.NO: XC4614) [Sumber]

Gambar 3. Arduino Compatible ESP-13 Wifi Shield (CAT.NO: XC4614) [Sumber]

Gambar 4. C4614 Flash reprogramming [Sumber]

  • During the programming phase, the wire on D0 is connected to GND (G) on the shield (see green wire in picture above). This tells the shield to enter programming mode next time it is reset.
  • Make sure the address at right is set to 0x00000.

[intense_video video_type=”youtube” video_url=”https://www.youtube.com/watch?v=_jM–H0f964″]

Arduino ESP8266 WiFi Shield v1.0 WangTongze

[ [ images & links ] ]

Gambar 1. Posisi  switch ON [ Klik gambar untuk memperbesar tampilan ]

Gambar 2. Posisi  switch OFF [ Klik gambar untuk memperbesar tampilan ]

[table id=2 /]

Pengaturan switch untuk tiga mode: flashing/reprogramming ESP8266, komunikasi Arduino ⇔ ESP8266 (system run), Arduino programming

1. flashing/reprogramming ESP8266

Konfigurasi untuk pemrograman modul ESP8266  dengan atau tanpa secara fisik terhubung dengan papan Arduino. Memutus jalur komunikasi serial (hardware), OFF di sw1 dan sw2. Posisi ON pada sw3 (DFU: Device Framework Upgrade) dan posisi ON pada sw4 (lampu LED indikator DFU).

[table id=3 /]

Gambar 3.

2. Arduino programming

Konfigurasi untuk pemrograman papan Arduino dengan shield ESP8266 yang masih terhubung secara fisik.

[table id=4 /]

Gambar 4.

3. komunikasi Arduino ⇔ ESP8266 (system run)

Konfigurasi untuk kondisi saat Arduino bekerja dan berkomunikasi melalui serial hardware dengan modul ESP8266.

[table id=5 /]

Gambar 5.

Gambar 6. [sumber]

 

Gambar 7.

Gambar 8.

Gambar 9. FTDI FT232RL

Gambar 10. Kondisi tegangan kerja 5 V

Gambar 11. Kondisi tegangan kerja 3.3 V

Gambar 12.

Percobaan didahului dengan mengosongkan program pada papan Arduino Uno (Gambar 12). Mengetahui kondisi ESP8266 (Gambar 13), konfigurasi switch mengikuti Gambar 3.

Kondisi peneriksaan semua switch OFF. Kadang-kadang perlu melepas lalu kemudian memasang ulang koneksi kabel USB. Kadang-kadang perlu menekan-tahan tombol reset di shield. Pada beberapa percobaan, penekanan tombol reset saat menunggu jawaban dari papan dapat menggantikan keperluan lepas-pasang koneksi kabel USB. Percobaan berhasil pada tegangan kerja 5 V maupun 3.3 V, dengan penyesuaian pengaturan kabel dari papan FTDI RS232 ke papan WiFi shield  (ESP8266).

Gambar 13.

esptool.py -p /dev/ttyUSB0 flash_id

Perintah penghapusan program di ESP8266, jika diperlukan (Gambar 14), kondisi switch mengikuti Gambar 3.

Gambar 14.

esptool.py -p /dev/ttyUSB0 erase_flash

 

Perintah pengisian firmware program di ESP8266 (Gambar 15), kondisi switch mengikuti Gambar 3.

Gambar 15.

esptool.py write_flash 0x0 ai-thinker-v1.1.1.bin

esptool.py --port /dev/ttyUSB0 write_flash -fm dio 0x00000 ai-thinker-0.9.5.2-115200.bin

Melakukan pemeriksaan kondisi firmware dengan ESPlorer (Gambar 16). Cara yang sama dapat dipakai untuk memberikan perintah AT command.

Kembalikan konfigurasi switch seperti pada Gambar 3 menjadi konfigurasi switch seperti pada Gambar 4.

Gambar 16.

Gambar 17, upload firmware dengan memanfaatkan NodeMCU PyFlasher. Konfigurasi swicth seperti pada Gambar 3.

Gambar 17.

Gambar 18 dan Gambar 19, koneksi ke ESP8266 dengan software moserial, pengaturan switch seperti pada Gambar 4.

Gambar 18.

Gambar 19.

esptool.py write_flash 0x0 ai-thinker-0.9.5.2-9600.bin

esptool.py -p /dev/ttyUSB0 flash_id

Gambar 20, modifikasi Software Serial untuk pengiriman AT command.

Gambar 20.

#include <SoftwareSerial.h>

SoftwareSerial esp8266(10,11); //RX TX

void setup()
{
  Serial.begin(9600);
  
  Serial.println("Hardware serial: aktif");
  Serial.println("");

  esp8266.begin(9600);
}


void loop()
{
  if (Serial.available() > 0)
  {

    byte b = Serial.read();
    esp8266.write(b);
  }

  if (esp8266.available() > 0)
  {
    
    byte b = esp8266.read();
    Serial.write(b);
  }
}

Gambar 21. Koneksi silang untuk SoftwareSerial Rx ⇒ Tx, Tx ⇒ Rx.