Difference between revisions of "ExpEYES/C2/Communicating-to-ExpEYES-using-Python/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
(7 intermediate revisions by 3 users not shown)
Line 11: Line 11:
 
| In this tutorial, we will learn:
 
| In this tutorial, we will learn:
  
* Introduction to '''Python'''  
+
Introduction to '''Python'''  
  
* Measure AC voltage using '''Plot window''' and '''Python'''  
+
Measure AC voltage using '''Plot window''' and '''Python'''  
  
* Generate a '''Sine wave'''
+
Generate a '''Sine wave'''
  
* Measure external and internal voltages using '''Python'''  
+
Measure external and internal voltages using '''Python'''  
  
 
|-
 
|-
 
|00:22
 
|00:22
|* Measure '''capacitance''' and '''resistance''' using Plot window & '''Python'''
+
| Measure '''capacitance''' and '''resistance''' using Plot window & '''Python'''
 
+
Generate a '''Square wave'''  
* Generate a '''Square wave'''  
+
Show connections and '''circuit diagrams''' for our experiments.
 
+
* Show connections and '''circuit diagrams''' for our experiments.
+
  
 
|-
 
|-
Line 31: Line 29:
 
| Here, I am using:
 
| Here, I am using:
  
* '''ExpEYES '''version '''3.1.0'''
+
'''ExpEYES '''version 3.1.0
  
* '''Ubuntu Linux ''' OS version '''14.10'''
+
'''Ubuntu Linux OS''' version 14.10
  
 
|-
 
|-
 
|00:43
 
|00:43
 
| To follow this tutorial, you should be familiar with:
 
| To follow this tutorial, you should be familiar with:
 
+
'''ExpEYES Junior''' interface
* '''ExpEYES Junior''' interface
+
Basic '''Python programming'''.
 
+
* Basic '''Python programming'''.
+
  
 
|-
 
|-
Line 55: Line 51:
 
| '''Python''' is simple and easy to learn powerful programming language.
 
| '''Python''' is simple and easy to learn powerful programming language.
  
* It is Free and '''Open Source''', cross platform high level language.
+
It is Free and '''Open Source''', cross platform high level language.
  
* It has effective approach to '''Object oriented''' program.
+
It has effective approach to '''Object oriented''' program.
  
 
|-
 
|-
Line 139: Line 135:
 
| Please note, to avoid errors on '''Python interpreter:'''
 
| Please note, to avoid errors on '''Python interpreter:'''
  
* Connect the device to the system.  
+
Connect the device to the system.  
  
* Close the '''Plot window'''.
+
Close the '''Plot window'''.
  
 
|-
 
|-
Line 183: Line 179:
 
|04:40
 
|04:40
 
|Download and install,
 
|Download and install,
 
+
'''matplotlib''' version '''1.4.3 '''
* '''matplotlib''' version '''1.4.3 '''
+
'''numpy''' version '''1.9''' or above.
 
+
* '''numpy''' version '''1.9''' or above.
+
  
 
|-
 
|-
Line 198: Line 192:
 
|-
 
|-
 
|05:05
 
|05:05
|Type''' p=expeyes.eyesj.open() ''' and press '''Enter''' as before.
+
|Type:''' p=expeyes.eyesj.open()''' and press '''Enter''' as before.
  
 
|-
 
|-
Line 224: Line 218:
 
|-
 
|-
 
|06:04
 
|06:04
| To view the output, type: "plot" within brackets "t, v". '''plot within brackets t,v''' generates a '''Sine wave''' on a new window.
+
| To view the output, type: "plot" within brackets "t, v".
 +
'''plot within brackets t,v''' generates a '''Sine wave''' on a new window.
  
 
|-
 
|-
Line 288: Line 283:
  
 
|-
 
|-
|07:45
+
|07:59
 
| Now, I will demonstrate '''AC''' and '''DC''' components of a voltage using '''capacitor''' and '''resistor'''. And also, generate a '''square wave.'''
 
| Now, I will demonstrate '''AC''' and '''DC''' components of a voltage using '''capacitor''' and '''resistor'''. And also, generate a '''square wave.'''
  
Line 294: Line 289:
 
|08:11
 
|08:11
 
| In this experiment,  
 
| In this experiment,  
* '''A1''' is connected to '''SQR1'''.  
+
'''A1''' is connected to '''SQR1'''.  
 
+
'''SQR1''' is connected to '''A2''' through a '''capacitor'''.
* '''SQR1''' is connected to '''A2''' through a '''capacitor'''.
+
'''A2 '''is connected to '''ground(GND)''' through 200K '''resistor'''.
 
+
* '''A2 '''is connected to '''ground(GND)''' through 200k '''resistor'''.
+
  
 
|-
 
|-
Line 395: Line 388:
 
|11:17
 
|11:17
 
|In this tutorial, we have learnt:
 
