Scratch-Technology

Home Page

Large Universal Timer

8 Channel Servo Controller

30 Channel Servo Controller

30 Channel USB Servo Controller

Simple Data Capture

Links

Contact


SDC1: Simple Data Capture Device 1 Channel 5KHz

Simple Data Capture

SDC1 Simple Data Capture Device

"That's the old passage to Ravenholm... we don't go there anymore." - Alyx Vance

Notices and Credits

If you just want to download the PC and PIC source code please go to the bottom of the page
Copyright Richard Gardiner 2008. This project is the result of the application of my spare time and is released under the terms of the GNU GPL as free software. A copy of the licence is included with the source code files.

GPLv3 Logo

SDC1 GUI software makes use of the Qt toolkit from trolltech
SDC1 GUI software is based in part on the work of the Qwt project http://qwt.sf.net
SDC1 GUI software is based in part on the work of the QextSerialPort project http://qextserialport.sf.net

SDC1 hardware was designed using the excellent, free KiCAD software.

SDC1 firmware is written for the SDCC compiler.

The SDC1 device is a simple device to capture an analog signal and report it to some computer software where the recorded values may be saved into a file for later analysis.

Completed unit

This project had a time scale of only two weeks from initial conception through to deployment, as such it may be a little patchy in some areas. The project involved developing hardware, firmware and software. Sections describing each of these areas follow.

Hardware

The SDC1 hardware will appear familiar to anyone that undertakes a aimple PC interfacing project that uses the serial port. A PIC18F4231 microcontroller reads a scaled analog voltage from a TL071 operational amplifier and outputs serial data to a PC through a MAX232 RS232 interface chip.

Inside the SDC1

The prototype device is constructed on stripboard using through-hole componets and installed in a ABS plastic box measuring 110x80x35mm. If more device are built in the future then a commitment will be made to PCB using surface mount components, however  more features will probably be required before this is worthwhile.
Below is the schematic of the SDC1, click for a larger image.

SDC1 Schematic

Firmware

Firmware for the SDC1 is written in c and compiled with the SDCC compiler for the PIC 16 and 18 series chips from microchip (and others) (see links section). The firmware sets up the device to continually sample the incoming analog voltage signal and reports it to the PC as frequently as possible.

Software

The software part of the SDC1 project comprises a short GUI application writtin in C++ using the Qt toolkit from trolltech , a serial port interface class called QextSerialPort and a QwtPlot data plotting classes (see links section).
The different methods of interfacing with the serial port and handling the incoming data were experimented with. The latest version uses QTimers to periodically check the serial port for incoming data and for updating the GUI. This works fairly well. Earlier versions used a second thread (QThread) for serial port interfacing but this was abandoned on discovery of excessivly slow operation on the Windows platform. This problem has since been determind to be due to incorrect setting of the Windows read timeout values during serial port setup - a problem with the qextserialport class. (see section below)

SDC1 GUI running on SUSE Linux

SDC1 GUI running on Windows XP


The software allows changing of the time base over which the incoming data is captured to internal data structures, triggering features may be added in the future. The user may select any time base from 10 to 10000 ms. Data may be saved to a file at any time and capture can be stopped and restarted at any time.
The software displays the current measured pressure along with the associated ADC result value and the pre and post scaling voltages, this is included to help diagnose any potential problems.
The program features a log at the bottom of the GUI where current operations, status and errors or warnings are reported. This log is periodically (every 5 seconds) written out to a file allowing investigation of any problems during the last program run

Project Status

A prototype device is complete and functional, software is complete and satisfactory - for now. The prototype device has been deployed in a undergraduate engineering project for which it was designed. Faults will no doubt be found and feature requests made. For now at least this project is complete.
The GUI software is rather CPU intensive on both Linux and Windows - using approximatly 40-50% cpu on an old AMD Athlon machine. This problem may be addressed in the future.

More Info

Your comments are always welcome, if you have specific questions or would like more information on this or any of the other projects on scratch-technology.co.uk please use the contact link in the left navigation panel.

File Downloads

Version 0.1 (22k) - 18-03-08 - Initial release with basic functionality - please make contact with feature requests or comments!


Page last modified: 06 July 2009