Lesson 12 Using Echo Sound Effects On Playme

Echo:

Echo it is terms indicates reflection of sound. This means when sound is collide with obstacle it will get reflected back. Same thing we can do in playme. Here instead of sound we can echo message in text form may a number, letter or words. To complete this we have to follow below steps:

  • Goto mblock software and open it.
  • Goto edit menu and select Arduino mode.


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Playme Robot Program is a Header file for Robot programming. It makes programming simple. By using this we can access all blocks easily and smoothly. If we are not using this then it may give us errors in program. So put this at start of program.Select block Send to Computer and drag it in programming window. This block will help us to write value on computer window. Value can be text message, numbers, letters.


Connect Send to computer block to playme Robot Program.

Take Read from Computer Block

Insert that block to sent to computer.



Now save program.


Give name to program.


Select COM port


Click on Upload Arduino option


After uploading is done you will get this message.


Click on close option.

Again go to Serial port and select COM port


And see output of your program


You can see this response which is not distance. To get proper message select Char mode for both send encode mode, recv encode mode.


 

Lesson 11 Using Light Meter ON Playme

Light Meter

Light dependent resistor is a sensor which is commonly used to detect presence of light. It is used in many experiments for detection purpose, as a burglar alarm. Its value depends on light intensity. It is a type of resistor whose resistance whose value increases when intensity of light increases. Resistance means oppose to any thing. In electronics it indicates oppose to flow of electron. The component or device which has this quality is called as resistor. In Light Dependent resistor, resistance is depend upon amount of light falling onto it.


Working: When there is poor light or no light Resistance of LDR will be maximum. It will strongly oppose to current flow. When there is sufficient light then resistance will be minimum and current flow will be maximum.


In this we are going to measure Light intensity through program.

  • Goto mblock software and open it.
  • Goto edit menu and select Arduino mode.


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Playme Robot Program is a Header file for Robot programming. It makes programming simple. By using this we can access all blocks easily and smoothly. If we are not using this then it may give us errors in program. So put this at start of program.


 

 

 

 

Figure 8: Loop Selection

Here we are using loop. Loop is area which will be repeated for certain times depending upon its type. If we write anything inside loop then it will be repeated along with loop. Forever loop means program will run continuously. For example if we write a program to run motor in forward direction with forever loop then it will run until we remove power applied to it.

Select block Send to Computer and drag it in programming window.

Put it in forever loop. Here we are writing Hello for message printing. You can write any message instead of Hello.


To get distance of obstacle from playme select Light Value block.

Connect that block to Send to computer .

Connect wait statement of 1second below this.


Now save program.


Give name to program.


Select COM port


Click on Upload Arduino option


After uploading is done you will get this message.


 

 

 

Click on close option.

Again go to Serial port and select COM port


And see output of your program


 

 

 

 

 

 

You can see this response which is not distance. To get proper message select Char mode for both send encode mode, recv encode mode.


And see light sensor value on your screen. It will be displayed on screen after every one second.

    

Lesson 9 Sending Message On Computer

Sending message on Computer:

In this lesson we are going to send message on computer screen using play me. For this we are using Serial communication. It is used for communication between the Controller board and a computer or other devices. In our life we are doing communication it is like speaking with friends, email sending, by phone call. Mostly we are exchanging information. Our playme is having one controller which controls all operations like robot movement, led ON/OFF. If our playme wants to communicate with other devices like computer, Bluetooth then it should follow serial communication which standard for every microcontroller system.

In this information or data is send to other device one by one with defined speed of communication. In this program we are going to send message from playme to computer after specific time period.

  • Goto mblock software and open it.
  • Goto edit menu and select Arduino mode.


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Playme Robot Program is a Header file for Robot programming. It makes programming simple. By using this we can access all blocks easily and smoothly. If we are not using this then it may give us errors in program. So put this at start of program.


 

 

 

 

Figure 8: Loop Selection

Here we are using loop. Loop is area which will be repeated for certain times depending upon its type. If we write anything inside loop then it will be repeated along with loop. Forever loop means program will run continuously. For example if we write a program to run motor in forward direction with forever loop then it will run until we remove power applied to it.Select block Send to Computer and drag it in programming window.

Put it in forever loop. Here we are writing Hello for message printing. You can write any message instead of Hello.


Connect wait statement after send to computer. For next message printing we are taking 1 second time. Wait value can be changed.


Now save program.


Give name to program.


Select COM port


Click on Upload Arduino option


After uploading is done you will get this message.


 

 

Click on close option.Again go to Serial port and select COM port


And see output of your program


