EPS@ISEP | The European Project Semester (EPS) at ISEP

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
report [2014/06/26 00:24] – [Bibliography] team2report [2014/06/26 14:23] (current) – [6.5 Tests and Results] team2
Line 812: Line 812:
  
 ==== 6.1 Introduction ==== ==== 6.1 Introduction ====
-//Provide here the summary of this chapter.//+In the following chapter we are going to explain how our project has grown: how we have bring it to the current state. We will write about ours solutions regarding to the architecture, software development and components. The main headlines are divided as follow we are going to present first our components, talking about what does each one do; in architecture and software development we are going to talk about signal and electrical architecture and how put everything together. We are going to talk about the software solution chosen, and then in the functionalities we are going to explain the features of our project and what the code do. Finally at the functional tests we will describe some experiments in order to try out the functionalities. Conclusion presents our achievements and how it can be improved in the future.
 ==== 6.2 Architecture ==== ==== 6.2 Architecture ====
  
 +**Electrical architecture**
 +
 +The power supply in our project comes from Li-Poly 2000 mAh battery. This battery has a nominal voltage of 3.7 V. We will convert this voltage with the battery charger and boost it uptil 5 V. The output of the booster is directly connected to the arduino 5 V. voltage input then the Arduino linear regulator and the wireless shield linear regulator take care of providing the sensor stick and the Bluetooth radio the right amount of voltage (3.3 V). The TMP 36 temperature sensor is fed at 5 V. by the arduino output in the following sketch we have the electrical architecture as well as the power consumption in mA.
 +
 +{{:elek_graf.png?500|}}
 +
 +Figure 15 - Electrical architecture of surf logger
 +
 +**Signal architecture**
 +
 +The 9 Degrees of freedom-sensor stick is communicating with an I²C (Inter-Integrated Circuit) interface with the Arduino Uno. I²C is a multi-master serial single-ended computer bus invented by the Philips semiconductor division. I²C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial Clock Line (SCL), pulled up with resistors as we can see in the following sketch it’s not necessary for us to add the pull up resistors because they are included in the mate.
 +
 +{{:ıkre_c.png?400|}}
 +
 +Figure 16 – I²C [68]
 +
 +The TMP 36 temperature sensor it’s connected to an arduino analog input this analog signal follow the graph shown below.
 +
 +{{:output_voltge.png?400|}}
 +
 +Figure 17 – Output voltage vs temperature [69]
 +
 +These signals are processed on the Arduino CPU and sent by the arduino serial port that is used the Bluetooth interface to send the data to the PC where the processed signals are used to visualize a 3D model of the board. Additionally, this data are also sent to the SD card in order to have a backup copy of the session if Bluetooth communication is lost.
 +
 +{{:baska_ark.png?500|}}
 +
 +Figure 18 - Signal Architecture
 +
 +**Physical connections**
 +
 +In the following fritzing diagram and in the table below we will explain the physical connections between all the components. The Bluetooth radio It is represented with XBee radio because they have the same footprint and the SD card is not represented in the in the diagram but it’s just plug on the SD slot of the arduino wireless SD shield.
 +
 +{{:sketch_surf_logger_bb.jpg?500|}}
 +
 +Figure 19 - Physical schematics
 +
 +
 +The connections between wireless shield and the Arduino uno and the connection between wireless shield and the Bluetooth radio are easy. Each one is mounted to the other, staked because the footprint of one matches perfectly with the pins of the other as we can see in the Figure 19.
 +
 +{{:uno.png?400|}}
 +
 +Figure 20 - Arduino Uno + Arduino wireless SD shield [70]
 +
 +In the Figure 21 we can see and XBee module plug into the wireless shield but as we have explain we will use a Bluetooth antenna that can be plug in because it has the same footprint (show Figure 21)
 +
 +
 +{{:bluetooth.png?400|}}
 +
 +Figure 21 - RN41-XV Bluetooth Module [71]
 +
 +**Cork Box Design**
 +
 +{{:kutu_ıcı.png?300|}}{{:kutu_tammi.png?300|}}
 +
 +Figure 22 – Surf Logger box
 +
 +The box made of cork and with two straps that keep the box together. There is rubber tightening in between the two halves and this makes the box waterproof.
 +
 +**Software development**
 +
 +For the software development we drew upon the free firmware to provide with the 9 DOF sensor stick in order to build our code. This firmware under GPL license allows us to read the information of the sensor stick put them in an I²C interface. It is processed and filter with the mathematical background that we will explain in the next point and sent using the serial port of the Arduino Uno. The firmware also included a processing sketch that can read this data and send through the serial port and draw a real-time 3D model that give us the orientation of the stick. In the documentation and the code, we can also find some information about how to send the data to an Android device and run the processing sketch on it.
 +
 +We also want to save data in the SD card so we will use the SD library that allows for reading from and writing to SD cards on the Arduino wireless Shield.
 +
 +Due to the box of cork and the difficulty of calculating the heat generated by the components, we will implement a function that could turn off the device when the temperature can damage the components.
 ==== 6.3 Components ==== ==== 6.3 Components ====
 +As you see in the state of the art part of the report, we had three different options to develop our project and finally decided chose the option A that consists Arduino Uno board acting like a CPU and a sensors stick that provides us all the information that we need. That option provides the possibility for adding new sensors like the temperature sensor. The reason to add temperature sensor to material list is that if there is a possible overheating risk that could damage the components, we can predict it before. In Table 14 material list is shown.
 +
 +^ Materials       ^ Name       ^ Model          ^Price ^Website ^ 
 +| Control Panel|Arduino Uno Rev.3| UNO-REV3| 20,00|http://www.inmotion.pt/store/arduino-uno-rev-3 |
 +| Shield Module for Bluetooth | Arduino Wireless SD Shield | ARDU-0019|19,90|http://www.inmotion.pt/store/Search-Resultskeywords=Arduino+Wireless+SD+Shield&osCsid=61cb04f71da4bfabf3e1ad5190b1ee20&x=0&y=0|
 +|Bluetooth Module|RN41-XV Bluetooth Module - Chip Antenna |INM-0553|27,95|http://www.inmotion.pt/store/rn41-xv-bluetooth-module-chip-antenna|
 +|All Sensors |9 Degrees of Freedom - Sensor Stick | INM-0431    |78,95|http://www.inmotion.pt/store/9-degrees-of-freedom-sensor-stick |
 +| Battery |Poymer Lithium Ion  Battery-2000mAh  |INM-0138|13,95 |http://pt.mouser.com/ProductDetail/mikroElektronika/MIKROE-1120/qs=sGAEpiMZZMuXcNZ31nzYhZWKDTS6Fwr59iEzhr92eGE%3d |
 +| Shield Module for Battery |Power Cell - LiPo Charger/Booster| INM-0496    |17,95|http://www.inmotion.pt/store/power-cell-lipo-chargerbooster|
 +| Micro SD card| Kingston 8GB Class 10 microSD|INM-0719|9.95|http://www.inmotion.pt/store/kingston-8gb-class-10-microsd|
 +| Temperature sensor| TMP36 - Temperature Sensor| INM-0428|1.25|http://www.inmotion.pt/store/tmp36-temperature-sensor|
 +| All| ---| ---|189.90 |----|
 +
 +We also need some male to male wires and female headers for making the connections.
 +
 +**Arduino Uno**
 +
 +In addition to all the features of the previous board, the Uno uses an ATmega16U2 instead of the 8U2 found on the Uno (or the FTDI found on previous generations). This allows for faster transfer rates and more memory. No drivers needed for Linux or Mac and the ability to have the Uno show up as a keyboard, mouse, joystick, etc. [59].
 +
 +The Uno R3 also adds SDA and SCL pins next to the AREF. In addition, there are two new pins placed near the RESET pin. One is the IOREF that allow the shields to adapt to the voltage provided from the board. The other is a not connected and is reserved for future purposes. The Uno R3 works with all existing shields but can adapt to new shields, which uses these additional pins [59].
 +
 +As shown in Table 15, the official specifications are taken from the producer's webpage.
 +
 +Table 15 – Arduino specifications [60]
 +
 +|Microcontroller |ATmega328|
 +|Operating Voltage|5 V|
 +|Input Voltage (recommended)|7-12 V|
 +|Input Voltage (limits)|6-20 V|
 +|Digital I/O Pins|14 (of which 6 provide PWM output)|
 +|Analog Input Pins|6|
 +|DC Current per I/O Pin|40 mA|
 +|DC Current for 3.3V Pin|50 mA|
 +|Flash Memory|32 kB (ATmega328) of which 0.5 kB used by bootloader|
 +|SRAM|2 kB (ATmega328)|
 +|EEPROM|1 kB (ATmega328)|
 +|Clock Speed|16 MHz|
 +
 +{{:arduıno.png?400|}}
 +
 +Figure 13 - Arduino Uno [60]
 +
 +The 9DOF Sensor stick or put in another way a sensor board with 9 degrees of freedom. Includes the ADXL345 accelerometer, the HMC5883L magnetometer, and the ITG-3200 MEMS gyro has a I2C interface in the followings we show the specifications of all the sensors.
 +
 +{{:sesnsor_stick.png?400|}}
 +
 +Figure 14 – Sensorstick [61]
 +
 +
 +**Arduino Wireless SD Shield (XBee Ready)**
 +
 +The Wireless SD Shield allows an Arduino board to communicate using a wireless module. It is based on the Xbee modules from Digi, but can use any module with the same footprint. The module can communicate up to 100 feet indoors or 300 feet outdoors (with line-of-sight). It can be used as a serial/ USB replacement or you can put it into a command mode and configure it for a variety of broadcast and mesh networking options [64].
 +
 +If we would need to cover a larger distances we could use the XBee Pro model instead. These radios can get up to 1.5 km communication in line of sight. The on-board voltage regulator can supply enough current to power these radios. The shields breaks out each of the Xbee's pins to a through-hole solder pad. This shield is also compatible with other radios using the same socket [26].
 +
 +Included on the board is a SD card slot accessible through the SD Library. When using the SD Library to access the card.
 +
 +**BTBee Pro Bluetooth Module**
 +
 +The RN41XV is a small form factor, low power Bluetooth radio module offering plug-in compatibility for the widely used 2 x 10 (2 mm) socket typically used for 802.15.4 radio modules. Based on the popular 2 x 10 (2 mm) socket footprint often found in embedded applications, the Roving Networks’ RN41XV module provides Bluetooth connectivity in legacy and existing designs that have been based upon the 802.15.4 standard [65].
 +
 +The RN41XV is built upon Roving’s RN41 low power Bluetooth module. The module has an embedded Bluetooth stack and supports multiple interface protocols and profiles including the commonly used SPP and HID profiles [65].
 +
 +**Battery**
 +
 +Rechargeable lithium polymer battery that provides our device with the energy we can see the specification and the safety performances in the followings table specifications and safety performance.
 +
 +The speciation of the output of our battery is 3.7 V, so we need to change this voltage to an accurate one for our arduino board. We can make it by using two batteries in series and using the voltage regulator of the arduino board Input Voltage (recommended) 7-12 V or using a boost regulator to 5 V and connected to the arduino board without using the regulator of the board.
 +
 +The output voltage of our battery is 3.7 V but 5 V is needed to arduino board. For changing this voltage to accurate to our arduino board, there were two options. First, made it by using two batteries in series and use the voltage regulator to regulate arduino board Input Voltage (recommended) to 7-12 V. Second one, use a boost regulator to reach 5 V and connected to the arduino board without using the regulator of the board. We preferred second option because using two batteries means that the linear voltage converter are reducing the voltage to 5 V with an approximately efficiency of 65% much less than the one boost converter give us.
 +
 +**Battery Charger/Booster**
 +
 +The PowerCell board is a single cell LiPo boost converter (to 3.3 V and 5 V) and micro-USB charger in one. The features are:
 +
 +Features:
 +  * MCP73831 Single Cell LiPo charger at 500 mA
 +  * TPS61200 Boost Converter
 +  * Selectable output voltage 3.3 or 5 V
 +  * 5V @ 600 mA max
 +  * 3.3V @ 200 mA max
 +  * Undervoltage lock out at 2.6 V (with disable jumper)
 +  * Quiescent current, less than 55 uA
 +  * JST connector for LiPo battery
 +  * micro-USB connector for charge power source
 +  * Inductor: 4.7 uH, 1.2 A Sumida CDRH2D18
 +  * Over temperature protection
 +  * 
 +**Micro SD Memory Card**
 +
 +Kingston 8 GB Class 10 micro SD memory card is used for saving data.
 +
 +**Temperature Sensor**
 +
 +The TMP36 is a low voltage, precision centigrade temperature sensor. It provides a voltage output that is linearly proportional to the Celsius temperature. The features are:
 +
 +  * Voltage Input: 2.7 V to 5.5 VDC
 +  * 10 mV/°C scale factor
 +  * ±2 °C accuracy over temperature
 +  * ±0.5 °C linearity
 +  * Operating Range: −40 °C to +125 °C [67]
 +
 +**Cork Block**
 +
 +To cover the surf logger cork is used because it is a flexible, impermeable, buoyant and compressible material. As much as fire resistant, it is also a thermal insulator. Cork suits very well as a cover material for our product because it’s lightweight and waterproof. The cork industry is considered an environmental friendly industry [48], [49].
  
 ==== 6.4 Functionalities ==== ==== 6.4 Functionalities ====
 +
 +**Read and process the data from the sensor stick**
 +
 +As explained in the section of software development, reading and visualization the data collected from the sensors is based on the razor-9dof-ahrs firmware. The first thing to get working is that the software is supposed to read the data from the sensor stick that includes the ADXL345 accelerometer, the HMC5883L magnetometer and the ITG-3200 MEMS gyro. The second thing to work on is to get the data from all sensors. It uses I²C interface (as explained in signal architecture).
 +
 +In order to read I²C signals, the Software uses the wire library that allows communicating with I2C / TWI devices to the Arduino. For using the wire library it’s necessary to know the addresses of each device that are provide in the datasheets of the devices. With the wire library, the rate is adjusted to 50 Hz (25 Hz bandwidth) because the main loop runs at 50 Hz and the data from the sensors are read with a 6 byte resolution (2 each axis).
 +
 +Once the code has read the information from the sensors the readings are corrected with the Sensor calibration, scale and offset values. We want to know the exact orientation of the surfboard. This means that we need the yaw, pitch and roll angle.
 +
 +
 +{{:yaw.png?400|}}
 +
 +Figure 23 - Explanation of yaw pitch and roll in a surf board [72]
 +
 +Accelerometer and gyroscope are hard to use separately to measure the angle position. Angle position is derived from the accelerometer. It has noise, while the gyroscope is showing the drift. Though accelerometer gives noisy output, its measuring error is conservative. On the other side, gyroscope gives relatively noise immune output for short time duration, though its error will be diverged for long time period. With these characteristics, we can see that two sensors are in complementary relationship. If gyro drift can be corrected by accelerometer, the output angle can have reliability. Likewise, improved output can be calculated by the combination of two complementary sensors. The magnetometer gives as a yaw correction by measure the magnetic north.
 +
 +Internally the fusions of accelerometer, magnetometer and gyroscope data are done to use a Direction Cosine Matrix (DCM) algorithm. The algorithm also takes care of handling sensor noise and numerical errors. It is based on a paper by William Premerlan on the theory and implementation of a direction-cosine-matrix (DCM) [73].
 +
 +{{:yesil.png?500|}}
 +
 +Figure 24 - Block diagram of the DCM [73]
 +
 +Posture data (Euler angles) of the board are get from the gyro. For the roll, pitch, and yaw, three rotation matrices X, Y, and Z can be calculated:
 +
 +{{:x_formulu.png?400|}}
 +
 +Then, direction cosine matrix (DCM) is given as:
 +
 +{{:x_ikinci.png?400|}}
 +
 +With this matrix, representing of board’s posture in 3-dimensional space is possible. Each of the rotational drift correction vectors (yaw and roll-pitch) are multiplied by weights and fed to a proportional plus integral (PI) feedback controller to be added to the gyro vector to produce a corrected gyro vector. That is used as the input to equation. Proportional plus integral feedback controller are used to apply the rotation correction to the gyros, because it is stable and because the integral term completely cancels gyro offset, including thermal drift, with zero residual orientation error[73], [74].
 +
 +**Sensor Calibration**
 +
 +The firmware also implements some settings options to improve precision and responsiveness for sensor calibration. If the sensors are not calibrated, they may effect like:
 +  * Drifts in yaw when applying roll to the board.
 +  * Pointing up does not really result in an up attitude
 +To calibrate the sensor stick we have to know that the definition of the axes differs from info that is printed on the board. The firmware uses:
 +  * X axis pointing forward (towards the short edge with the connector holes)
 +  * Y axis pointing to the right
 +  * Z axis pointing down
 +
 +
 +This gives a left-handed coordinate system. We can see the three axis draws over the sensor stick in the Figure 25.
 +
 +Figure 25 - Coordinate System for sensor stick [61]
 +
 +It’s recommended to power up the Razor a few minutes before calibration, so the sensors can warm up.
 +
 +As explained in more detail in the following section the yaw pitch and roll angles are sent to the pc by using the serial interface, we will also use this in order to calibrate the sensors. Sending by the serial monitor the string #oc is set the firmware output to calibration mode like shown in the following part of code:
 +
 +
 +
 +This code receives every four acceleration values and shows on the monitor the maximum and minimum values, so we see something like accel x,y,z (min/max) = -5.00/-1.00 25.00/29.00 225.00/232.00 in our serial monitor.
 +
 +To calibrate accelerometer, sensor stick was put each direction for each axes (x, y, and z). It was let just pure gravity and got minimum and maximum values of the gravity acceleration on each axis. In the following table we have collected the values (Table 21):
 +
  
 ==== 6.5 Tests and Results ==== ==== 6.5 Tests and Results ====
 +
 +In order to prove the functionalities that were explained above, some tests were designed to know if the device was working as expected. The environment of the proves was in most of the cases a worktable EPS classroom, except for the range test and the waterproof test which took place in others environments which were subsequently described.
 +
 +The tested materials were the ones we had put in the material list was purchased by ISEP to inmotion.pt. The pc used to check the Bluetooth connection and run the processing sketch is a Toshiba PORTÉGÉ Z930-15E. The connections between the components for the test was followed the Fritzing diagram shown in the architecture part (Figure 19).
 +
 +**Bluetooth Range test**
 +
 +This test took place outside. For testing the Bluetooth range, it was started to sending data to the PC in a short distance and then gradually the device is moved away from the computer. Every five steps, some test movements were made to find out if the Bluetooth connection is still working.
 +
 +To measure the path length until the Bluetooth stops working, a string was used. Following the specs that were given by the Bluetooth standards and the manufacturer range of the antenna over open air should be approximately 100 meter.
 +
 +Because the cork box attenuates to Bluetooth signal, two different tests is performed. They are:
 +a) Without the case
 +b) With the case
 +
 +**Autonomy test by measure the current**
 +
 +To verify the calculations that performed on the battery, the maximum current draw could be measured. This current should not exceed the 108.64 𝑚𝐴. Also, an ammeter is needed to test it.
 +Assembly will follow the same pattern as the rest of the tests but the ammeter was placed between the battery and the boost converter as shown below:
 +{{:elek_graf.png?500|}}
 +
 +Figure 31 - Sketch of the mounting
 +
 +**Battery Time and Temperature Test**
 +
 +During the discharging process a constant value of the voltage is necessary. The mAh of all the batteries shown in their characteristics (in this case it is 2000 mAh).
 +
 +Autonomy is tested when the device is running. To perform the test, the device is been running steadily and sending data to the PC. The test started with full-charged battery. Start time was checked and written down. The device was started to run. When it shut down, the time was recorded again. The battery should last approximately 19 hours.
 +
 +This test run in parallel with battery time test and consisted in measuring the temperature inside of the box with an external thermometer while the device was running and sending data to the computer. The temperature was measured every 10 minutes until it reached thermal equilibrium.
 +
 +**Waterproof Test**
 +
 +To check the waterproof properties of the cork case, it was put in water without electronic parts. After 10 seconds it was taken out and checked if there is any water inside.
 +At first the presence of water was checked by visual inspection and we putted some paper inside the case.More tests were conducted with liquid contact indicators. A liquid contact indicator (LCI) is a small indicator that turns from white into another colour after contact with water They are usually use to have a lead to the cause of a defect in electronic devices and also avoid discussions about liability and warranty. LCI was also used in the next test [86].
 +
 +Figure 32- Waterproof test
 +
 +//Results from Water test//
 +There was coming water into the case because the seal was not tight enough. This was a manufacture problem, because the prototype was hand-made. In serial production, the case with the seal will be made more accurate because it will be made by machine.
 +
 +**Testing Device in the Water**
 +
 +The final tests will be conducted when the case is waterproof. Liquid contact indicators will be glued to the parts. In order to know if the water comes into the case. The test was taken place in the real environment in which our surf logger was used, the sea. It was fixed to a surf board. This will help us to test if :
 +
 +  * The range was enough to have a good surf experience and not lose the Bluetooth conection
 +  * The cork was isolating components and there was no evidence that water has entereing the device
 +  * That it was useful to improve surf skills
 +
  
 ==== 6.6 Conclusion ==== ==== 6.6 Conclusion ====
