Learn:
The light sensor used is the BPW34. This is a high speed and high sensitive silicon PIN photodiode in a miniature flat plastic package. A photodiode is designed to be responsive to optical input. Due to its waterclear epoxy the device is sensitive to visible and infrared radiation. The large active area combined with a flat case gives a high sensitivity at a wide viewing angle.
Photodiodes can be
used in either zero bias or reverse bias. Diodes have 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 10Kohm resistor, and
given the specification of the BPW34 a simple relationship between
lux (light intensity) and voltage is given by
lux = 1333 * Vo
Imports the module emant, and creates a reference to that module in the current namespace.
An instance of the Emant300 class (defined in the emant module) and assigning the newly created instance to the variable m.
Open is a method that instructs the program to connect to the EMANT380 DAQ module that is connected to the Android Smartphone / PC. Modify the value to your mac address shown on your EMANT380 module.
HwId is a property that shows the firmware version
The analog voltage across AIN0 and GND (COM) is read. The 10K resistor reading the Photodiode current is connected to AIN0 and GND (COM). Emant300.AIN.AIN0 and Emant300.AIN.COM are the respective enumeration. The result is returned as a tuple voltage, 24 bit binary result
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.