gas sensor

gas sensor

Search This Blog

Sunday, January 31, 2010

part 4
General
The programer can control other aspects of the program so different hardware boards can be connected to it with different sampling and broadcasting time only by changing #defines.
Below are a few of the additional features

  • Telemetry – sending or receiving using XBee or USB.
  • Sampling time – sampling time including time rate of each task.
  • ADC bit size – sampling at 8 or 10 bits (reduce buffer size and transmission time).
  • Buffer ADC size – number of ADC values in buffer which also control period of full buffer transmission.
  • Buffer message size – size of max available space for messages in buffer.
  • Number of channels to sample – from 1-8 sampling channels.
  • Power saving – enable/disable leds, enable/disable buzzer, entering sleep mode in idle task.
  • Usart debug modes – usart debug of telemetry messages, tasks duration, errors, parameters changing. Initialized procedure is seen in figure 8.
  • Other debug - simulated input signals (sin,cos,etc), display tasks switch, see figure 9.


Figure 8: usart initialization plot




Figure 9: signal simulation and task debug

Graphical user interface
A simple GUI was written in matlab.
Matlab uses serial commands to communicate with the XBee connected to the PC.

The GUI controls the following, see figure 10 (from top left)



  • start/stop button
  • arrived buffers counter
  • task debug button
  • set button to send parameters changes (from GUI to device)
  • reset max time counter
  • time counter of last read buffer
  • max time of read buffers
  • ADC values running scroll plot
  • available channels numbers in blue
  • algorithm enable/disable for each channel using check box
  • up thresholds
  • down thresholds
  • time window in msec
  • arrived message window

The user can set each of the parameters, after that the set button will be armed and change its color to red.
Pressing it will send parameters to the device and clear the red color.
After pressing the start button, GUI periodically will send buffer request command, the device will monitor those messages and will send back full buffer data if available.

Figure 10: matlab GUI

No comments:

Post a Comment