User Tools

Site Tools


amc:ss2024:schafalarm:start

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
amc:ss2024:schafalarm:start [2024/07/30 22:06] – [1. Introduction] tasio.rodriguez-puyamc:ss2024:schafalarm:start [2024/07/30 22:26] (current) – [5. Conclusion] tasio.rodriguez-puy
Line 68: Line 68:
 **Hardware setup** **Hardware setup**
 <imgcaption image1|Xiao BLE Sense connected to a LIB>{{ :amc:ss2024:schafalarm:p1_hard.jpg?300 |}}</imgcaption> <imgcaption image1|Xiao BLE Sense connected to a LIB>{{ :amc:ss2024:schafalarm:p1_hard.jpg?300 |}}</imgcaption>
-For this prototype since the microcontroller has the IMU onboard and BLE, only a supplementary LIB was used to power the module.\\+For this prototypesince the microcontroller has the IMU onboard and BLE, only a supplementary LIB was used to power the module.\\
 **Software setup**\\ **Software setup**\\
 \\ \\
Line 136: Line 136:
 </code> </code>
  
-3º Setup function, here the serial communication is initialized and also the IMU. Regarding the BLE, the device settings are customized and it begins advertising to find other devices nearby.+3º Setup function, here the serial communication is initialized as well as the IMU. Regarding the BLE, the device settings are customized and it begins advertising to find other devices nearby.
  
 <code C++> <code C++>
Line 175: Line 175:
 </code> </code>
  
-4º Loop Function, the BLE listens for connections from central devices (this is configured as a periphreal). When a connexion is established, the IMU sensor readings for the accelerometer and gyroscope are periodically read, converted to strings, combined into a single message and then sent to the central device. This loop continues to read and __send data every 0.1 seconds (10Hz)__ for as long as the central device is connected to it. When it gets disconnected, it starts again to listen for new connections. Lastly all the action like connexionsdisconnexionsthe data strings sent and everything gets printed on the serial monitor, just for test and debugging purposes.+4º Loop Function, the BLE listens for connections from central devices (this is configured as a periphreal). When a connexion is established, the IMU sensor readings for the accelerometer and gyroscope are periodically read, converted to strings, combined into a single message and then sent to the central device. This loop continues to read and __send data every 0.1 seconds (10Hz)__ for as long as the central device is connected to it. When it gets disconnected, it starts again to listen for new connections. Lastlyall the action like connexions and disconnexions the data strings sent and everything gets printed on the serial monitor, just for test and debugging purposes.
  
 <code C++> <code C++>
Line 387: Line 387:
 </code> </code>
  
