WiSnap User Manual 2.21 04112011-JF
Page
55
of
66
16
Analog Sensor Capability
The WiSnap M1 has 8 analog sensor inputs that can be driven between 0 to 1.2VDC. The analog
inputs are sampled and the digital value read by using the
show q <channel>
command.
Warning:
Over driving these inputs will cause permanent damage.
The hardware specification of the analog input is:
Input voltage range: 0 - 1.2 V, however the A2D saturates at 400mV.
Resolution: 14 bits = 12uV
Sampling frequency: 35us
Accuracy: 5% un-calibrated
The accuracy of each analog sensor reading can be offset by up to 5% due to variation from chip to
chip. To improve accuracy it is recommend using a precision reference voltage on one of the analog
inputs to calculate the offset. The offset will be the same for all analog inputs.
For example,
- drive precision 200mV reference on analog input 4.
- read analog input 4 and compute the offset.
If you read 210mv you would know that the offset is +10mv.
When you read input 5 you would subtract 10mv from the result.
To read a sensor pin, send the following command:
show q <channel>
Channel is the analog sensor input from 0 to 7. The value for the analog sensor input is measured in
microvolts and is returned as 8xxxxx. The 8 in front is a start marker.
You can also sample multiple channels by using a bit mask:
show q 0x1<mask>
where mask is a bit mask of the channels.
For example, to read channels 0, 1, and 7, send:
show q 0x183
The return values are the format: 8<chan0>, 8<chan1>, 8<chan7>\r\n
16.1 Automatic sampling of sensor pins:
The sensor pins can be automatically sampled and data forwarded in 2 modes:
1.
the UDP broadcast packet will contain the value of the samples.
2.
in HTTP mode, the pin sampled data can be forwarded to a remote server
to enable the above modes, use the
set q sensor <mask>
command.