OPEN-SMART Rich UNO R3 User manual

OPEN-SMART
Name: Rich UNO R3 user manual
Version: v1.0
Date: 2017.06.12
©OPEN-SMART

- 2 -
1 Description........................................................................................................................- 5 -
2 Specification......................................................................................................................- 7 -
3 Interface ............................................................................................................................- 8 -
4 Before wonderful projects...............................................................................................- 10 -
4.1 Get Arduino IDE..................................................................................................- 10 -
4.2 Install library........................................................................................................- 12 -
4.3 Get voice sources.................................................................................................- 13 -
4.4 Install driver for CH340G....................................................................................- 14 -
4.5 Select board and serial port..................................................................................- 16 -
5 Lesson 1: Touch and sound.............................................................................................- 17 -
5.1 Overview..............................................................................................................- 17 -
5.2 Upload code for lesson 1......................................................................................- 17 -
5.3 Explain nouns.......................................................................................................- 19 -
5.4 Learn the functions...............................................................................................- 19 -
6 Lesson 2: Display number...............................................................................................- 21 -
6.1 Overview..............................................................................................................- 21 -
6.2 Upload code for lesson 2......................................................................................- 21 -
6.3 Learn the functions...............................................................................................- 23 -
7 Lesson 3: Touch and display...........................................................................................- 25 -
7.1 Overview..............................................................................................................- 25 -
7.2 Upload code for lesson 3......................................................................................- 25 -
7.3 Learn the functions...............................................................................................- 27 -
8 Lesson 4: Touch and debounce .......................................................................................- 29 -
8.1 Overview..............................................................................................................- 29 -
8.2 Upload code for lesson 4......................................................................................- 29 -
8.3 Learn the functions...............................................................................................- 31 -
9 Lesson 5: Temperature and display.................................................................................- 33 -
9.1 Overview..............................................................................................................- 33 -
9.2 Upload code for lesson 5......................................................................................- 33 -
9.3 Learn the functions...............................................................................................- 35 -
10 Lesson 6: Number flashing ...........................................................................................- 36 -
10.1 Overview............................................................................................................- 36 -
10.2 Upload code for lesson 6....................................................................................- 36 -
10.3 Learn the functions.............................................................................................- 38 -
11 Lesson 7: Knob angle display.......................................................................................- 40 -
11.1 Overview............................................................................................................- 40 -
11.2 Upload code for lesson 7....................................................................................- 40 -
11.3 Learn the functions.............................................................................................- 42 -
12 Lesson 8: Knob control brightness................................................................................- 43 -
12.1 Overview............................................................................................................- 43 -
12.2 Upload code for lesson 8....................................................................................- 43 -
12.3 Learn the functions.............................................................................................- 45 -
13 Lesson 9: Clock input ...................................................................................................- 47 -
13.1 Overview............................................................................................................- 47 -

- 3 -
13.2 Upload code for lesson 9....................................................................................- 47 -
13.3 Learn the functions.............................................................................................- 51 -
14 Lesson 10: Clock display..............................................................................................- 53 -
14.1 Overview............................................................................................................- 53 -
14.2 Upload code for lesson 10..................................................................................- 53 -
14.3 Learn the functions.............................................................................................- 55 -
15 Lesson 11: Test infrared remote keys............................................................................- 56 -
15.1 Overview............................................................................................................- 56 -
15.2 Upload code for lesson 11..................................................................................- 56 -
15.3 Learn the functions.............................................................................................- 58 -
16 Lesson 12: Infrared remote control and display............................................................- 60 -
16.1 Overview............................................................................................................- 60 -
16.2 Upload code for lesson 12..................................................................................- 60 -
16.3 Learn the functions.............................................................................................- 62 -
17 Lesson 13: Play a song..................................................................................................- 63 -
17.1 Overview............................................................................................................- 63 -
17.2 Upload code for lesson 13..................................................................................- 63 -
17.3 Learn the functions.............................................................................................- 65 -
18 Lesson 14: Play song with its file name........................................................................- 66 -
18.1 Overview............................................................................................................- 66 -
18.2 Upload code for lesson 14..................................................................................- 66 -
18.3 Learn the functions.............................................................................................- 68 -
19 Lesson 15: Knob control volume..................................................................................- 69 -
19.1 Overview............................................................................................................- 69 -
19 Upload code for lesson 15.....................................................................................- 69 -
19.3 Learn the functions.............................................................................................- 71 -
20 Lesson 16: Touch control MP3 .....................................................................................- 72 -
20.1 Overview............................................................................................................- 72 -
20.2 Upload code for lesson 16..................................................................................- 72 -
20.3 Learn the functions.............................................................................................- 74 -
21 Lesson 17: IR control MP3...........................................................................................- 76 -
21.1 Overview............................................................................................................- 76 -
21.2 Upload code for lesson 17..................................................................................- 76 -
21.3 Learn the functions.............................................................................................- 78 -
22 Lesson 18: Speak voice.................................................................................................- 80 -
22.1 Overview............................................................................................................- 80 -
22.2 Upload code for lesson 18..................................................................................- 80 -
22.3 Learn the functions.............................................................................................- 82 -
23 Lesson 19: Speak pi ......................................................................................................- 84 -
23.1 Overview............................................................................................................- 84 -
23.2 Upload code for lesson 19..................................................................................- 84 -
23.3 Learn the functions.............................................................................................- 86 -
24 Lesson 20: Speak temperature ......................................................................................- 87 -
24.1 Overview............................................................................................................- 87 -