|In this tutorial, we have learnt:
* Introduction to '''Python'''
+
Introduction to '''Python'''
 
+
Measure AC voltage using Plot window & '''Python'''
* Measure AC voltage using Plot window & '''Python'''
+
Generate a '''Sine''' wave
 
+
Measure external and internal voltages using '''Python'''
* Generate a '''Sine''' wave
+
 
+
* Measure external and internal voltages using '''Python'''
+
  
 
|-
 
|-
 
|11:33
 
|11:33
 
|Measure '''capacitance''' & '''resistance''' using Plot window & '''Python'''
 
|Measure '''capacitance''' & '''resistance''' using Plot window & '''Python'''
 
+
Generate a '''Square wave'''
* Generate a '''Square wave'''
+
Show connections & circuit diagrams for our experiments.
 
+
* Show connections & circuit diagrams for our experiments.
+
  
 
|-
 
|-
 
|11:45
 
|11:45
| As an assignment,
+
| As an assignment,Measure the '''resistance''' of your finger using Plot window.  
* Measure the '''resistance''' of your finger using Plot window.  
+
Using '''python''', generate a combination of '''Sine''' and '''Square waves.'''
* Using '''python''', generate a combination of '''Sine''' and '''Square waves.'''
+
  
 
|-
 
|-
Line 435: Line 422:
 
|-
 
|-
 
|12:20
 
|12:20
| This tutorial is contributed by Kaushik Datta and Madhuri Ganapathi.
+
| This tutorial is contributed by Kaushik Datta and Madhuri Ganapathi.Thank you for joining.
Thank you for joining.
+
 
|}
 
|}

Latest revision as of 17:04, 27 March 2017

Time Narration
00:01 Hello everyone. Welcome to this tutorial on Communicating to ExpEYES using Python.
00:07 In this tutorial, we will learn:

Introduction to Python

Measure AC voltage using Plot window and Python

Generate a Sine wave

Measure external and internal voltages using Python

00:22 Measure capacitance and resistance using Plot window & Python

Generate a Square wave Show connections and circuit diagrams for our experiments.

00:34 Here, I am using:

ExpEYES version 3.1.0

Ubuntu Linux OS version 14.10

00:43 To follow this tutorial, you should be familiar with:

ExpEYES Junior interface Basic Python programming.

00:52 If not, for relevant tutorials, please visit our website.
00:56 Let's begin with the introduction to Python.
01:00 Python is simple and easy to learn powerful programming language.

It is Free and Open Source, cross platform high level language.

It has effective approach to Object oriented program.

01:15 Let's make sure that Python is installed on our system.
01:18 Press CTRL+ ALT and T keys to open the Terminal.
01:22 To start Python interpreter, type: "python" and press Enter. Details regarding default version of Python will be displayed on the Terminal.
01:36 The displayed three angle brackets indicate Python prompt(>>>). Now, you are ready to type commands.
01:44 For more details about Python programming, please visit our website.
01:49 I will discuss about the channels on the top Panel of the device.
01:54 On the top Panel, each terminal is assigned to a specific channel number.
02:00 For example- channel 1 is assigned to A1 and channel 2 to A2.
02:07 I will show how to connect wires to the device.
02:11 Device has screw terminals on either side.
02:15 To make the connection, we insert wires into the terminals and tighten the screws. Here A2 is connected to SINE.
02:22 This is the circuit diagram.
02:28 Let's perform an experiment to measure the voltage of A2 and show its Sine wave.
02:36 Let's see the result on the Plot window.
02:39 On the Plot window, click on A2 to display the voltage of A2. Voltage of A2 is displayed below.
02:48 Click on A2 and drag to channel CH1. When we drag A2 to CH1, input data of A2 is assigned to CH1.
02:59 Move the msec/div slider to show the Sine wave. Click on A2 to show change in voltages of A2.
03:09 Click on CH1 and drag to FIT. The voltage and frequency of A2 are displayed on the right.
03:16 We will perform the same experiment and measure voltage of A2 using Python.
03:23 Please note, to avoid errors on Python interpreter:

Connect the device to the system.

Close the Plot window.

03:31 To import eyes library from ExpEYES, type at the prompt "import expeyes.eyesj". Press Enter.
03:40 Type: p=expeyes.eyesj.open() and press Enter. open() function returns an object if hardware is found.
03:53 These lines will load the ExpEYES library and establish connection to the device.
03:58 To view the voltage of A2, type: "print p.get_voltage" within brackets "2" and press Enter.
04:08 Output shows voltage of A2. Similarly, we can show the various voltages of A2.
04:15 Voltage of A2 changes as it is an AC voltage.
04:20 To generate plots using Python interpreter,

install python-matplotlib library using Synaptic Package Manager.

04:30 I have already installed python-matplotlib library on my system.
04:36 To generate plots on Windows Operating system:
04:40 Download and install,

matplotlib version 1.4.3 numpy version 1.9 or above.

