In my last post, I wrote about the system components and gone through the proposed electronic components. This post is dedicated to firmware architecture of the emission sensor. As a reference to the diagram in that post, this node consists of:
- TPS767D301 Dual Channel LDO to provide 5V and 3.3V rails
- MSP430FR5969 as the micro controller unit
- nRF8001 Bluetooth Low Energy module for communications with a smartphone
- ADXL362 accelerometer for detecting vehicle vibration
- MQ-135 sensor for measuring air quality, particularly CO2 emissions
By checking the pinouts for each component, I have decided to initially wire the different modules to the MSP430FR launchpad in the following configuration:
Firmware Architecture
Before writing any code, the structure for the firmware must have a level of abstraction such that any code can be re-used on a different platform. A simple architecture will be used as a framework for the firmware code base as shown below.
This architecture is very generic and provides a level of separation between each module which should make the code portable and should still work on a different platform, i.e. using the CC3200 module instead of the MSP430FR. All platform specific code will reside in the low level block which is then abstracted by the (Hardware Abstraction) layer above. This approach with the software design will enable me to code and test one module at a time in isolation. Each layer of the codebase will follow a set of API's and guidelines. This will be covered in my next post along with some sample code.
For now enjoy some of the pics for this setup.
(Clockwise) MSP-EXP430FR5969 Launchpad, Click booster pack adapter, MQ-135 Air Quality Click board, nRF8001 Module, ADXL362
Texas Instruments MSP-EXP430FR5969 Launchpad
MQ-135 Air Quality Click board and click Booster Pack
Nordic nRF8001 Bluetooth Low Energy module
Btw, I accidentally bricked my MSP430FR launchpad whilst mocking around with the different compilers, testing out different Ti tools for the platform and upgrading the FET firmware. Not exactly sure which from the above caused the corruption, but basically, the MSP430FR5969 chipset could no longer be identified by emulation tool. I tried looking for the cause and the solution online but never found a real answer. So with a bit of courage and determination, I ended up replacing the chip with another one.
Top Comments