The following information is for the EMANT300, EMANT380
In this exercise, we will measure the light intensity using a Photodiode and the EMANT3X0, a Data Acquisition Module.
We will use cars to illustrate the above concepts.
We have two cars, SFL8772 is a Grey Toyota while SCU7056 is a Gold Honda.
In Visual Basic terminology, we would say that
Color is property of the Car Class
Make is another property of the Car Class
Drive is a method of the Car Class.
In your previous exercises, you have used the Console class and the methods ReadLine and Writeline to allow your program to interact with the user using the computer monitor and keyboard.
To perform Data Acquisition, we have provided a class called EMANT300 which works with the EMANT3X0 DAQ Modules and allows your program to interact with the physical world.
Enumerations are strongly typed of constants that help to make programming more meaningful and safe. In this example, the analog inputs for the EMANT300 module are fixed by hardware. The corresponding enumeration is
Member name |
Description |
---|---|
AIN0 |
AIN0 – Analog Input 0 |
AIN1 |
AIN1 – Analog Input 1 |
AIN2 |
AIN2 – Analog Input 2 |
AIN3 |
AIN3 – Analog Input 3 |
AIN4 |
AIN4 – Analog Input 4 |
AIN5 |
AIN5 – Analog Input 5 |
COM |
AINCOM – Common Analog Input |
DIODE |
DIODE – Temperature Sensing Diode |
An instance of EMANT300 is created and called DAQ. The variable DAQ is the equivalent of the car registration number. All future references to this object will use this name. See the EMANT Class Reference manual for more information.
Open is a method that instructs the program to connect to the DAQ module that is physically connected to USB port. If you are using the EMANT380 Bluetooth DAQ, the Com Port must be specified and the Find parameter set to False.
On the light application adaptor board, the light sensor is the BPW34. It has extremely high resistance when reverse biased. This resistance is reduced when light of an appropriate frequency shines on the junction. Hence, a reverse biased diode can be used as a light detector by monitoring the current running through it. Coupled to a 10 Kohm resistor, and given the specification of the BPW34 a simple relationship between lux (light intensity) and voltage is given by
lux = 1333 * Vo
VOis connected to the AIN0 and GND (COM) of the EMANT3X0 DAQ module.
The analog voltage across AIN0 and GND (COM) is read. Emant300.AIN.AIN0 and Emant300.AIN.COM are the respective enumeration. The voltage is converted to Lux and then displayed on the console output.
Finally the DAQ connection is closed. To ensure that your programs end correctly, always call the Close method before you exit your programs.
Allow unqualified reference to Emant300. If you don't include this Imports directive, all references to the Emant300 and its object will have to full
is shortened to