3. 3.27 2 · hobby world center co.,ltd. 25 soi pokeaw 3, klongchun, bangkapi, bangkok thailand...

12
Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 1 Part Number : FK-FA1416 Product Name : MULTI-FUNCTION 16x2 LCD SHIELD This is the experimental board of Multi-Function 16x2 LCD Shield as the fundamental programming about the digits, alphabets and symbols. It can be used to connect with sensors such as Temperature Controller, Moisture Indicator, Infrared Receiver Module, Ultrasonic Module. This circuit is adaptable and is able to upgrade to the other form of circuit such as Temperature Controller, Multi-Function LCD SHIELD. Specification 1.Power Supply direct from Microcontroller Board. 2.The circuit can be used with Microcontroller Board such as Arduino UNO R3. 3.The circuit board is composed of 4 sets which are 16x2 LCD Shield, 3 pieces of Switch, 2 LCDs and Sensor Connector such as Temperature Controller, Moisture Indicator, Infrared Receiver Module. 4.PCB dimension : 3.27”x2.28Circuit function The circuit is composed of 4 main sections: Section1 LCD Shield. The data pin of LCD is connected with the port P4-P7 on Arduino Board. The LCD Shield will receive data from Arduino Board and show the data on LCD. Section2 There are 3 switches in Switch circuit connected with the port A0,A1 and A2. Section3 The LED circuit has 2 switches which connected with the port A0 and P10. Section4 is for connecting with Sensor Connectors; -CON1 is used to connect with Moisture Indicator DHT11, DHT22 or Ultrasonic Module HC- SR04 through the port P8 and P9. To connect CON1 with Moisture Indicator, jump the jumpers of JP- P8 and JP-P9 but if we want to connect with Ultrasonic Module, remove the jumpers of JP-P8 and JP- P9 . -CON2 is used to connect with Moisture Indicator such as 18B20 through the port P2. -CON3 is used to connect with Infrared Receiver Module through the port P3.

Upload: others

Post on 13-Oct-2019

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 1

Part Number : FK-FA1416

Product Name : MULTI-FUNCTION 16x2 LCD SHIELD This is the experimental board of Multi-Function 16x2 LCD Shield as the fundamental programming about the digits, alphabets and symbols. It can be used to connect with sensors such as Temperature Controller, Moisture Indicator, Infrared Receiver Module, Ultrasonic Module. This circuit is adaptable and is able to upgrade to the other form of circuit such as Temperature Controller, Multi-Function LCD SHIELD.

Specification

1.Power Supply direct from Microcontroller Board.

2.The circuit can be used with Microcontroller Board such as Arduino UNO R3.

3.The circuit board is composed of 4 sets which are 16x2 LCD Shield, 3 pieces of Switch, 2 LCDs and Sensor Connector such as Temperature Controller, Moisture Indicator, Infrared Receiver Module.

4.PCB dimension : 3.27”x2.28”

Circuit function

The circuit is composed of 4 main sections:

Section1 LCD Shield. The data pin of LCD is connected with the port P4-P7 on Arduino Board. The LCD Shield will receive data from Arduino Board and show the data on LCD.

Section2 There are 3 switches in Switch circuit connected with the port A0,A1 and A2.

Section3 The LED circuit has 2 switches which connected with the port A0 and P10.

Section4 is for connecting with Sensor Connectors;

-CON1 is used to connect with Moisture Indicator DHT11, DHT22 or Ultrasonic Module HC-SR04 through the port P8 and P9. To connect CON1 with Moisture Indicator, jump the jumpers of JP-P8 and JP-P9 but if we want to connect with Ultrasonic Module, remove the jumpers of JP-P8 and JP-P9 .

-CON2 is used to connect with Moisture Indicator such as 18B20 through the port P2.

-CON3 is used to connect with Infrared Receiver Module through the port P3.

Page 2: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 2

Figure 1. Circuit Diagram of FK1416

Circuit Assembling

According to Figure 2, the easy assembling should be started with putting the smallest part on the circuit which is resistor. Caution, all parts must be on the right electrodes such as LED. Please see Figure 3 for putting parts on electrodes. On the soldering, use a soldering iron max. 40 watts and tin/lead at 60/40 with flux. After assembling and soldering, re-check the positions of each part. In case some parts are on the wrong positions, use solder suction or solder wick to correct the positioning of those parts.

Figure 2. The positions for assembling and PCB copper line.

FUTURE KIT FK1416-1

Page 3: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 3

Figure 3. Positioning the parts on PCB

Programming instrument for the experimental board

1.FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD 1 set