-5º The setup function initializes the serial communication, prints the wake up reaon and sets up the MPU6050 and RF69 module (by configuring its frequency, transmission power and encryption key). The wake up reason is also used to set the current state of the device (of the state machine) and the esp32 is confihured to wake up on a timer or on MPU6050 motion detection.+5º The setup function initializes the serial communication, prints the wake up resaon and sets up the MPU6050 and RF69 module (by configuring its frequency, transmission power and encryption key). The wake up reason is also used to set the current state of the device (of the state machine) and the esp32 is confihured to wake up on a timer or on MPU6050 motion detection.
 <code C++> <code C++>
 void setup() { void setup() {
Line 451: Line 451:
 6º The loop function makes the state machine handle different states:\\ 6º The loop function makes the state machine handle different states:\\
 MOVE STATE:\\ MOVE STATE:\\
-Occurs when the system wakes up due to a motion interrupt from the MPU6050 sensor. In the void loop, read the IMU data, transfer to a radio packet and send at 10Hz. Check if motion is still detected using  +Occurs when the system wakes up due to a motion interrupt from the MPU6050 sensor. In the void loop, the IMU data is readtransfered to a radio packet and sent at 10Hz. It is checked if motion is still detecting using  
-<html><span style="color:red;font-size:100%;">mpu.getMotionInterruptStatus()</span></html>. This function returns "motion_interrupt" if the interrupt is activated, meaning that motion is detected and <html><span style="color:red;font-size:100%;">lastMotionTime</span></html> will update to the current time. The system remains in the MOVE state as long as new motion is detected within 3 seconds. Otherwise, transit to the STOP state. +<html><span style="color:red;font-size:100%;">mpu.getMotionInterruptStatus()</span></html>. This function returns "motion_interrupt" if the interrupt is activated, meaning that motion is detected and <html><span style="color:red;font-size:100%;">lastMotionTime</span></html> will update to the current time. The system remains in the MOVE state as long as new motion is detected within 3 seconds. Otherwise, it transit to the STOP state. 
  
 TIMER STATE:\\ TIMER STATE:\\
-Occurs when the system wakes up due to a built-in timer interrupt. The predefined amount of time to sleep and wake up are 30 seconds and 5 seconds respectively. In this state, call out the function <html><span style="color:red;font-size:100%;">readAndTransmitIMUData</span></html>. IMU sensor reading, radio packet sending will run in a defined duration (in this case 5s). After that transit to STOP state. +It occurs when the system wakes up due to a built-in timer interrupt. The predefined amount of time to sleep and wake up are 30 seconds and 5 seconds respectively. In this state, call out the function <html><span style="color:red;font-size:100%;">readAndTransmitIMUData</span></html>. IMU sensor reading, radio packet sending will run in a defined duration (in this case 5s). After that transit to STOP state. 
  
 STOP STATE: \\ STOP STATE: \\
Line 516: Line 516:
 </code> </code>
 ======3. Results ====== ======3. Results ======
-This section presents the findings from testing two prototypes for monitoring sheep movement. Each prototype was tested for range in outdoors and indoors conditions.\\+This section presents the findings from testing two prototypes for monitoring sheep movement. Each prototype's range was tested in outdoors and indoors conditions.\\
  
  
Line 530: Line 530:
 In this prototype the microcontroller was flashed with the __code__ and connected to a 1000mAh lithium-ion battery and inserted on a casing attached to a collar. Some measurements and tests were taken with some alpacas that were available.\\ In this prototype the microcontroller was flashed with the __code__ and connected to a 1000mAh lithium-ion battery and inserted on a casing attached to a collar. Some measurements and tests were taken with some alpacas that were available.\\
  
-The module receiving the data sent by the prototype was another Xiao BLE Sense flashed with some __receiver code__, since it was not possible to receive it on the desktop application of Nordic Semiconductors (However, on the mobile app enabling and data download was possible, allowing to read the accelerometer values from the alpacas with a smartphone).\\+The module receiving the data sent by the prototype was another Xiao BLE Sense flashed with some __receiver code__, since it was not possible to receive it on the desktop application of Nordic Semiconductors (however, on the mobile app enabling and data download was possible, allowing to read the accelerometer values from the alpacas with a smartphone).\\
  
 **RANGE TESTS**\\ **RANGE TESTS**\\
Line 546: Line 546:
 The maximum range acheived both __indoors__ and __outdoors__ in normal conditions was of 42m, +-2m, on the onther side, when tested with the nRF app on the smartphone values of 60m, +-2m, both indoors and outdoors were obtained as well.\\ The maximum range acheived both __indoors__ and __outdoors__ in normal conditions was of 42m, +-2m, on the onther side, when tested with the nRF app on the smartphone values of 60m, +-2m, both indoors and outdoors were obtained as well.\\
  
-However, it is important to highlight that this values were obtained without any obstacle in between and at average height of 1.4m from the ground. **OUTOORS** it was observed that if you the board was placed in the ground or close to it, the conexion would be lost, and recoverd as soon as you raised it. Also in the test spot there was a tiny 2m hill and the modules would loose their BLE conexion if they were placed in between the hill. **INDOORS** The range was tested also in a straight line and in a concrete corridor. When testing the nrf to module range modules would disconnect after taking a turn in a corner at 40m from the transmitter even though it has a maximum range in a straight line of 60m.+However, it is important to highlight that this values were obtained without any obstacle in between and at average height of 1.4m from the ground. **OUTOORS**it was observed that if the board was placed in the ground or close to it, the conexion would be lost, and recovered as soon as it was lifted. Also in the test spot there was a tiny 2m hill and the modules would loose their BLE conexion if they were placed in between the hill. **INDOORS**The range was tested also in a straight line and in a concrete corridor. When testing the nrf to module range modules would disconnect after taking a turn in a corner at 40m from the transmitter even though it has a maximum range in a straight line of 60m.
  
  
-The [[https://github.com/adafruit/Adafruit_BluefruitLE_nRF51|Bluefruit library]] increases the BLE range by adjusting the transmit power and modifying the connection parameters to maximize the signal strength and stability over longer distances, in this case between two Xiao BLE Sense modules. However, each of these adjustments has trade-offs in terms of power consumption and latency.+The [[https://github.com/adafruit/Adafruit_BluefruitLE_nRF51|Bluefruit library]] increases the BLE range by adjusting the transmit power and modifying the connection parameters to maximize the signal strength and stability over longer distances, in this casebetween two Xiao BLE Sense modules. However, each of these adjustments has trade-offs in terms of power consumption and latency.
  
  
Line 584: Line 584:
  
  
-All current consumption were measured on a time interval of 10s, it can be observed that with the esp32 on deep sleep and when no motion is being detected the power consumption is severely reduced. This would help to reduce the power consumption therefore extending the life of the battery.\\+All current consumptions were measured on a time interval of 10s, it can be observed that with the esp32 on deep sleep and when no motion is being detected the power consumption is severely reduced. This would help to reduce the power consumption therefore extending the life of the battery.\\
  
 **with deep sleep**\\ **with deep sleep**\\
Line 597: Line 597:
  
 ======4. Discussion ====== ======4. Discussion ======
-The initial use of the Xiao BLE Sense showed that while it was capable of detecting motion and transmitting data via BLE, the range limitations and lack of roaming capability made it unsuitable for our needs. The range limitations might be able to be overcomed with the [[https://github.com/adafruit/Adafruit_BluefruitLE_nRF51|Bluefruit library]], but it was not possible to properly configure it and test it, so it remains unknown to which extent would have the range increased.\\+The initial use of the Xiao BLE Sense showed thatwhile it was capable of detecting motion and transmitting data via BLE, the range limitations and lack of roaming capability made it unsuitable for our needs. The range limitations may be overcome with the [[https://github.com/adafruit/Adafruit_BluefruitLE_nRF51|Bluefruit library]], but it was not possible to properly configure it and test it, so it remains unknown to which extent the range would have increased.\\
  
 The switch to the ESP32-S3 microcontroller with the RFM69HCW radio module and the GY-521 accelerometer overcame these issues. The RF69 module provided a much larger range, and the ESP32-S3's deep sleep mode helped in reducing power consumption, making the system more viable for real-world use.\\ The switch to the ESP32-S3 microcontroller with the RFM69HCW radio module and the GY-521 accelerometer overcame these issues. The RF69 module provided a much larger range, and the ESP32-S3's deep sleep mode helped in reducing power consumption, making the system more viable for real-world use.\\
Line 607: Line 607:
 Power consumption is also a critical factor for this project. Since the sensors and communication modules will be attached to sheep, they need to operate efficiently on battery power. One of the solutions to further reduce the power consumption would be cutting of the power supply to the RF69 module when the esp32 in on deep sleep so more power can be saved. Power consumption is also a critical factor for this project. Since the sensors and communication modules will be attached to sheep, they need to operate efficiently on battery power. One of the solutions to further reduce the power consumption would be cutting of the power supply to the RF69 module when the esp32 in on deep sleep so more power can be saved.
 ======5. Conclusion ====== ======5. Conclusion ======
-In conclusion, while the project has made significant progress in developing a system to detect sheep movement and potential wolf attacks, several critical steps remain. Field testing is necessary to check the system's performance in real-world conditions. Incorporating Ultra-Wideband technology would allow to track sheep positions accurately. Additionally, the challenge of continuously receiving accelerometer signals from multiple sheep needs to be addressed to ensure the system's scalability. Finally, optimizing power consumption is crutial for the practical application of the system, ensuring that it can operate efficiently over extended periods. These next steps are crucial for moving the project from prototype to a fully functional solution.+In conclusion, while the project has made significant progress in developing a system to detect sheep movement and potential wolf attacks, several critical steps remain unsolved. Field testing is necessary to check the system's performance in real-world conditions. Incorporating Ultra-Wideband technology would allow to track sheep positions accurately. Additionally, the challenge of continuously receiving accelerometer signals from multiple sheep needs to be addressed to ensure the system's scalability. Finally, optimizing power consumption is crutial for the practical application of the system, ensuring that it can operate efficiently over extended periods. These next steps are crucial for moving the project from prototype to a fully functional solution.
  
  
amc/ss2024/schafalarm/start.1722369970.txt.gz · Last modified: 2024/07/30 22:06 by tasio.rodriguez-puy