Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creative Innovation Series

Similar presentations


Presentation on theme: "Creative Innovation Series"— Presentation transcript:

1 Creative Innovation Series
NGT-502 : Digital Piano

2 NGT-502 : Digital Piano Objective: Description: Module List:
Using Arduino, Buzzer, BCD Switch, and Light Sensors to create a digital piano with 7 Octave range. Description: An Arduino based digital piano is created with a Buzzer, a BCD switch and 7 Light Sensors. When user blocks the light between light source and light sensor, the Buzzer generates corresponding tone. The BCD switch is used to select one of five Octave range. Module List: 1. faya brickNano x 1 2. Light Sensor x 1 3. BCD Switch x 1 4. Electromagnetic Buzzer x 1 Tool List: Phillips-Head or Flat-Head Screwdriver (2.5mm)

3 Hardware Introduction
faya brickNano BCD Switch EM Buzzer Light Sensor x 7 Power Wire Brick Post Signal Wire (Long) Signal Wire Set Brick Set microUSB Cable Brick Plate x 3

4 1. faya brickNano Compatible to Arduino Nano
Includes 4 brick holes to connect to bricks. Includes 2 power heads to supply power to other faya modules Use microUSB interface

5 2. BCD Switch DEC V The state of 4 digital output (1/2/4/8) is based on the selected input number on BCD switch. For example, if number 7 is selected Output 1 = HIGH / Output 2 = HIGH / Output 3 = HIGH / Output 4 = LOW See above truth table for BCD relations

6 3. Electromagnetic Buzzer
NC = No Connection Unit (Hz) The output tone of the buzzer is based on the input frequency at BZ port

7 4. Light Sensor Light  Vout Light  Vout
NC = No Connection The value of output voltage Vout is proportional to the light intensity detected at light sensor. Adjust the sensitivity of light sensor from resistor trimmer.

8 5. Power Wire Type A : Connector-to-Pins
Type B : Connector-to-Connector Type B Type B Type A Power Wire is used to supply the power from one to another faya modules. Red Wire connects to Vcc and Black Wire connects to Gnd. Above example shows that the power from Arduino is delivered to DC motor via Type A wire and delivered to other two modules via Type B wires.

9 6. Brick Post Use brick post to interface faya modules with bricks.
Brick post is stackable, as shown in above pictures.

10 7 / 8. Signal Wires Signal Wire is used to connect signals between Arduino and faya module pins. The size of the signal wire is AWG22

11 9. Brick Set Normal Type 1x1 : 5 pcs 1x2 : 5 pcs 1x3 : 10 pcs
Plate Type 2x6 : 6 pcs 2x10 : 2 pcs 6x8 : 1 pcs 90 degree Type 2x1 : 8 pcs LEGO brick compatible Random color for each type A bigger normal type brick maybe replaced by smaller brick for example, a 2x4 brick maybe replaced by 2pcs of 2x2

12 10. micro USB cable Use micro USB cable to connect between faya brickNano and computer.

13 11. Brick Plate Use Brick Plate as foundation of the project.
Plate size : 16x16

14 Assembling This section introduce the assemble of bricks and faya modules

15 Assemble Brick Post Assemble Brick Post at board corners of each module.

16 Assemble Brick Plate Combine three 16 x 16 Brick Plate with two 2 x 16 Brick Plate.

17 Assemble Bricks for Light Sensor
Create 14 blocks (each 2x5 size) at above position. The white dot marked in the picture is the position for Brick Post of 7 Light Sensor Modules.

18 Assemble Light Sensor Modules
Place 7 Light Sensor Modules on the top of 14 blocks as shown above.

19 Assemble Bricks for faya brickNano
Use 1 6x8 brick plate and 4 2x4 bricks to create a structure as shown above. The white dot marked in the picture is the position for Brick Post of faya brickNano.

20 Assemble faya brickNano
Place faya brickNano on the top of the structure created in previous slide.

21 Assemble Bricks for BCD Switch
Use couple bricks to create a structure as shown above. The white dot marked in the picture is the position for Brick Post of faya BCD Switch Module.

22 Assemble BCD Switch Place a BCD Switch Module on the top of structure created in previous slide.

23 Assemble Bricks for E-M Buzzer
Use couple bricks to create a structure as shown above. The white dot marked in the picture is the position for Brick Post of faya E-M Buzzer Module.

24 Assemble E-M Buzzer Place a E-M Buzzer Module on the top of structure created in previous slide.

25 Wire Connection This section introduce the connections of power and signal wires

26 Power Wire Connection Type B Power Wire
Use 9 pcs of Type B Power Wires to connect all modules as shown in the pictures. The blue arrow shows the direction of power follow. As you can see that the order of the power delivered in the system is faya brickNano, E-M Buzzer, 7 Light Sensors, and BCD Switch.

27 Arrange Power Wires Arrange power wires to make it more neatly. You may hide power wires under modules as shown above. The Light Sensors from left to right represent for piano key of Do Re Mi Fa So La Si as shown in the picture.

28 Signal Wire Connection (BCD Switch)
brickNano_D12  BCD Switch_1 brickNano_D11  BCD Switcn_2 brickNano_D10  BCD Switch_4

29 Signal Wire Connection (E-M Buzzer)
brickNano_D2  E-M Buzzer_BZ

