Use of microcontrollers and MEMS for condition monitoring.

The traditional methods for high frequency data analysis involve many piezoelectric sensors, signal amplifiers and spectrum analysers the size of a modern day desktop computer. However, with the arrival of low cost and easy to use microcontrollers and Micro Electromechanical Systems (MEMS), perhaps it’s time to reconsider some of the traditional methods. This blog post aims to outline some of the challenges, limitations and success encountered whilst trying to use a combination of microcontroller and MEMS devices for condition monitoring. The equipment: Arduino MEGA 2560: . The large user community along with extensive libraries available make this an ideal choice for experimentation. ADXL345: The ADXL345 is a small, thin, low power, 3-axis accelerometer with a measurement range of upto ±16 g.   Thanks to the advances in rapid prototyping, it is incredibly easy to produce PCB’s in low quantities whilst keeping cost to a minimum. We had designed and manufactured our own PCBs to support this project. The PCB houses the accelerometer, a temperature sensor, a voltage and current sensor and a various other electronics. This test setup cost us <$100.           Challenge #1: Data storage: The Arduino lacks an onboard flash storage. Therefore it requires an external storage space to store the data. An SD card shield is the simplest solution to overcome this problem. This method however, has one big disadvantage and that is the speed at which data can be written to an SD Card. Every time the Arduino has new data to be written to the SD Card, a file in the SD Card has to be opened, the data written and then closed. Failure to close it at...

Connecting to an Access Database using PHP

So recently I started using Microsoft (MS) Access which is the Database Management System (DBMS) in the MS Office Suite. While it presented a very interactive and pleasant graphical user interface (GUI), I started running into problems when I wanted to access the data online. While it was straightforward enough to do so with SharePoint, my team and I didn’t want to go down that road as we wanted the database to integrate well with other parts of web development and not be constrained to Sharepoint. That’s when a colleague of mine, Joanna Sirkoska landed upon ADOdb which allowed us to use PHP to connect to an Access Database. In this post, I’ll briefly go through how you can connect to your chosen Access database and display the information within it using queries. The script to do so is quite straightforward and you can find it at this link. With this script you’ll either need to modify it to use your database or use the same database that I did which I have provided here.   I’ll run through some of the code here which should hopefully make things clearer if the comments in the script are not clear enough.   First of all you need to make sure you have the following line before trying anything else: include(‘C:\wamp\www\adodb5\adodb.inc.php’); To do so, check out the ADOdb link at the start and download the package. Then decide where you want to put it and make sure you change the line to reflect your path choice.   Then we need to connect to the chosen database: $conn = new COM(“ADODB.Connection”) or die(“Cannot start ADO”); $connStr = “Driver={Microsoft Access...
Speeding Up I2C Communication

Speeding Up I2C Communication

So recently we were doing some data collection with an Arduino mega and an accelerometer, specifically the ADXL345. Now the datasheet on the ADXL345 stated that the maximum sampling frequency is 3200 Hz but we found that our data points we only coming through at about 900 Hz. After some digging around the web, we found a potential cause. Although the Arduino should be able to handle up to 400 kHz I2C communication, it is by default limited to 100 kHz in a particular library header file. Now 100 kHZ should be more than enough to sample a device which is supposed to be capable of 3200 Hz sampling but it’s not as straightforward as that. We think that although 100 kHz is the I2C bus speed, there is still going to be some time initiating communication. Depending on the library you choose to use. there could be several back and forths between the Arduino and the ADXL345 before any data is actually exchanged. We found however that by making the change to 400 kHz, we were able to obtain data at 2600 Hz which while not maxed out, is still a significant improvement! Perhaps the remainder is due to the aforementioned communication overhead. Here’s what we did to obtain the increased bus speed as laid out at this link.   Locate the twi.h header file at this location: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\utility. Now instead of just telling you the full path, I’ll provide a picture as well so you can confirm you’ve found the correct file (note the path in the top right corner).  Once you’ve located the file, note...
General Design Process and Philosophy (Part 3)

General Design Process and Philosophy (Part 3)

Once we knew what we wanted to do, all that was left was to do it! This was not a quick process however. We discovered that knowing what we wanted to do and knowing exactly how to go about doing it were quite different things. There was a lot of Googling involved. Thankfully, most of our design tools were popular and well documented, specifically Solid Works for the mechanical aspect and Arduino for the electronic and programming side of things. We also drew heavily on our previous experience, pulling ideas and skills from seemingly unrelated previous projects. During the early stages, there was not much programming as we focused more on building a basic test rig, even if it lacked sophisticated sensors and data communication. As such, Solid Works was used a lot. We would design the different components separately and then use CAD to see how it fit it within the larger assembly. There were many iterations to get it all right but eventually we completed it. Once we were satisfied with our CAD drawings, we took it to the workshop and had it produced.  ...
ADT Chamber: Preliminary Test Data

ADT Chamber: Preliminary Test Data

Preliminary tests on the operating range and control of the environmental variables within the chambers has been conducted. Results are very positive, with humidity generation and control exceeding expectations, and temperature extremes being easily attainable with no failures. Unfortunately UV output is less than expected. Humidity Control Tests: Humidity control is required for both chambers. For the UV chamber preliminary testing shows that the humidification system can raise the humidity level in the chamber to 80% in under 5 minutes from an ambient of ~35%RH. With the testing parameters used the Humidity system struggled to achieve 90%RH in the given time. The dehumidifier is effective, but slow. It is effective at maintaining a low ambient humidity, but not rapidly lowering the humidity level.   We can see that control is excellent. Achieving tolerances below +-1%RH. Additionally, we can see that the humidifier has minimal impact on the temperature of the system.   For the oven we can see that control is also excellent. Multiple temperatures are yet to be tested.   Temperature Control Tests:  Temperature is being controlled by a simple Bang-Bang control algorithm. A PID algorithm has also been implemented and tested, but results are still poor due to additional parameter tuning required. The graph below illustrates temperature control within the oven with 15 minute set point intervals and no insulation. Insulation has been added since this preliminary test. We can see we easily achieve the required temperature of 120C, and can control temperature within +-2C.  With insulation and a tuned PID it is expected that these results will improve. However, this test confirms the core functionality of the temperature...