Onboard automobile data logger
- Project Overview
By order of an American vendor of automobile communication devices we developed a new ready-to-operate product — a portable automobile recorder for control and diagnostics of technical state ("black box" for an automobile). It is plugged into a standard OBD-II plug, traces a route, fixes tens of technical parameters, records negotiations of passengers in a passenger compartment and transmits all information over a wireless channel to a dispatch-coordination center. The size of the recorder: slightly more than a matchbox.
Key characteristics of the automobile recorder
- The casing of the device is protected from unauthorized shutdown (the mechanism is blocked in a plug using a special key)
The device fixes different technical parameters according to the OBD-II standard:
- rate of motion
- engine speed rate
- fuel content
- brake operation
- coolant temperature
- air conditioning system state, etc.
- If the automobile is in a Wi-Fi access area (IEEE-802-11b/g), data of the recorder can be transmitted remotely. The capability to store information on a USB drive is also implemented.
Software provides the following functions:
- fault-tolerant firmware upgrade without data loss
- codification of an initialization file of the recorder
- The device can be used for finding causes and RTI causers, information collection for a hire fleet and parental control
Onboard recorder specifications
Hardware Processor Atmel AT91SAM9RL64, ARM 9 RAM 32 MB SDRAM, 1024 MB NAND flash Interfaces GPS Worldwide navigation network USB USB 2.0 Device WiFi IEE802-11b/g UART Used for debugging SPI Used for connection with a microchip of CAN-interface CAN Interface for automobile diagnostics Software Operating system Linux OBD-protocol support ISO9141, ISO14230, PWM, VPW General characteristics Size 66,5 mm х 56 mmх 33,8 mm
In the process of developing the onboard automobile recorder Promwad experts accomplished the following tasks:
— Software development and testing
— Case design and construction development
— Production and debugging of prototypes
- How It's Made
An American developer of innovative products and services for mobile communication devices.
Development of an onboard data logger, a portable device for monitoring and diagnostics of the vehicle’s technical condition with such functions, as logging the route of the vehicle, recording conversations between passengers in the passenger compartment and transmitting all information over a wireless channel to the control and coordination center.
The onboard data logger is a small device, a little more than the size of a matchbox, which is installed in a standard diagnostic connector of any vehicle with OBD II vehicle diagnostics support. All cars manufactured after January 1, 1996, support this standard.
The OBD II interface describes five low-level protocols:
- ISO 15765 CAN (Controller Area Network)
- ISO 14230 KWP2000 (Keyword Protocol 2000)
- ISO 9141
- SAE J1850 VPW (Variable Pulse Width Modulation)
- SAE J1850 PWM (Pulse Width Modulation)
Chrysler cars, all European cars and most Asian manufacturers use the ISO 9141 or ISO 14230 KWP2000 protocols. General Motors cars use SAE J1850 VPW, while SAE J1850 PWM is the standard for Ford models.
The functions of the device include collection, storage and transmission of information about the vehicle’s route (using the Global Positioning System (GPS)), recording of passengers’ conversations and technical condition diagnostics. The device records the following diagnostic parameters:
- Coolant temperature
- Number of engine revolutions
- Fuel consumption
- Vehicle speed
- Air conditioning system status, etc.
The collected information is transmitted to the control and coordination center over IEEE-802-11b/g Wi-Fi (if the vehicle is within the area of network coverage) or through direct connection over the USB interface.
Promwad’s experts had to perform the following tasks:
- Development of software for collecting, processing, storing and transmitting data to the control and coordination center
- Development of the enclosure design and structure, circuitry redesign
Interaction with the onboard data logger should be achieved using a graphical user interface. The software should run automatically when the device is connected to the USB port.
General structural diagram of the module:
Major development tasks include:
- Software development and testing
- Development of a graphic user interface
- Development of software for hardware testing at the place of production
The device is powered by the Atmel AT91SAM9RL64 processor with the ARM 9 kernel. The program and data memory includes 32 MB SDRAM and 1024 MB NAND Flash. The device implements the following communication interfaces: IEE802-11b/g Wi-Fi; USB 2.0 device; GPS; CAN; ISO9141, ISO14230, VPW, PWM.
Vehicle control unit emulators by such manufacturers, as Bowser Electronics and ScanTool.net, LLC, were used for testing and debugging vehicle diagnostics protocols.
While developing software for the onboard data logger, various open software applications were used, including
- Linux kernel v.2.6.35
- U-boot bootloader 2010.09
- Bootstrap initial bootloader v.1.15
- Wireless tools utilities for interaction with WiFi networks
- OpenSSL for data encryption
- GPSD server for connecting with GPS
- Buildroot 2010.08 for the product firmware assembly
It should also be noted that during software debugging, the engineers detected and successfully corrected an error in the multi-block data transfer algorithm in the standard driver of the Linux kernel v. 2.6.35 AT91 MCI. The correction data were included in the kernel release v.2.6.37.
Support for such OBD protocols, as ISO9141, ISO14230, PWM and VPW, was implemented as software by implementing OBD control real-time logic on the processor.
Major software modules:
- Module for interaction with user software through the USB interface which implements the business logic
- GPS data logging module
- GPS time synchronization module
- OBD diagnostics data logging module
- Audio file recording module (wav files)
- System resource control module
- Control elements support module
- Service utilities (software update, logging, etc.)
Structural diagram of the software:
Additionally, the device implements specialized software for automated testing of its working capacity at the stage of mass production.
For interaction with the portable onboard data logger, a configuration utility was implemented on the PC side, which runs under Windows XP and provides the user with a sequence of steps for configuring the device and testing its functionality. The device interacts with a PC through the USB interface. The user interface was designed using Qt4.7.0, QWT-5.2.0 and QSerialPort.
Here is an example of using a user utility for monitoring GPS parameters in real time:
- Effective use of Linux kernel capabilities for real-time tasks
- Reliable fault-tolerant firmware upgrade without losing user data and settings
- Full control of devices both via USB and Wi-Fi
- An encrypted configuration file
- An intuitive graphical user interface
- The enclosure features protection against unauthorized disabling of the module
Technologies Embedded Linux, gpsd, ODB-II, Qt4 Interfaces USB 2.0, Wi-Fi, CAN, ISO9141, ISO14230, VPW, PWM, UART, SPI Programming languages C, C++, bash Development tools GCC, GNU make, buildroot, qtcreator, qmake Project management tools SVN, redmine