Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| report [2015/06/22 15:31] – [7.1 Introduction] team4 | report [2015/06/23 12:06] (current) – [7.2 Architecture] team4 | ||
|---|---|---|---|
| Line 1480: | Line 1480: | ||
| __Arduino Sketch__ | __Arduino Sketch__ | ||
| - | The Arduino runs a continuous sketch | + | The Arduino runs a continuous sketch |
| - | Used libraries: | + | **Used libraries:** |
| * One Wire – allows using waterproof temperature sensor DS18B20, is applied to detect the sensor and create monitoring instance. | * One Wire – allows using waterproof temperature sensor DS18B20, is applied to detect the sensor and create monitoring instance. | ||
| Line 1487: | Line 1487: | ||
| * Stepper – allows the control of stepper motor movement e.g. number and speed of rotations. | * Stepper – allows the control of stepper motor movement e.g. number and speed of rotations. | ||
| * IRremote – library operating infrared shooting sensor and allowing to create modulated infrared signal emitted from the connected diode. | * IRremote – library operating infrared shooting sensor and allowing to create modulated infrared signal emitted from the connected diode. | ||
| + | |||
| + | The code structure is presented below. | ||
| + | |||
| + | < | ||
| + | <figure flabel87> | ||
| + | {{: | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| The initial setup for Arduino consists of defining the pin status and first temperature request in order to turn the heater on automatically if the water is too cold. | The initial setup for Arduino consists of defining the pin status and first temperature request in order to turn the heater on automatically if the water is too cold. | ||
| - | Further code flow is controlled by Raspberry Pi //i.e.// that the microcontroller only responds to the requests sent through the serial port. Firstly there is a ready check performed, then the several values are obtained from sensors, afterwards, the user input from website is applied //i.e.// the settings for feeder, pump, lamp and heater are uploaded and performed. The code runs in continuous loop. | + | Further code flow is controlled by Raspberry Pi //i.e.// that the microcontroller only responds to the requests sent through the serial port. Firstly there is a ready check performed, then the several values are obtained from sensors, |
| ==== 7.3 Components ==== | ==== 7.3 Components ==== | ||
| Line 2056: | Line 2065: | ||
| < | < | ||
| </ | </ | ||
| + | |||
| + | === 7.4.4 Components === | ||
| + | |||
| + | The original automatic feeder didn’t fulfil the demanded requirements for the client. The purchased device at its original stage could not be connected and controlled via internet. For this purpose we redesigned the feeder. A stepper motor was bought for the modified version in order to control the food dispensation. \\ | ||
| + | A plate was required so that the stepper could properly be installed in a fixed position. This is illustrated in the 3D drawing of Figure {{ref> | ||
| + | |||
| + | <figure flabel8881> | ||
| + | {{: | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | The final design with the integrated circuit providing the stepper motor is displayed in Figure {{ref> | ||
| + | |||
| + | <figure flabel8882> | ||
| + | {{: | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | A waterproof case was designed and built for the camera, so it would be possible to stream the fish’s activities under water. Perspex was used as the major component to construct this case as it is illustrated in Figure {{ref> | ||
| + | |||
| + | <figure flabel8883> | ||
| + | {{: | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | For the ultrasonic sensor, which measures the water level, it was necessary to create a case that could avoid water splash on the sensor’s circuit. For this purpose it was chosen to use perspex again. This model is displayed in Figure {{ref> | ||
| + | |||
| + | <figure flabel8884> | ||
| + | {{: | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | Initially it was planned to mount the heater vertically, for which a simple support was designed and built as it is shown in Figure {{ref> | ||
| + | |||
| + | <figure flabel8885> | ||
| + | {{: | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | |||
| ==== 7.5 Functionalities ==== | ==== 7.5 Functionalities ==== | ||
| Line 2068: | Line 2117: | ||
| ==== 7.6 Tests and Results ==== | ==== 7.6 Tests and Results ==== | ||
| - | In order to visualize the functionalities test and results Table {{ref> | + | In order to visualize the functionalities test and results Table {{ref> |
| + | For the tests and results concerning the feeder, light and heater it was necessary to hook up the devices with the Arduino in order to test the code. For the next step the challenge was to control the devices through the serial port from Raspberry Pi to Arduino. The final step was to control all three components from our website via Wi-Fi.\\ | ||
| <table tlabel654> | <table tlabel654> | ||
| Line 2101: | Line 2151: | ||
| The main success was staying under the budget threshold while keeping the product fully functional and sustainable. We managed to find cheap solutions offering the same as products even four times as expensive.\\ | The main success was staying under the budget threshold while keeping the product fully functional and sustainable. We managed to find cheap solutions offering the same as products even four times as expensive.\\ | ||
| The biggest problems during development were the heating of the board which we solved by mounting the box in a specific position, the current consumption which was solved by Arduino coding turning the sensors and stepper motor on only when requested by Raspberry Pi.\\ | The biggest problems during development were the heating of the board which we solved by mounting the box in a specific position, the current consumption which was solved by Arduino coding turning the sensors and stepper motor on only when requested by Raspberry Pi.\\ | ||
| - | The other issue was to integrate Arduino code with Raspberry Pi controls and the web application. That problem took a lot of trials to solve but the ultimate solution was to make Raspberry Pi the master device responsible for writing to database and controlling the slave – Arduino. | + | The other issue was to integrate Arduino code with Raspberry Pi controls and the web application. That problem took a lot of trials to solve but the ultimate solution was to make Raspberry Pi the master device responsible for writing to database and controlling the slave – Arduino.\\ |
| + | The final prototype was mounted in a used PC power supply box. There were multiple modifications to be undergone in order to make all components fit in the right way. The installed final system is displayed in Figure {{ref> | ||
| + | Inside the box are the following components: | ||
| + | * Raspberry Pi | ||
| + | * Converter from 12 V to 5 V | ||
| + | * Arduino Uno | ||
| + | * 4-channel Relay | ||
| + | * Power supply | ||
| + | * Principle switch button | ||
| + | * Power light converter from 240 V to 25 V | ||
| + | |||
| + | <figure flabel8886> | ||
| + | {{: | ||
| + | < | ||
| + | </ | ||
| ===== 8. Conclusions ===== | ===== 8. Conclusions ===== | ||
| ==== 8.1 Discussion ==== | ==== 8.1 Discussion ==== | ||