Académique Documents
Professionnel Documents
Culture Documents
digital out
analog in
sensor network
C. Holzmann
Project Requirements
" The sensor data (see next slide) should be shown on an LCD display.
" connected to the Arduino board via the RS232 interface (Pin 0/1)
" use a rotary encoder to switch between different displayed sensor values
" some of the currently displayed values can be reset with a push button
" The smart sensor should also be accessible from a PC via the USB interface.
" define and implement a simple protocol for accessing the sensors
– request selected sensor data (see next slide)
– request and change defined alarm thresholds (they have default
values)
– request and reset minimum and maximum values
– start and stop automatic sensor data transmission Bonus!
– …
" use either the smart sensor application available at the e-learning platform,
" a terminal program (e.g. HTerm) or implement your own simple client :-)
C. Holzmann
Project Requirements
" Accelerometer (ADXL335)
" the following sensor data should be provided via the LCD display and the PC
– (1) current acceleration for all three axes in [g]
– (2) maximum absolute (+/-) accelerations for all three axes in [g],
– resettable with push button
– (3) tilt (roll and pitch) in [°] (see slide 203 pp.) Bonus!
– (4) distance in [m] (see slide 207 pp.), resettable with push button
" trigger alarm if defined max. total acceleration is exceeded (yellow LED 1)
total
accelera6on
=
sum
of
all
three
accelera6on
vectors
" Temperature sensor (NTC thermistor)
" the following sensor data should be provided via the LCD display and the PC
– (5) current temperature T in [°C]
– (6) minimum and maximum temperature in [°C], resettable with push
button
" trigger alarm if defined max. temperature or dT/dt is exceeded (yellow LED
2)
C. Holzmann
Project Requirements
" General requirements:
" linearize the temperature sensor (e.g. table-based)
" provide means for calibration with known temperature or acceleration
" implement plausibility checks and trigger alarm if a sensor fails (one red
" LED for each sensor)
" Search the Arduino playground (http://arduino.cc/playground/) for code
" Examples (linearization, calibration, sensor and display interfacing) and the
Sparkfun website (http://www.sparkfun.com/) for data sheets and further
information about the used electronic components.
" Solve the project in groups of two until May 6, 2014 (11:55 pm).
" submit implementations (PDE files) and a documentation (PDF file with
" user guide, protocol, electronic circuit, how linearization and calibration of
" the sensors works, results and pictures of tests, …) as a single ZIP file
" use the open-source tool Fritzing (http://fritzing.org/) for documentation of
" the electronic Arduino circuit
C. Holzmann
NTC Thermistor Linearization
and Calibration (example)
" Linearization:
" calculate voltage drop over sensor for some points
– steps of 5° in the range of -10° to +50°C
" calculate the resulting ADC values
" create a table with temperature <=> ADC value
" calculate actual value from nearest table value and a linear equation
" for the segment
" Calibration:
" send current temperature to the smart sensor
" determine ADC values and set offset accordingly
" offset = ADC value (measured) – ADC value (calculated)
" subtract offset before searching the table
C. Holzmann
Communication Protocol
(example, to be adapted if used)
Message Format
START LEN ADR COMMAND DATA_FORMAT DATA
… STOP
C. Holzmann
Communication Protocol
(example, to be adapted if used)
START LEN ADR COMMAND DATA_FORMAT REQ/RESP
DATA
… to
bSTOP
e
extended
with
<lt
(and
op6onally
distance)
Commands
Command Direc<on Descrip<on Value
REQ_PARA -‐>
sensor request
of
certain
parameter
(see
next
table) 40
RESP_PARA -‐>
bus response
with
parameter 41
SET_PARA -‐>
sensor change
parameter
(see
next
table) 42
ALARM_TEMP -‐>
bus defined
temperature
threshold
exceeded 50
ALARM_X
(_Y,
_Z) -‐>
bus defined
total
accelera6on
threshold
exceeded 60
C. Holzmann