- 4 -
24.2 Upload code for lesson 20..................................................................................- 87 -
24.3 Learn the functions.............................................................................................- 89 -
25 Lesson 21: Speak clock.................................................................................................- 91 -
25.1 Overview............................................................................................................- 91 -
25.2 Upload code for lesson 21..................................................................................- 91 -
25.3 Learn the functions.............................................................................................- 93 -
26 Lesson 22: Speak time and temperature........................................................................- 95 -
26.1 Overview............................................................................................................- 95 -
26.2 Upload code for lesson 22..................................................................................- 95 -
26.3 Learn the functions.............................................................................................- 97 -
27 Part List.........................................................................................................................- 99 -

- 5 -
1 Description
OPEN-SMART UNO R3 Board top view:
OPEN-SMART UNO R3 Type-A Kit top view:

- 6 -
Overview
Compatible with Arduino UNO R3, OPEN-SMART Rich UNO R3 is an ATMEGA328P
development board with rich peripherals. Peripherals include 4 digit display, DS1307 clock, LM75
temperature sensor, infrared receiver, serial MP3 player, rotation angle sensor, 4-channel touch
sensor. Hardware resources are very rich, do not need any DuPont wires, and the usage is very
simple. It is very suitable for Arduino learners.
4 digit display: 4 digit tube (0.36 inches) which can display the clock point, it needs D10/D11
pins to control and display the integer, clock, stopwatch, score and so on.
DS1307 clock: based on DS1307 high-precision real-time clock module, I2C interface, the
address is 0x68.
LM75 temperature sensor: I2C interface temperature sensor, not only can measure the
temperature, it can also set the temperature protection temperature, the address is 0x48.
Infrared receiver: use D2 pin,It can receive the modulated infrared signal of 38KHz that is sent
by the IR transmitter module and demodulate it into logic level, and it can complete the infrared
remote control with the codec program.
Serial MP3: MP3 music player module is based on high-quality MP3 music chip, use D7 / D8
pins to be software serial port, you can send commands to switch songs, change the volume and
play mode and other operations.
Rotation angle sensor: 10K ohm adjustable potentiometer knob angle sensor, use A0 pin, can be
used for MP3 volume adjustment, 4-digit display brightness adjustment.
4-CH touch sensor: capacitive touch switch, only when you touch the corresponding position with
your fingers, the module corresponding pin (D3 / D4 / D5 / D6) will output high level, otherwise it
outputs low.
Features:
- Use Arduino UNO bootloader
- It is 100% compatible with Arduino UNO R3 program, expansion shields, IDE.
- Use Through Hole Mount type B USB connector, consistent with Arduino UNO R3, ruggedness
and long service life.
- You can burn the program with the type A male to type B male cable.
- Onboard 500mA resettable fuse to protect power supply from the USB port and the DC jack at
the same time.
- USB interface driver chip: CH340G, compatible with win7, win8, linux, MAC OS.
- Microcontroller: Atmel ATmega328P
- Working voltage: 5V
- IO logic voltage: 5V
- Working current: 500mA (Max)
- Digital I/O Pins: 14 (of which 6 provide PWM output)
- Flash Memory: 32 KB of which 2 KB used by bootloader
- SRAM: 2KB
- EEPROM: 1KB
- Clock Speed: 16 MHz
- Onboard DIP switch, you can disconnect the connection between the peripheral module on the
board and theAtmega328P.
- OnboardArduino Shield interface, can plug the compatible expansion shield.