30 Signal Wire Connection (Light Sensors)
brickNano_A1  Light Sensor_Do_OUT brickNano_A2  Light Sensor_Re_OUT brickNano_A3  Light Sensor_Mi_OUT brickNano_A4  Light Sensor_Fa_OUT brickNano_A5  Light Sensor_So_OUT brickNano_A6  Light Sensor_La_OUT brickNano_A7  Light Sensor_Si_OUT Please use long signal wires if necessary

31 Source Code DigitalPiano_1E.ino pitches.h https://goo.gl/HTJwNB
Copy two files [DigitalPiano_1E.ino] and [pitches.h] to a folder named [FigitalPiano_1E]

32 Code Explanation DEC Code L66~L78 use variable n to find current BCD selection. n1, n2, n4 represents the state of BCD output pin 1,2,4. For example, if BCD selects number 5 : output pin 1 =HIGH, pin 2 = LOW, pin4 = HIGH Resulting in n1 + n2 + n4 = = 5.

33 Code Explanation (L66~L78)
DEC Code L66~L78 use variable n to find current BCD selection. n1, n2, n4 represents the state of BCD output pin 1,2,4. For example, if BCD selects number 5 : output pin 1 =HIGH, pin 2 = LOW, pin4 = HIGH Resulting in n1 + n2 + n4 = = 5.

34 Code Explanation (L82~L83)
Code L81~82 alternatively reads analog value of Light Sensor A1(Do) to ~A7 (Si) key[0] key[1] key[2] key[3] key[4] key[5] key[6]

35 Code Explanation (L79、L84~L85)
Code L79 is used to monitor BCD Switch number Code L84、L85 is used to monitor Light Sensor Value You may uncomment L79、L84、L85、L90 for signal test purpose. Remember to comment this four lines after test complete. .

36 Code Explanation (L86) Code L86 is used to detect if Light Sensor is blocked from light source. You may change analog value 750 due to light intensity at local environment. Analog value > 750 Analog value < 750

37 Code Explanation (L87) Use tone function to generates corresponding tones: tone(pin, frequency, duration) notes[x][0] notes[x][2] notes[x][4] notes[x][6] notes[x][1] notes[x][3] notes[x][5] notes[0][x] notes[1][x] notes[2][x] notes[3][x] notes[4][x] notes[5][x] notes[6][x] low tone high tone low tone high tone For example, when BCD switch selects 3 and light sensor Re is blocked from light: Buzzer will generates notes[4][1] = Note_D5 for 20 mini seconds For example, when BCD switch selects 5 and light sensor La is blocked from light:  Buzzer will generates notes[5][2] = Note A3 for 20 mini seconds

38 Code Upload (1) Connects USB cable (3) Select Proper COM Port [COMx]
(4) Press [Upload] button (2) Select [Arduino Nano] (5) Done uploading

39 Sensitivity Adjustment (1)
After successfully upload the code to brickNano, your digital piano may generate several tones like noise without blocking the light sensors. This happens when sensor is too sensitive. We can use resistor trimmer to adjust sensor sensitivity. Please follow below steps for quick adjustment. 3 (1) Set BCD Switch at [3] position (2) Use screw driver to slowly rotate all (total 7) resistor trimmers clockwisely until they stops. After complete, the buzzer should be mute. (3) Block the light of [DO] sensor and use screw driver to slowly rotate its resistor trimmer counter-clockwisely. When buzzer starts generating [Do] tone, stop rotates trimmer immediately.

40 Sensitivity Adjustment (2)
(4) Now you are able to use an object to control the [DO] key. When blocking the Light Sensor from light source, the buzzer should generating [DO] tone. When unblocking the Light Sensor from light source, the buzzer should be mute. See video link at next slide (5) Repeat step (3) ~ (4) to adjust Light Sensor [Re], [Mi], [Fa], [So], [La], [Si] Note: The adjustment in Step (3) decides the sensor sensitivity. The more rage you rotate trimmer counter clockwisely, the more sensitivity of the Light Sensor, meaning that low intensity of light will be able to trigger the sensor to drive the buzzer.

41 Sensitivity Adjustment (3)

42 Playing your Digital Piano

43 Testing 49 tones

44 Playing Over the Rainbow

45 Appendix A : Arduino installation
(1) Visit ( and click SOFTWARE (2) Save file in your computer and follow the instructions to install Arduino IDE in your computer

46 Appendix B : brickNano installation
(1) Connect brickNano to Windows PC with microUSB cable (2) Windows should search device and install the device driver automatically. When success, A [USB Serial Port (COMx)] should and list it in Device Manager.

47 Appendix B : brickNano installation (1)
(3) If windows does not install the driver automatically, please install the driver manually. (3-1) Right click and select Properties (3-3) Browse my computer for driver software (3-4) Browse folder [Arduino/drivers/FTDI USB Drivers] to complete the driver installation. (3-2) Update Driver

48 Appendix B : brickNano installation (2)
(4) When driver installed successfully, the device manager and Arduino IDE should appear the COM Port number for brickNano.

49 Reference Getting Started with Arduino
Arduino Tutorial Arduino Programming Language Reference Arduino Playground fayalab Module specification and sample code

50 Technical Support contact us at fayalab@kandh.com.tw K&H MFG CO., LTD.
5F., No.8, Sec. 4, Ziqiang Rd., Sanchong Dist., New Taipei City 241, Taiwan R.O.C. TEL:  FAX: WEB:


Download ppt "Creative Innovation Series"

Similar presentations


Ads by Google