2.Microcontroller Board ex. Arduino UNO R3 1 set

3.USB Cable 1 Piece

4.Computer Set 1 Set

5.Arduino Software 1 Piece

Testing Arduino UNO R3 Board

1.Connect USB cable with USB port of computer and USB port of Arduino UNO R3 Board.

Page 4: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 4

Figure 4. Connecting USB cable with USB port of Arduino Board

2. Open Arduino program by double-click on Arduino icon. Go to the menu bar, click on File and choose Open. Go to folder “EX” and open folder “TEST”. Click on file “Test”.

Figure 5. Opening Arduino program

Figure 6. TEST Program

3.Download TEST program to Arduino Board.

Page 5: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 5

Figure 7. Downloading TEST program

4. After downloading, the LED L on Arduino Board will blink which means Arduino board is working.

Figure 8. The position of LED L on Arduino Board circuit

The details of TEST program, Flashing Light Program, Arduino UNO R3 experiment.

void setup() {

pinMode(13, OUTPUT); // Set the pin 13 is OUTPUT pin.

}

void loop() {

digitalWrite(13, HIGH); // LED at the pin 13 is light-on.

delay(1000); // delay time 1 second

digitalWrite(13, LOW); // LED at the pin 13 is light-off.

delay(1000); // delay time 1 second

}

Page 6: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 6

The method to connect the circuit with Arduino UNO R3 board

Connect FK1416 board with Arduino UNO R3 board by following Figure 9.

Figure 9. Connecting FK1416 board with Arduino UNO R3 board

Programming

1.Connect Arduino UNO R3 board with experimental board by following the instruction of the method to connect the circuit with Arduino UNO R3 board.

2.Connect the USB cable with USB port of computer and USB port of Arduino UNO R3 board.

Figure 10. Wiring the USB cable

3.Double-click on Arduino icon to open Arduino program. Go to “File” in menu bar and choose “Open”. Click on folder “Ex”, choose folder “FK1416” , choose folder “LAB1416-1” and click on file “LAB1416-1”.

Page 7: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 7

Figure 11. Opening Arduino Program

Figure 12. LAB1416-1 program

4.Download LAB1416-1 program to Arduino board.

Figure 13. Downloading LAB1416-1 program

5.After downloading, the LCD display at FK1416 board will show the message “Hello World!” at the first line and showing the message “I AM FUTURE KIT” at the second line which means the LCD display circuit section is working.

Page 8: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 8

6. Connect LED TEST with CON3 point. The pin of Resistor must be connected with G point and the pin of LED TEST must be connected with P3. Open LAB1416-2 program in folder “EX”. Download LAB1416-2 program to Arduino board, LED TEST will blink. Remove LED TEST and connect it with CON2 point, do it in the same way as connecting with CON3 point but change the pin’s position from P3 to P2. LED TEST will blink. Remove LED TEST and connect it with CON1 point and put the pin that’s no connection with Resistor in P8, then P9. If LED blinks, it means the connector point is working.

Figure 14. LAB1416-2 program

Figure 15. Downloading LAB1416-2 program

7.Open LAB1416-3 in folder “EX” and download this program to Arduino UNO R3 board.

Page 9: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 9

Figure 16. LAB1416-3 program

8.Press and hold switch SW1, LED-A0 will be light-on, release switch SW1, LED-A0 will be light-off.

9.Press and hold switch SW2, LED-A0 will be light-on, release switch SW2, LED-A0 will be light-off.

10.Press and hold switch SW3, LED-A0 will be light-on, release switch SW3, LED-A0 will be light-off.

11.If the test in step 8 to step 10 works, it means the switch circuit is functional.

The details of LAB1416-1 LCD DISPLAY TEST program

#include <LiquidCrystal.h> // Using the LiquidCrystal Library in Arduino software.

LiquidCrystal lcd(12, 11, 7, 6, 5, 4);

// Setting the pin 12 is RS, pin 11 is E, pin 4 to pin 7 is Data.

void setup() {

lcd.begin(16, 2); // Setting the 16 Character 2 Lines LCD display

lcd.setCursor(0, 0); // Setting the first message, start at position 1 line 1. lcd.print(" Hello World!"); // Showing the message “ Hello World!” at position 1 line 1.

lcd.setCursor(0, 1); // Setting the second message, start at position 1 line 2.

lcd.print(" I AM FUTURE KIT"); // Showing the message “I AM FUTURE KIT” at position 1 line 2.

}

void loop() {

}

Page 10: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 10

Function of LAB1416-1 program