Item
Min
Typical
Max
Unit
Power Supply(VCC)
3.7
5
5.25
VDC
DC Jack Power
7
/
12
VDC
Current(@VCC=5V)
/
/
500
mA
Speaker Power
/
/
3
W
Logic interface
5V TTL
/
Supported Card Type
Micro SD card(<=2G);
Mirco SDHC card(<=32G)
/
File system format
Fat16 / Fat32
/
Dimensions
165x75x27
mm
Net Weight
107
g

- 8 -
3 Interface
1. USB Power & Download port: supply 5V power or connect to PC so that you can upload the
sketch code to the board.
2. DC Jack Power Supply: you can use the battery case with DC Jack 5.5*2.5 head to supply
power for the board, should be 7~12VDC.
3. 4-Digit Display: 4 digit tube (0.36 inches) which can display the clock point, it needs
D10/D11 pins to control and display the integer, clock, stopwatch, score and so on.
4. Buzzer:
5. RTC Clock: based on DS1307 high-precision real-time clock module, I2C interface, the
address is 0x68, it needs the CR1220 battery to keep running when the board is power off.
6. LM75 Temperature Sensor: I2C interface temperature sensor, not only can measure the
temperature, it can also set the temperature protection temperature, the address is 0x48.
7. Infrared Receiver: use D2 pin,It can receive the modulated infrared signal of 38KHz that is

- 9 -
sent by the IR transmitter module and demodulate it into logic level, and it can complete the
infrared remote control with the codec program.
8. Reset Button:
9. 4-Channel Touch Sensor: capacitive touch switch, only when you touch the corresponding
position with your fingers, the module corresponding pin (D3 / D4 / D5 / D6) will output high
level, otherwise it outputs low.
10. Signal ON/OFF: You can disconnect the connection between the peripheral module on the
board and theAtmega328P.
11. Atmega328P Chip: 32KB flash with 2KB EEPROM, 16MHz, the same as Arduino UNO R3
12. Knob Sensor: 10K ohm adjustable potentiometer knob angle sensor, use A0 pin, can be used
for MP3 volume adjustment, 4-digit display brightness adjustment.
13. Shield Interface: StandardArduino shield interface, you can plug your shield onto it.
14. MP3 Player: MP3 music player module is based on high-quality MP3 music chip, use D7 /
D8 pins to be software serial port, you can send commands to switch songs, change the
volume and play mode and other operations.

- 10 -
4 Before wonderful projects
4.1 Get Arduino IDE
1) If you do not get the Arduino IDE, please down it here. Please make sure you will put the
IDE in the English path.
2) We recommend you to downloadArduino 1.6.5, because our projects use this version.
Click previous version of the current release and select 1.6.5 for your PC system, mine is win10 64bit, so I
click Windows.
And then click JUST DOWNLOAD, you do not need to install the IDE for this version I select.

- 11 -
3) If you want to download the Arduino 1.8.3, you can click Windows ZIP file for non admin install and
then click JUST DOWNLOAD

- 12 -
4.2 Install library
Why you need install library?
Almost all the Rich UNO R3 board and Arduino peripheral module need corresponding library so
that you can use them more easily and you do not have to write too much code to complete the
project.
Install all the libraries the Rich UNO R3 needs:
1)Get the libraries from our google drive here. The name is Arduino libraries for Rich UNO
R3.rar
2) Unzip it and all the four libraries in it must be put in the directory of ..\Arduino-1.xx\libraries,
and then restart the IDE. All the examples in the derectory of
D:\arduino-1.6.5-r2\libraries\RichUNO\examples are the 22 lessons we are going to do and
studyArduino and Rich UNO R3.
3) Restart the Arduino: If you have open the IDE, after you have install all the libraries, please
close all the windows of the IDE.

- 13 -
4.3 Get voice sources
We get the voices sources from here. You can input the word and setting something and it will
output the voice you want. It is very good, easy and free.
1) We have get some voice we need in the 22 projects, and you can download from our google
drive here. The name is Voice Sources for TF card.rar
2) Format your TF card (should not larger than 32GB), unzip Voice Sources for TF card.rar .
Find the 01 and 02 folder and put them into your TF card. 01 folder has two songs in it, one is
Yesterday Once More, and the other is More Than I Can Say. 02 folder has 40 voice segments
include some numbers and prompt voice.