You can see this response which is not hello message. To get proper message select Char mode for both send encode mode, recv encode mode.


And see hello message on your screen. It will be displayed on screen after every one second.

Lesson 8 Sound Generation Using Buzzer on Playme

A buzzer is a piezoelectric audio signaling device. A piezo electric buzzer can be driven by any small DC voltage to generate audio tone. A click, beep, or ring can indicate that a buzzer is sounding.

Piezoelectric effect is the ability of certain materials to generate an electric charge in response to applied mechanical stress. Meaning of Piezo is push. If certain electric charge is given to piezoelectric material, then it vibrates according to the charge given causing some sound to generate.In this we are using buzzer for generation of different tones.


  • Goto mblock software and open it.
  • Goto edit menu and select Arduino mode.


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Playme Robot Program is a Header file for Robot programming. It makes programming simple. By using this we can access all blocks easily and smoothly. If we are not using this then it may give us errors in program. So put this at start of program.


Figure 8: Loop Selection

Here we are using loop. Loop is area which will be repeated for certain times depending upon its type. If we write anything inside loop then it will be repeated along with loop. Here we are using repeat loop which will run program for certain number of time. Here we are using repeat 10 times which will run program for 10 times.

Now select Tone sound note block which can be used to generate different sounds with buzzer.

Drag that block and put it here inside repeat loop.


Now select note for tone generation. We can select tones just drag down that arrow and we can see different options.


Similarly we can select beat whether it is Half,whole etc.


Now drag tone block again and select different tone this time.


Similarly do this procedure until you are not getting your composed tone.


Now save program.


Give name to program


Select COM port


Click on Upload Arduino option


After uploading is done you will get this message.


Click on close option. And see output of your program

Lesson 6 Using Mic Sound Sensor on Playme

Sensors  are sophisticated devices that are frequently used to detect and respond to electrical or optical signals. A sensor converts the physical parameter into a signal which can be measured electrically. There are many types of sensors like temperature, sound ,light, Infrared. Sensors are used to monitor changes in environment and according to that can be used for controlling operations.Condenser Mic(mic) is a transducer that uses capacitor to convert acoustical energy into electrical energy(voltage or current). The acoustic energy has the capacity of to pass through and be modified by: solid, fluid, plasma or gas medium. The sound wave can, also, be reflected from these media. The sound waves results into electric signals that can be used to drive circuit or device.


Condenser mic is a simple capacitor. It has two plates with a voltage difference between them. Capacitance depends on the distance between these plates. In condenser mic, a diaphragm acts as one of the plates.

When sound waves strike the diaphragm, the distance between the plates changes and so does the capacitance. When the plates comes closer thereby increasing capacitance, a charge current is generated. Similarly the capacitance decreases and discharge current occur when the plates move apart

In this we are using mic for controlling robot movement.Program for sound operated Robot:

  • Goto mblock software and open it.
  • Goto edit menu and select Arduino mode.


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Playme Motor Program is a Header file for Robot programming. It makes programming simple. By using this we can access all blocks easily and smoothly. If we are not using this then it may give us errors in program. So put this at start of program.


 

 

 

 

Figure 8: Loop Selection

Here we are using loop. Loop is area which will be repeated for certain times depending upon its type. If we write anything inside loop then it will be repeated along with loop. Forever loop means program will run continuously. For example if we write a program to run motor in forward direction with forever loop then it will run until we remove power applied to it.

In this we are taking one more loop i.e. if-else loop. If-else loop is used to check condition. Condition may be anything such as whether switch is pressed or not, whether sensor is sensing parameters or not. If condition is true then and then only it will run program inside it. Otherwise it will run program of else loop.


 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 

Put that if-else loop inside forever loop. Because we want to run this program again and again.

Take Sound detected block for sound sensor program.


Put that block inside if loops condition.


 

 

 

 

 

 

 

Now we want to move robot forward when sound is detected. For robot movement we need both motors left as well as right motor along with its speed and its HIGH/LOW value.


 

 

 

 

 

 

 

 

Here take block of left motor and put it inside if loop block. Set its speed to 255.


 

 

 

 

 

 

 

This is because we want to move robot only when sound is detected. Similarly take right motor block and set its speed.


 

 

 

 

 

 

 

 

Give a wait statement after forward movement of robot. In this we want to move robot forward for 2 sec when sound is detected, after that it should be stop.



In this program if sound is detected either it may be clap or any form of sound then robot should move forward for 2 seconds and after that it should be stop.

If sound is not detected then robot will not move from its position. It will be in stop condition until sound is detected by sensor.