-//Provide here the conclusions of this chapter and introduce the next chapter.//+ 
 +In the following chapter we have written about how we have managed to develop our project: first we have presented our components, talking about the features and complementing the part of the state of the art in which different solutions and technologies for the components were compared. Then architecture and software development are presented so that it make understandable the signal and electrical architecture as well as the physical connections and the software solution chosen. After it the functionalities are explained based on how the code, the components and the structure make them possible. Finally at the functional tests some experiments are described in order to try out the functionalities.
  
 ===== 7. Project Management ===== ===== 7. Project Management =====
Line 900: Line 1177:
 ===== 8. Conclussion ===== ===== 8. Conclussion =====
 ==== 8.1 Discussion ==== ==== 8.1 Discussion ====
- 
-In the following chapter we have written about how we have managed to develop our project: first we have presented our components, talking about the features and complementing the part of the state of the art in which different solutions and technologies for the components were compared. Then architecture and software development are presented so that it make understandable the signal and electrical architecture as well as the physical connections and the software solution chosen. After it the functionalities are explained based on how the code, the components and the structure make them possible. Finally at the functional tests some experiments are described in order to try out the functionalities. 
      
 When trying to create the surf logger, we had some problems. The main one is reading and visualizing the data. We chose the option to take advantage of the AHRS firmware because our lack in knowledge about programming and the absence of time to build a program from scratch. Were also other problems like the difficulty of save the angle’s information on the SD card that would not be possible to solve without the help of the Arduino libraries. So we can conclude we would not have been able to conduct this project without the help of free software and the Arduino community.  When trying to create the surf logger, we had some problems. The main one is reading and visualizing the data. We chose the option to take advantage of the AHRS firmware because our lack in knowledge about programming and the absence of time to build a program from scratch. Were also other problems like the difficulty of save the angle’s information on the SD card that would not be possible to solve without the help of the Arduino libraries. So we can conclude we would not have been able to conduct this project without the help of free software and the Arduino community. 
QR Code
QR Code report (generated for current page)