04:49 Copy the installed ExpEYES files and drivers and paste in C drive.
04:55 To generate Sine wave- at the python prompt, type: "import expeyes.eyesj" and press Enter.
05:05 Type: p=expeyes.eyesj.open() and press Enter as before.
05:12 Type: from pylab import * (asterisk). "from pylab import *" is a program from matplotlib library. Press Enter.
05:26 Type: ion(). This command sets pylab interactive mode.

Press Enter.

05:35 Type: "t,v=p.capture" within brackets "2, 200, 100".

"t", "v" are time and voltage vectors.

05:50 2 is channel number for A2, 200 is the number of data points, 100 is a time interval between subsequent measurements.
06:02 Press Enter.
06:04 To view the output, type: "plot" within brackets "t, v".

plot within brackets t,v generates a Sine wave on a new window.

06:15 Press Enter.
06:18 We can generate a Sine wave using the above commands on Windows command prompt as well.
06:26 Next, let's measure voltage of A1 using a battery as an external voltage source.
06:32 To measure external voltage source, Ground(GND) is connected to A1 through a battery of 3V.
06:39 This is the circuit diagram. We will show the value of A1 using Python interpreter.
06:46 At the python prompt:

Type: "import expeyes.eyesj" and press Enter.

06:53 Type: p=expeyes.eyesj.open(), and press Enter.
06:59 Type: print p.get_voltage within brackets 1 and pressEnter.
07:07 Here, Channel 1 is assigned to A1. Voltage of A1 is displayed on the terminal.
07:14 Let's measure voltage of A1 using PVS as internal voltage source.
07:20 In this experiment, PVS is connected to A1.
07:24 This is the circuit diagram.
07:28 Back to the terminal. Type: print p.set_voltage within brackets 3 and press Enter.
07:39 Here, voltage of PVS will be set to 3 volts. Voltage of PVS is displayed.
07:47 Type: "print p.get_voltage" within brackets "1" and press Enter. voltage of A1 is displayed on the terminal.
07:59 Now, I will demonstrate AC and DC components of a voltage using capacitor and resistor. And also, generate a square wave.
08:11 In this experiment,

A1 is connected to SQR1. SQR1 is connected to A2 through a capacitor. A2 is connected to ground(GND) through 200K resistor.

08:25 This is the circuit diagram.
08:27 Let's see the result on the Plot window.
08:31 On the Plot window, click on Measure C on IN1 button.
08:36 Capacitance of IN1 is displayed as -0.6 pF (pico farads).
08:42 Click on Measure R on SEN button. Resistance of SEN is displayed as 560 Ω(ohms).
08:51 Please note you may get slightly different values of Capacitance & Resistance.
08:57 Click on SQ1 and drag to CH1.

SQ1 is assigned to channel CH1.

09:04 Click on A2 and drag to CH2.

A2 is assigned to channel CH2.

09:12 Click on SQR1 check box to show the Square waves. Move the msec/div slider to adjust the waves.
09:23 Click on CH2 and drag to FIT. Voltage and frequency of A2 are displayed on the right side.
09:32 We will perform the same experiment to measure Capacitance, Resistance and generate a Square wave using Python interpreter.
09:41 At the python prompt, type: "import expeyes.eyesj" and press Enter.
09:50 Type: p=expeyes.eyesj.open() and press Enter.
09:58 To display the Capacitance value, type: p.measure_cap() and press Enter.
10:07 Capacitance value is displayed on the terminal.
10:11 To display the Resistance value, type: p.measure_res() and press Enter.

Resistance value is displayed on the terminal.

10:24 To generate a Square wave, type: from pylab import *(asterisk) and press Enter.

Type: ion() and press Enter.

10:36 Type: print p.set_sqr1 within brackets 100 and press Enter. Here 100 is the frequency of the square wave.
10:49 Type: t,v=p.capture within brackets 6, 400, 100 and press Enter.
11:00 Type: plot within brackets t,v. plot within brackets t,v generates a square wave on a new window.
11:12 Press Enter.
11:14 Let's summarize.
11:17 In this tutorial, we have learnt:

Introduction to Python Measure AC voltage using Plot window & Python Generate a Sine wave Measure external and internal voltages using Python

11:33 Measure capacitance & resistance using Plot window & Python

Generate a Square wave Show connections & circuit diagrams for our experiments.

11:45 As an assignment,Measure the resistance of your finger using Plot window.

Using python, generate a combination of Sine and Square waves.

11:56 Show circuit diagrams for the above experiments.
11:59 This video summarizes the Spoken Tutorial project. If you do not have good bandwidth, you can download and watch it.
12:07 We conduct workshops using Spoken Tutorials and give certificates. Please contact us.
12:13 The Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India.
12:20 This tutorial is contributed by Kaushik Datta and Madhuri Ganapathi.Thank you for joining.

Contributors and Content Editors

Pratik kamble, Ranjana, Sandhya.np14