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

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "{| border=1 ||'''Visual Cue''' ||'''Narration''' |- || '''Slide Number 1''' '''Title Slide''' || Hello everyone. Welcome to this tutorial on '''Communicating to ExpEYES usi...")
 
Line 20: Line 20:
 
* Introduction to Python
 
* Introduction to Python
  
* Measure AC voltage using Plot window & Python
+
* Measure AC voltage using Plot window & '''Python'''
  
* Generate a Sine wave
+
* Generate a '''Sine wave'''
  
* Measure external and internal voltages using Python
+
* Measure external and internal voltages using '''Python'''
  
* 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  
 
* Show connections & circuit diagrams  
 
|| 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'''
  
* 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 103: Line 103:
 
|-
 
|-
 
|| Press '''CTRL+ ALT''' and '''T''' keys.
 
|| Press '''CTRL+ ALT''' and '''T''' keys.
|| Press '''CTRL+ ALT''' and '''T''' keys to open the Terminal.
+
|| Press '''CTRL+ ALT''' and '''T''' keys to open the '''Terminal'''.
 
|-
 
|-
|| Type '''python''', press enter.
+
|| Type '''python''', press '''Enter'''.
  
 
Point to the default version of '''Python'''
 
Point to the default version of '''Python'''
||To start '''Python interpreter''' type''' python''' and press enter.
+
||To start '''Python interpreter''' type''' python''' and press '''Enter'''.
  
Details regarding default version of  '''Python''' will be displayed on the Terminal.
+
Details regarding default version of  '''Python''' will be displayed on the '''Terminal'''.
 
|-
 
|-
|| Point to the angle brackets.
+
|| Point to the '''angle brackets'''.
|| The displayed three angle brackets indicate '''Python''' prompt(>>>).
+
|| The displayed three '''angle brackets''' indicate '''Python''' prompt(>>>).
  
Now you are ready to type commands
+
Now you are ready to type '''commands'''.
 
|-
 
|-
 
||'''Slide Number 7'''
 
||'''Slide Number 7'''
Line 124: Line 124:
  
 
'''www.spoken-tutorial.org'''.  
 
'''www.spoken-tutorial.org'''.  
|| For more details about '''Python''' programming please visit our website.  
+
|| For more details about '''Python''' programming, please visit our website.  
 
|-
 
|-
 
||  
 
||  
Line 130: Line 130:
 
|-
 
|-
 
|| Point to the top '''Panel'''
 
|| Point to the top '''Panel'''
|| On the top''' Panel''' each terminal is assigned to a specific channel number.
+
|| On the top''' Panel''' each '''terminal''' is assigned to a specific '''channel''' number.
 
|-
 
|-
 
|| Point to '''A1'''  
 
|| Point to '''A1'''  
  
 
Point to '''A2'''
 
Point to '''A2'''
|| For example channel '''1''' is assigned to '''A1''' and channel '''2''' to '''A2'''.
+
|| For example '''channel 1''' is assigned to '''A1''' and '''channel 2''' to '''A2'''.
 
|-
 
|-
 
|| Point to the device.
 
|| Point to the device.
||I will show how to connect wires to the device
+
||I will show how to connect wires to the device.
 
|-
 
|-
 
|| Point to the screw terminals.
 
|| Point to the screw terminals.
|| Device has screw terminals on either sides.  
+
|| Device has '''screw terminals''' on either sides.  
 
|-
 
|-
 
|| Point to the screw terminals.
 
|| Point to the screw terminals.
Line 148: Line 148:
 
Show the process.
 
Show the process.
  
Point to the circuit diagram.
+
||To make the connection, we insert wires into the '''terminals''' and tighten the screws.
 
+
||To make the connection we insert wires into the terminals and tighten the screws.
+
  
 
Here '''A2 '''is connected to '''SINE.'''
 
Here '''A2 '''is connected to '''SINE.'''
 
+
|-
This is the circuit diagram.
+
||Point to the circuit diagram.
 +
||This is the circuit diagram.
 
|-
 
|-
 
|| '''Slide Number 8'''
 
|| '''Slide Number 8'''
Line 171: Line 170:
 
Voltage of '''A2''' is displayed below.
 
Voltage of '''A2''' is displayed below.
 
|-
 
|-
|| Click on '''A2''', drag to channel '''CH1'''.
+
|| Click on '''A2''', drag to '''channel CH1'''.
|| Click on '''A2''' and drag to channel '''CH1'''
+
|| Click on '''A2''' and drag to '''channel CH1'''
 +
 
  
when we drag '''A2''' to '''CH1''' input data of '''A2 '''is assigned to '''CH1'''.
+
When we drag '''A2''' to '''CH1,''' input data of '''A2 '''is assigned to '''CH1'''.
  
 
|-
 
|-
Line 189: Line 189:
 
|| Click on '''CH1''' and drag to '''FIT'''.  
 
|| Click on '''CH1''' and drag to '''FIT'''.  
  
The voltage and frequency of '''A2''' is displayed on the right.
+
The voltage and frequency of '''A2''' are displayed on the right.
 
|-
 
|-
 
||   
 
||   
Line 212: Line 212:
 
||Type at the  prompt:
 
||Type at the  prompt:
  
'''import expeyes.eyesj'''  press enter.
+
'''import expeyes.eyesj'''  press '''Enter'''.
 
|| To import “'''eyes'''” library from '''ExpEYES''',  type at the prompt:
 
|| To import “'''eyes'''” library from '''ExpEYES''',  type at the prompt:
  
'''import expeyes.eyesj''' press enter.
+
'''import expeyes.eyesj''' press '''Enter'''.
 
|-
 
|-
 
|| Type at the  prompt:
 
|| Type at the  prompt:
'''import expeyes.eyesj'''  press enter.
+
'''import expeyes.eyesj'''  press '''Enter'''.
  
 
Point to '''open()''' function
 
Point to '''open()''' function
  
 
Point to the lines
 
Point to the lines
|| Type '''p=expeyes.eyesj.open() ''' and press enter.
+
|| Type '''p=expeyes.eyesj.open() ''' and press '''Enter'''.
  
'''open() ''' function returns an object if hardware is found.
+
'''open() function''' returns an object if hardware is found.
  
 
These lines will load the '''ExpEYES''' library and establish connection to the device.
 
These lines will load the '''ExpEYES''' library and establish connection to the device.
Line 236: Line 236:
 
|| To view the voltage of '''A2''', type
 
|| To view the voltage of '''A2''', type
  
'''print p.get_voltage(2) ''' and press enter.
+
'''print p.get_voltage(2) ''' and press '''Enter'''.
  
 
Output shows voltage of '''A2'''  
 
Output shows voltage of '''A2'''  
  
 
Similarly, we can show the various voltages of '''A2'''.
 
Similarly, we can show the various voltages of '''A2'''.
 +
  
 
Voltage of '''A2''' changes as it is an '''AC ''' voltage.  
 
Voltage of '''A2''' changes as it is an '''AC ''' voltage.  
Line 266: Line 267:
 
Download and install,  
 
Download and install,  
  
'''matplotlib v 1.4.3'''
+
*'''matplotlib v 1.4.3'''
  
'''numpy v 1.9 ''' or above.
+
*'''numpy v 1.9 ''' or above.
  
 
Copy the installed '''ExpEYES''' files and drivers and paste in '''C drive'''.
 
Copy the installed '''ExpEYES''' files and drivers and paste in '''C drive'''.
Line 281: Line 282:
 
Copy the installed '''ExpEYES''' files and drivers and paste in '''C drive'''.
 
Copy the installed '''ExpEYES''' files and drivers and paste in '''C drive'''.
 
|-
 
|-
|| Type '''import expeyes.eyesj, '''press enter.
+
|| Type '''import expeyes.eyesj, '''press '''Enter'''.
  
Type''' p=expeyes.eyesj.open(),''' press enter.
+
Type''' p=expeyes.eyesj.open(),''' press '''Enter'''.
|| To generate  '''Sine wave''', at the python prompt,
+
|| To generate  '''Sine wave''', at the '''python''' prompt,
  
Type '''import expeyes.eyesj''' and press enter.
+
Type '''import expeyes.eyesj''' and press '''Enter'''.
  
Type''' p=expeyes.eyesj.open() ''' and press enter as before.
+
Type''' p=expeyes.eyesj.open() ''' and press '''Enter''' as before.
  
 
|-
 
|-
|| Type '''from pylab import '''<nowiki>*</nowiki>(asterisk), press enter.
+
|| Type '''from pylab import '''<nowiki>*</nowiki>(asterisk), press '''Enter'''.
  
 
Point to '''from pylab import *'''
 
Point to '''from pylab import *'''
Line 297: Line 298:
  
 
'''from pylab import *''' is a program from '''matplotlib library'''.
 
'''from pylab import *''' is a program from '''matplotlib library'''.
Press enter.
+
Press '''Enter'''.
 
|-
 
|-
|| Type ''' ion()''', press enter.
+
|| Type ''' ion()''', press '''Enter'''.
  
 
Point to '''ion()'''
 
Point to '''ion()'''
Line 306: Line 307:
 
This command sets '''pylab ''' interactive mode.
 
This command sets '''pylab ''' interactive mode.
  
press enter.
+
Press '''Enter'''.
  
 
|-
 
|-
|| Type ''' t,v=p.capture(2,200,100),''' press enter.
+
|| Type ''' t,v=p.capture(2,200,100),''' press '''Enter'''.
  
 
Point to “'''t,v'''
 
Point to “'''t,v'''
Line 322: Line 323:
 
“'''t,v''' are time and voltage vectors.
 
“'''t,v''' are time and voltage vectors.
  
“2” is channel number for '''A2''',  
+
“2” is '''channel''' number for '''A2''',  
  
 
“200” is the number of data points,
 
“200” is the number of data points,
Line 328: Line 329:
 
“100” is a time interval between subsequent measurements.
 
“100” is a time interval between subsequent measurements.
  
Press enter
+
Press '''Enter'''
 
|-
 
|-
|| type '''plot(t,v),''' press enter.
+
|| type '''plot(t,v),''' press '''Enter'''.
  
Point to Sine wave  
+
Point to Sine wave.
 
|| To view the output, type '''plot(t,v)'''  
 
|| To view the output, type '''plot(t,v)'''  
  
 
'''plot(t,v)''' generates a '''Sine wave''' on a new window.
 
'''plot(t,v)''' generates a '''Sine wave''' on a new window.
  
Press enter
+
Press '''Enter'''.
 
|-
 
|-
 
|| Show the screen.
 
|| Show the screen.
|| We can generate a '''Sine wave''', using the above commands on '''Windows command prompt''' as well.
+
|| We can generate a '''Sine wave''', using the above commands on '''Windows command prompt,''' as well.
 
|-
 
|-
 
||'''Slide Number 12'''  
 
||'''Slide Number 12'''  
Line 347: Line 348:
  
 
Measure voltage of '''A1''' using a battery as an external voltage source.
 
Measure voltage of '''A1''' using a battery as an external voltage source.
|| Next let's measure voltage of '''A1''' using a battery as an external voltage source.
+
|| Next, let's measure voltage of '''A1''' using a battery as an external voltage source.
 
|-
 
|-
 
|| Show the circuit diagram
 
|| Show the circuit diagram
 
|| To measure external voltage source, '''Ground(GND)''' is connected to '''A1''' through a battery of  '''3V'''.
 
|| To measure external voltage source, '''Ground(GND)''' is connected to '''A1''' through a battery of  '''3V'''.
  
This is the circuit diagram.
+
|-
 +
||Circuit diagram image
 +
||This is the circuit diagram.
  
 
We will show the value of  '''A1''' using '''Python interpreter.'''
 
We will show the value of  '''A1''' using '''Python interpreter.'''
 
|-
 
|-
||At the python prompt:
+
||At the '''python''' prompt:
  
Type  '''import expeyes.eyesj''',  press enter.
+
Type  '''import expeyes.eyesj''',  press '''Enter'''.
  
Type '''p=expeyes.eyesj.open()''',  press enter.
+
Type '''p=expeyes.eyesj.open()''',  press '''Enter'''.
 
||At the python prompt:
 
||At the python prompt:
  
Type '''import expeyes.eyesj,'''  and press enter.
+
Type '''import expeyes.eyesj,'''  and press '''Enter'''.
  
Type''' p=expeyes.eyesj.open(), '''press enter.
+
Type''' p=expeyes.eyesj.open(), '''press '''Enter'''.
  
 
|-
 
|-
||Type '''print p.get_voltage(1),''' and press enter.
+
||Type '''print p.get_voltage(1),''' and press '''Enter'''.
  
 
Point to channel1.
 
Point to channel1.
Line 374: Line 377:
 
Point to voltage of '''A1.'''
 
Point to voltage of '''A1.'''
 
  || Type '''print p.get_voltage(1)'''  and press
 
  || Type '''print p.get_voltage(1)'''  and press
enter.
+
'''Enter'''.
  
 
Here '''Channel 1''' is assigned to '''A1'''.
 
Here '''Channel 1''' is assigned to '''A1'''.
Line 392: Line 395:
 
This is the circuit diagram.
 
This is the circuit diagram.
 
|-
 
|-
|| Type '''print p.set_voltage(3)''', press enter.
+
|| Type '''print p.set_voltage(3)''', press '''Enter'''.
  
 
Point to value of ''' PVS'''.
 
Point to value of ''' PVS'''.
Line 399: Line 402:
 
|| Back to the terminal.
 
|| Back to the terminal.
  
Type '''print p.set_voltage(3) ''' and press enter
+
Type '''print p.set_voltage(3) ''' and press '''Enter'''.
  
 
Here voltage of '''PVS''' will be set to 3 volts.
 
Here voltage of '''PVS''' will be set to 3 volts.
Line 406: Line 409:
  
 
|-
 
|-
|| Type '''print p.get_voltage(1),''' press enter.
+
|| Type '''print p.get_voltage(1),''' press '''Enter'''.
  
 
Point to voltage.
 
Point to voltage.
|| Type '''print p.get_voltage(1) ''' and press enter.
+
|| Type '''print p.get_voltage(1) ''' and press '''Enter'''.
  
 
Voltage of '''A1''' is displayed on the terminal.
 
Voltage of '''A1''' is displayed on the terminal.
Line 492: Line 495:
 
|| At the python prompt:
 
|| At the python prompt:
  
Type  '''import expeyes.eyesj''',  press enter.
+
Type  '''import expeyes.eyesj''',  press '''Enter'''.
  
Type '''p=expeyes.eyesj.open()''',  press enter.
+
Type '''p=expeyes.eyesj.open()''',  press '''Enter'''.
 
|| At the python prompt:
 
|| At the python prompt:
  
Type '''import expeyes.eyesj''' and press enter.
+
Type '''import expeyes.eyesj''' and press '''Enter'''.
  
Type''' p=expeyes.eyesj.open() ''' and press enter.
+
Type''' p=expeyes.eyesj.open() ''' and press '''Enter'''.
 
|-
 
|-
|| Type '''p.measure_cap()''', press enter.
+
|| Type '''p.measure_cap()''', press '''Enter'''.
  
 
Point to displayed capacitance value
 
Point to displayed capacitance value
 
|| To display the '''Capacitance ''' value:  
 
|| To display the '''Capacitance ''' value:  
  
Type '''p.measure_cap( )''' and press enter.
+
Type '''p.measure_cap( )''' and press '''Enter'''.
  
 
'''Capacitance''' value is displayed on the terminal.
 
'''Capacitance''' value is displayed on the terminal.
 
|-
 
|-
|| Type '''p.measure_res(),''' press enter.
+
|| Type '''p.measure_res(),''' press '''Enter'''.
 
|| To display the '''Resistance '''value:
 
|| To display the '''Resistance '''value:
  
Type '''p.measure_res() ''' and press enter.
+
Type '''p.measure_res() ''' and press '''Enter'''.
  
 
'''Resistance''' value is displayed on the terminal.
 
'''Resistance''' value is displayed on the terminal.
  
 
|-
 
|-
|| Type '''from pylab import *, '''press enter.
+
|| Type '''from pylab import *, '''press '''Enter'''.
  
  
Type''' ion() '''and press enter.
+
Type''' ion() '''and press '''Enter'''.
 
|| To generate a Square wave:
 
|| To generate a Square wave:
  
Type '''from pylab import *'''(asterisk) and press enter.
+
Type '''from pylab import *'''(asterisk) and press '''Enter'''.
  
  
Type ''' ion()''' and press enter.
+
Type ''' ion()''' and press '''Enter'''.
  
 
|-
 
|-
|| Type '''print p.set_sqr1(100),''' and press enter
+
|| Type '''print p.set_sqr1(100),''' and press '''Enter'''
  
  
Type''' t,v=p.capture(6,400,100)''' and press enter
+
Type''' t,v=p.capture(6,400,100)''' and press '''Enter'''
|| Type '''print p.set_sqr1(100) '''and press enter.
+
|| Type '''print p.set_sqr1(100) '''and press '''Enter'''.
  
 
Here 100 is the frequency of the square wave.
 
Here 100 is the frequency of the square wave.
  
Type''' t,v=p.capture(6,400,100)''' and press enter.
+
Type''' t,v=p.capture(6,400,100)''' and press '''Enter'''.
  
 
|-
 
|-
|| Type '''plot(t,v)''' and press enter.
+
|| Type '''plot(t,v)''' and press '''Enter'''.
  
 
Point to generated square wave.
 
Point to generated square wave.
Line 548: Line 551:
 
'''plot(t,v) '''generates a square wave on a new window.
 
'''plot(t,v) '''generates a square wave on a new window.
  
Press enter
+
Press '''Enter'''.
  
 
|-
 
|-

Revision as of 18:31, 5 August 2015

Visual Cue Narration
Slide Number 1

Title Slide

Hello everyone.

Welcome to this tutorial on Communicating to ExpEYES using Python.

Slide Number 2+3

Learning Objectives

We will learn about,

  • Introduction to Python
  • Measure AC voltage using Plot window & Python
  • Generate a Sine wave
  • Measure external and internal voltages using Python
  • Measure capacitance & resistance using Plot window & Python
  • Generate a Square wave
  • Show connections & circuit diagrams
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
  • Measure capacitance and resistance using Plot window & Python
  • Generate a Square wave
  • Show connections and circuit diagrams for our experiments.
Slide Number 4

System Requirement

  • ExpEYES v 3.1.0
  • Ubuntu Linux OS v. 14.10
Here I am using,
  • ExpEYES version 3.1.0
  • Ubuntu Linux OS version 14.10
Slide Number 5

Pre-requisties

You should be familiar with:

ExpEYES junior interface.

For relevant tutorials, visit our website.

www.spoken-tutorial.org.

To follow this tutorial, you should be familiar with:

ExpEYES Junior interface.

Basic Python programming.

If not, for relevant tutorials, please visit our website.

Let's begin with introduction to Python.
Slide Number 6

Introduction to Python

  • Simple & easy to learn powerful programming language.
  • Free & Open Source cross platform high level language.
  • Effective approach to object oriented program.
  • 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.
Let's make sure that Python is installed on our system.
Press CTRL+ ALT and T keys. Press CTRL+ ALT and T keys to open the Terminal.
Type python, press Enter.

Point to the default version of Python

To start Python interpreter type python and press Enter.

Details regarding default version of Python will be displayed on the Terminal.

Point to the angle brackets. The displayed three angle brackets indicate Python prompt(>>>).

Now you are ready to type commands.

Slide Number 7

Details About Python

For more details about Python programming

www.spoken-tutorial.org.

For more details about Python programming, please visit our website.
I will discuss about the channels on the top Panel of the device.
Point to the top Panel On the top Panel each terminal is assigned to a specific channel number.
Point to A1

Point to A2

For example channel 1 is assigned to A1 and channel 2 to A2.
Point to the device. I will show how to connect wires to the device.
Point to the screw terminals. Device has screw terminals on either sides.
Point to the screw terminals.


Show the process.

To make the connection, we insert wires into the terminals and tighten the screws.

Here A2 is connected to SINE.

Point to the circuit diagram. This is the circuit diagram.
Slide Number 8

To measure voltage of A2 and show its Sine wave'

Let's perform an experiment to measure the voltage of A2 and show its Sine wave.
Let's see the result on the Plot window.
Point to A2.

Point to voltage.

On the Plot window, click on A2 to display the voltage of A2.

Voltage of A2 is displayed below.

Click on A2, drag to channel CH1. Click on A2 and drag to channel CH1


When we drag A2 to CH1, input data of A2 is assigned to CH1.

Move msec/div slider to show the Sine wave.

Click on A2, show changing voltage of A2.

Move the msec/div slider to show the Sine wave.

Click on A2 to show change in voltages of A2.

Click on CH1, drag to FIT.

Point to voltage.

Click on CH1 and drag to FIT.

The voltage and frequency of A2 are displayed on the right.

We will perform the same experiment and measure voltage of A2 using Python.
Slide Number 9

Note

To avoid errors on the Python interpretor:

  • Connect the device to the system.
  • Close the Plot window.
Please note to avoid errors on Python interpreter:
  • Connect the device to the system.
  • Close the Plot window.
Type at the prompt:

import expeyes.eyesj press Enter.

To import “eyes” library from ExpEYES, type at the prompt:

import expeyes.eyesj press Enter.

Type at the prompt:

import expeyes.eyesj press Enter.

Point to open() function

Point to the lines

Type p=expeyes.eyesj.open() and press Enter.

open() function returns an object if hardware is found.

These lines will load the ExpEYES library and establish connection to the device.

Type print p.get_voltage(2).

Point to voltage.

Point to voltages.

To view the voltage of A2, type

print p.get_voltage(2) and press Enter.

Output shows voltage of A2

Similarly, we can show the various voltages of A2.


Voltage of A2 changes as it is an AC voltage.

Slide Number 10

Install

To generate plots using Python interpreter:

Install python-matplotlib library using Synaptic Package Manager.

To generate plots using Python interpreter:

Install python-matplotlib library using Synaptic Package Manager.

I have already installed python-matplotlib library on my system.

Slide Number 11

Install

To generate plots on Windows OS:

Download and install,

  • matplotlib v 1.4.3
  • numpy v 1.9 or above.

Copy the installed ExpEYES files and drivers and paste in C drive.

To generate plots on Windows Operating system:

Download and install,

  • matplotlib version 1.4.3
  • numpy version 1.9 or above.

Copy the installed ExpEYES files and drivers and paste in C drive.

Type import expeyes.eyesj, press Enter.

Type p=expeyes.eyesj.open(), press Enter.

To generate Sine wave, at the python prompt,

Type import expeyes.eyesj and press Enter.

Type p=expeyes.eyesj.open() and press Enter as before.

Type from pylab import *(asterisk), press Enter.

Point to from pylab import *

Type from pylab import *(asterisk).

from pylab import * is a program from matplotlib library. Press Enter.

Type ion(), press Enter.

Point to ion()

Type ion()

This command sets pylab interactive mode.

Press Enter.

Type t,v=p.capture(2,200,100), press Enter.

Point to “t,v

Point to “2”,

Point to “200”

Point to “100”

Type t,v=p.capture(2,200,100).

t,v are time and voltage vectors.

“2” is channel number for A2,

“200” is the number of data points,

“100” is a time interval between subsequent measurements.

Press Enter

type plot(t,v), press Enter.

Point to Sine wave.

To view the output, type plot(t,v)

plot(t,v) generates a Sine wave on a new window.

Press Enter.

Show the screen. We can generate a Sine wave, using the above commands on Windows command prompt, as well.
Slide Number 12

External Voltage

Measure voltage of A1 using a battery as an external voltage source.

Next, let's measure voltage of A1 using a battery as an external voltage source.
Show the circuit diagram To measure external voltage source, Ground(GND) is connected to A1 through a battery of 3V.
Circuit diagram image This is the circuit diagram.

We will show the value of A1 using Python interpreter.

At the python prompt:

Type import expeyes.eyesj, press Enter.

Type p=expeyes.eyesj.open(), press Enter.

At the python prompt:

Type import expeyes.eyesj, and press Enter.

Type p=expeyes.eyesj.open(), press Enter.

Type print p.get_voltage(1), and press Enter.

Point to channel1.

Point to voltage of A1.

Type print p.get_voltage(1) and press

Enter.

Here Channel 1 is assigned to A1.

Voltage of A1 is displayed on the terminal.

Slide Number 13

Internal Voltage

Measure voltage of A1 using PVS as internal voltage source.

let's measure voltage of A1 using PVS as internal voltage source.
Show the circuit diagram. In this experiment PVS is connected to A1.

This is the circuit diagram.

Type print p.set_voltage(3), press Enter.

Point to value of PVS.

Point to voltage.

Back to the terminal.

Type print p.set_voltage(3) and press Enter.

Here voltage of PVS will be set to 3 volts.

Voltage of PVS is displayed.

Type print p.get_voltage(1), press Enter.

Point to voltage.

Type print p.get_voltage(1) and press Enter.

Voltage of A1 is displayed on the terminal.

Slide Number 14

AC and DC components of a voltage using a capacitor & resistor and 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.

Show the picture.

Show the circuit diagram.

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.

This is the circuit diagram.

Let's see the result on the Plot window
Point to the Plot window.

Click on Measure C on IN1 button.

Point to Capacitance.

On the Plot window click on Measure C on IN1 button.

Capacitance of IN1 is displayed as -0.6pF(pico farads).

Click on Measure R on SEN button.

Point to the Resistance value of SEN.

Click on Measure R on SEN button.

Resistance of SEN is displayed as 560Ω(ohms)


Please note you may get slightly different values of Capacitance & Resistance.

Click on SQ1, drag to CH1.

Point to assigned value.

Click on SQ1 and drag to CH1.

SQ1 is assigned to channel CH1.

Click on A2, drag to CH2.

Point to assigned value.

Click on A2 and drag to CH2.

A2 is assigned to channel CH2.

Click on SQR1 check box.

Move the msec/div slider.

Click on SQR1 check box to show the Square waves.

Move the msec/div slider to adjust the waves.

Click on CH2, drag to FIT.


Point to displayed voltage and frequency of A2.

Click on CH2 and drag to FIT.

Voltage and frequency of A2 is displayed on the rightside.

Slide Number 15

Measure Capacitance, Resistance and generate a Square wave using Python interpreter.

We will perform the same experiment to: Measure Capacitance, Resistance and generate a Square wave using Python interpreter.
At the python prompt:

Type import expeyes.eyesj, press Enter.

Type p=expeyes.eyesj.open(), press Enter.

At the python prompt:

Type import expeyes.eyesj and press Enter.

Type p=expeyes.eyesj.open() and press Enter.

Type p.measure_cap(), press Enter.

Point to displayed capacitance value

To display the Capacitance value:

Type p.measure_cap( ) and press Enter.

Capacitance value is displayed on the terminal.

Type p.measure_res(), press Enter. To display the Resistance value:

Type p.measure_res() and press Enter.

Resistance value is displayed on the terminal.

Type from pylab import *, press Enter.


Type ion() and press Enter.

To generate a Square wave:

Type from pylab import *(asterisk) and press Enter.


Type ion() and press Enter.

Type print p.set_sqr1(100), and press Enter


Type t,v=p.capture(6,400,100) and press Enter

Type print p.set_sqr1(100) and press Enter.

Here 100 is the frequency of the square wave.

Type t,v=p.capture(6,400,100) and press Enter.

Type plot(t,v) and press Enter.

Point to generated square wave.

Type plot(t,v).

plot(t,v) generates a square wave on a new window.

Press Enter.

Let's summarize.
Slide Number 16

Summary

We have learnt:

  • Introduction to Python
  • Measure AC voltage using Plot window & Python
  • Generate a Sine wave
  • Measure external and internal voltages using Python
  • Measure capacitance & resistance using Plot window & Python
  • Generate a Square wave
  • Show connections & circuit diagrams for our experiments
  • Introduction to Python
  • Measure AC voltage using Plot window and Python
  • Generate a Sine wave
  • Measure external and internal voltages u sing

Python

  • Measure capacitance and resistance using Plot window and Python
  • Generate a Square wave
  • Show connections and circuit diagrams for our experiments
Slide Number 17

As an assignment,

Measure the resistance of your finger using Plot window.

Using python generate a combination of Sine and Square waves.

Show circuit diagrams for the above experiment.

As an assignment,

Measure the resistance of your finger using Plot window.

Using python generate a combination of Sine and Square waves.

Show circuit diagrams for the above experiment.

Slide Number 18

Acknowledgement

Watch the video available at

http://spoken-tutorial.org

/What is a Spoken Tutorial

It summarises the Spoken Tutorial

project.

If you do not have good bandwidth,

you can download and watch it.

  • This video summarises the Spoken Tutorial project
  • If you do not have good bandwidth, you can download and watch it.
Slide Number 19

The Spoken Tutorial Project Team

Conducts workshops using spoken

tutorials

Gives certificates to those who pass

an online test

For more details, please write to

contact@spoken-tutorial.org

* We conduct workshops using SpokenTutorials and give certificates.
  • Please contact us.
Slide number 20

Spoken Tutorial Project is a part of

the Talk to a Teacher project

It is supported by the National

Mission on Education through ICT,

MHRD, Government of India

More information on this Mission is

available at

http://spoken-tutorial.org

/NMEICT-Intro

The Spoken Tutorial Project is funded by NMEICT, MHRD Government of India.
This tutorial is contributed by Kaushik Datta and Madhuri Ganapathi..

Thank you for joining.

Contributors and Content Editors

Kaushik Datta, Madhurig, Nancyvarkey