- 14 -
4.4 Install driver for CH340G
1) If you are using win7 operating system, download the CH340G driver from here.
If your system is MAC OS, download here.
If yours is linux, download here.
NOTE:Before plugging the USB cable to the PC, you should install the driver first.
2) When you have downloaded it, click the CH341SER.EXE
(3) Click the Install Button to pre-install the driver and then it is successfully installed

- 15 -
(4) Close the window and plug the module to your PC with the USB cable and it will
automatically install USB interface driver.
(5) Then you can find its serial port number, mine is COM3, you should find yours and then you
should select it in theArduino IDE.

- 16 -
4.5 Select board and serial port
You can refer to the video Select board and serial port. If you plug the board into the same USB
port, after you have set board and serial port, you do not need to do it again the next time. If you
plug it into different USB port you should select again.
1) Select board:
Click arduino.exe in the directory of D:\arduino-1.6.5-r2 to start the Arduino IDE.
Click Tools to selectArduino/Genuino Uno for our Rich UNO R3
2) Select serial port
Get to know what serial port you find at the end of 4.4 Install driver for CH340G, and then Click
Tools to select the port and mine is COM3, so I click COM3.
Now all the preparatory work has been completed, please enjoy all the projects in the next section.

- 17 -
5 Lesson 1: Touch and sound
5.1 Overview
We select capacitive touch sensor instead of traditional buttons to reduce the pain of pressing the
button and increase the service life. The buzzer has only two status such sound and silence.
In this lesson, you can learn about the touch pad control method, how to turn on and turn off the
buzzer.
5.2 Upload code for lesson 1
1) Open lesson1 example
Double click the file in the directory of
\arduino-1.6.5-r2\libraries\RichUNO\examples\L1_Touch_Sound
So that you find the window below:

- 18 -
2) Check the Board and Serial Port
3) Click Upload button to upload the code to Rich UNO R3 board
When you see that “Done uploading”, congratulations, you have upload the code to the board
successfully.
4) Check whether the board is running as you want
In this lesson, you only need to test the touch sensor and the buzzer.

- 19 -
Touch TCH1 area with your finger, the buzzer continues to sound.
Touch TCH2 area, the buzzer stops sounding.
5.3 Explain nouns
Each lesson may explain some nouns in this section.
Arduino IDE: Integrated development environment for Arduino series board, it contains all the
files in arduino-1.6.5-r2 directory. Usually we call the IDE window as IDE.
buzzer: the buzzer onboard is a simple sounding component, and the sound frequency is fixed.
example: somebody call it sketch code. It is a program you want to and you can upload to the
board
5.4 Learn the functions
1) You can find that at the beginning of all lessons code is
#include <Wire.h>
#include <SoftwareSerial.h>
Because the RichUNO library files use Wire.h and SoftwareSerial.h which is not in the RichUNO
directory, if the example code wants to use RichUNO library, it should add those two line.
2) Other header files
In lesson 1 we use the buzzer and 4-channel touch sensor, so it should include their header files to
control buzzer and touch sensor more easily.
So you should add:
#include "RichUNOTouchSensor.h"
#include "RichUNOBuzzer.h"
3) Define class object
We have defined the buzzer and touch sensor class in the RichUNO library, and at any time you
should define a object before you use it, and some object has parameter.

- 20 -
For example:
Buzzer buzzer(9);//define a Buzzer object, and the buzzer connect to D9 of Rich UNO R3 board
4) Two necessary functions
Each example code should inclue the two necessary functions:
void setup(){ }
void loop(){}
Usually we write initialization code in setup function, and then write the code what you want the
board to do in loop function which runs cyclically.
5) Functions
*buzzer.on();//turn on the buzzer
*buzzer.off();//turn off the buzzer
You can try to use delay function to make intermittent sound .
For example:
buzzer.on();
delay(200);//sound for 200ms
buzzer.off();
*touch.get(); // return is the touch area correspondingArduino pin number, if not then return -1
*touch.getLongPress(); // return long press for more than 3 seconds the corresponding Arduino
pin //number, if not return -1
Table of contents