The function of LAB1416-1 program starts from opening Library LiquidCrystal in Arduino program. Set the pin of P12 as RS pin of LCD, set the pin of P11 as E pin of LCD and set the pins of P4-P7 as Data pin. We can set the program to show the usage of 16 x 2 LCD Shield.

Set the first data start from Position1 and Line1 to display Hello World! And the second data start from Postion1 and Line1 to I AM FUTURE KIT.

The details of LAB1416-2 CON1-CON3 CONNECTOR TEST program

void setup() {

pinMode(2, OUTPUT); // Set the pin 2 is OUTPUT pin.

pinMode(3, OUTPUT); // Set the pin 3 is OUTPUT pin.

pinMode(8, OUTPUT); // Set the pin 8 is OUTPUT pin.

pinMode(9, OUTPUT); // Set the pin 9 is OUTPUT pin.

}

void loop() {

digitalWrite(2, HIGH); // LED at the pin 2 is light-on.

digitalWrite(3, HIGH); // LED at the pin 3 is light-on.

digitalWrite(8, HIGH); // LED at the pin 8 is light-on.

digitalWrite(9, HIGH); // LED at the pin 9 is light-on.

delay(1000); // delay time 1 second

digitalWrite(2, LOW); // LED at the pin 2 is light-off.

digitalWrite(3, LOW); // LED at the pin 3 is light-off.

digitalWrite(8, LOW); // LED at the pin 8 is light-off.

digitalWrite(9, LOW); // LED at the pin 9 is light-off.

delay(1000); // delay time 1 second

}

Function of LAB1416-2 program

The program will determine pin 2, pin 3, pin 8 and pin 9 as OUTPUT pin. It will light up the LED at pin 2, pin 3, pin 8 and pin 9 at 1 second and will extinguished at 1 second, the program will start repeating the all LED.

Page 11: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 11

Remark: In case we want LED ON/OFF frequency, we can reduce the value in the parentheses by commanding “delay”. The unit of the digit is millisecond.

The details of LAB1416-3 SWITCH TEST program

void setup() {

pinMode(A0, OUTPUT); // Set the pin A0 is OUTPUT pin.

pinMode(A1, INPUT_PULLUP); // Set the pin A1 is INPUT pin and using the PULL UP function.

pinMode(A4, INPUT_PULLUP); // Set the pin A4 is INPUT pin and using the PULL UP function.

pinMode(A5, INPUT_PULLUP); // Set the pin A5 is INPUT pin and using the PULL UP function.

}

void loop() {

int SW3 = digitalRead(A5); // Set “SW3” word is the variable of value at pin A5.

int SW2 = digitalRead(A4); // Set “SW3” word is the variable of value at pin A4.

int SW1 = digitalRead(A1); // Set “SW3” word is the variable of value at pin A1.

if (SW3 == LOW) { digitalWrite(A0, HIGH); } else { digitalWrite(A0, LOW); }

// If press the switch SW3 (LOW status), LED at pin A0 will be light-on. But if no press the switch SW3 (HIGH status), LED at pin A0 will be light-off.

if (SW2 == LOW) { digitalWrite(A0, HIGH); } else { digitalWrite(A0, LOW); }

// If press the switch SW2 (LOW status), LED at pin A0 will be light-on. But if no press the switch SW2 (HIGH status), LED at pin A0 will be light-off.

if (SW1 == LOW) { digitalWrite(A0, HIGH); } else { digitalWrite(A0, LOW); }

// If press the switch SW1 (LOW status), LED at pin A0 will be light-on. But if no press the switch SW1 (HIGH status), LED at pin A0 will be light-off.

}

Function of LAB1416-3 program

The program will determine pin A0 as OUTPUT pin and pin A1, pin A4 to pin A5 as INPUT pin. Besides INPUT pin, pin A1, pin A4 to pin A5 can be used for activating the function PULL UP as well.

Press and hold switch SW3 at pin A5, LED-A0 will be light-on, release switch SW3, LED-A0 will be light-off.

Press and hold switch SW2 at pin A4, LED-A0 will light up be light-on, release switch SW2, LED-A0 will be light-off.

Page 12: 3. 3.27 2 · Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website :

Hobby World Center Co.,Ltd. 25 Soi Pokeaw 3, Klongchun, Bangkapi, Bangkok Thailand 10240 Tel. 662-183-5720 Fax. 662-183-5721 Website : www.futurekit.com

FK-FA1416 MULTI-FUNCTION 16x2 LCD SHIELD Page 12

Press and hold switch SW1 at pin A1, LED-A0 will be light-on, release switch SW1, LED-A0 will be light-off.