Showing posts with label sensor. Show all posts
Showing posts with label sensor. Show all posts

Saturday, 3 December 2016

Multivariable sensor data to early detect lameness in sheep


Al-Rubaye, Z., Al-Sherbaz, A., McCormick, W. D., Turner, S. J. and Ghendir, S (2016) The use of multivariable sensor data to early detect lameness in sheep. Paper presented to: Sensors in Food and Agriculture, Møller Centre, Churchill College, University of Cambridge, 29-30 November 2016.

Abstract
Lameness is a clinical symptom referring to locomotion changes that widely differ from normal gait or posture. Lameness has a negative impact on both farm productivity and sheep welfare. The annual loss to the British sheep industry, because of the footrot only ;which is one of the common lameness causes, is estimated by £10 for each ewe. 

Since lameness is often an infectious disease that can be easily spread¬ within the flock, the prior detection of the lame sheep will be expected to decrease the prevalence of lameness and enabling the shepherd to react quickly to the better treatment. 

The prototype sensor has been developed primarily to conduct this research, offering an automatic monitoring of individual sheep to collect behavioural data measurements from a precise sensor that mounted within a neck collar. The sensor variables include 3-axis acceleration, 3-axis Gyroscope, (Roll, Pitch, Heading) angles, longitude, latitude and time. 

The sensor parameters were be used as inputs to data analysis algorithms. The preliminary results from applying pre-existing classification algorithms gave a positive indication for earlier lameness detection, however; the next experiments aim to simplify the process of lameness detection by eliminating the least effective parameters


All views and opinions are the author's and do not necessarily reflected those of any organisation they are associated with. Twitter: @scottturneruon

Tuesday, 27 September 2016

Mini Project: robot talks to UFO

CBiS Education generously sent me two of their new range of robotics development kits - Consumable Robotics (consumable-robotics.com) to try out. These are a range of cardboard based robotics kits (so far a robot named Dimm, and a UFO) with electronic components for example LEDs; sensors and buzzers,  depending on the kits. 

What makes the kits interesting though, is they are designed to be controlled by either a BBC Micro:bit or a CodeBug. In previous posts elsewhere (UFO has Landed and DIMM the OOD)  I started playing with the CBiSEducation's UFO and Dimm consumable robots separately. Still using the Micro:Bit, in this post, using Micropython to send messages between the two kits is considered.






Stage 1 Wiring and Set up-UFO
Pins 0 and 1, on the Micro:bit, are outputs to the LEDs
The black leads on the UFO go to GND.

Micropython and the use of  the Micro:Bit's built in radio module (Bluetooth) provides a route for communication between the two kits.



Stage 2 Code - UFO
The code is set to switch on and off the UFO's LEDs, followed by scrolling a message "DIMM Calling" when it receives a message "dimm" via Bluetooth. 

Basic overview is
- Turn on the radio module - radio.on()
- If the message is received then turn the LEDs on and off and send "DIMM calling"
- send a message via bluetooth "ufo" to whoever is listening (in the end the robot DIMM hopefully). The code is shown below. 

import radio
from microbit import pin0, pin1, display, sleep

def pulseLed1(duration):
   pin1.write_digital(0)
   pin0.write_digital(1)
   sleep(duration)
   
def pulseLed2(duration):
   pin1.write_digital(1)
   pin0.write_digital(0)
   sleep(duration)
   
def stopIt():
   pin0.write_digital(0)
   pin1.write_digital(0)

radio.on()

while True:
   incoming = radio.receive()
   stopIt()
   if incoming == 'dimm':   
      pulseLed1(1000)
      pulseLed2(1000)
      stopIt()
      radio.send("ufo")
      display.scroll("DIMM calling")

To use the radio module you will need to switch to the mu editor (http://codewith.mu/).




Stage 3 Testing it
To test it, a second Micro:bit was used to send test signals. The code for this is shown below. When button A is pressed on the second Micro:Bit a message 'dimm' is sent followed by sending 'not'.

import radio
from microbit import button_a, button_b, sleep

radio.on()

while True:
   if button_a.is_pressed():
       radio.send('dimm')
       radio.send('not')
       
   if button_b.is_pressed():
       radio.send('ufo')
       radio.send('not')

Testing does show the UFO does cycle through the sequence of LEDs flashes and the message scrolls. The slight bug is in repeats it several times before it stops; possibly a buffering issue somewhere.

 


Stage 5 Build

Now the focus moves to Dimm and the setting up the actions leading to the messages being passed.

Set-up is relatively easy. Using the Micro:bits port 0 (as part of the Dimm robot) for the input from the light sensor, which is included in the kit (Red lead going to 3v and the black lead going to GND), we now have light detecting ability . Just to note the less light there is the higher the value on the sensor.




Stage 6 Code
Micropython programmed through the Mu editor (see below)

If light levels are high then :
      scroll a message saying "calling UFO" 
      send the code "dimm" via bluetooth.
otherwise: 
      scroll a message saying "I can't see"
If it recieves "ufo" via bluetooth :
      display "Hello, UFO called me"

Micropython code
import radio
from microbit import pin0, pin1, display, sleep

radio.on()

while True:
   incoming = radio.receive()
   if incoming == 'ufo':  
      display.scroll("Hello, UFO called me", 75)
   if pin0.read_analog()<175: font="">
        display.scroll("calling UFO")
        radio.send("dimm")
   else:
        display.scroll("I can't see")

Stage 7 Testing

Video below shows it in action.

  • When the light (in this case a torch) shines on the sensor connected to Dimm; a message is sent and picked up by the UFO kit (LEDs flash and the message saying "DIMM calling" scrolls  across the UFO LED array). A message is sent from the UFO kit and on Dimm's LED array scrolls the message "Hello, UFO called me").
  • If the light levels are too low, then the message "I can't see" scrolls across Dimm's LED array.









All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

If you'd like to find out more about Computing at the University of Northampton goto: www.computing.northampton.ac.uk. All views and opinions are the author's and do not necessarily reflected those of any organisation they are associated with

Thursday, 19 May 2016

Zainab's prize winning poster


Lameness Detection in Sheep Through Behavourial Sensor Data Analysis
Zainab Al-Rubaye


Abstract
Lameness is a clinical symptom of the painful disorder, which refers to the locomotion changes in sheep movement. These unbalanced movements result in a deviation from normal gait or posture. The footrot is considered one of the most significant causes of lameness in sheep in Great Britain due to a bacteria grows in a mud soil which transfer to the sheep foot and cause footrot that leads to lameness. Lameness has a negative impact on both sheep welfare and farm economy. The annual loss from the footrot only is estimated by £6 for each ewe in Great Britain according to the statistics from Agriculture and Horticulture Development Board (AHDB) in 2014. Therefore, preclinical detection of lameness at the farm will increase the level of protection regarding sheep health and farm commerce decline. The newly developed sensor technology utilises the idea of automatically monitoring objects either human or animal to determine the physiological and behavioural indicators, which are subsequently used an input to data analysis algorithms. The automated methods to monitor the farm bring many advantages to the farmer in terms of time spending, flock size increasing and sensitivity to detect the lamenessThe type of the collected data from the sensor used for recording animal’s behaviour depend on the sensor’s features and functionality. The sensor that will be used to conduct this research is immensely accurate and sensitive. It provides 3-aix acceleration, 3-aix angular velocity, 3-aix angles (Roll, Pitch, and Heading), longitude, latitude and time of reading which can be set up according to the demanded accuracy. This study will develop an automated model to early detect lameness in sheep by analysing the data that will be retrieved from a mounted sensor on the sheep neck collar. This extensive spatio-temporal data will be classified to infer the associated behaviour to the lame sheep according to an efficient data mining learning techniques. This model will help the shepherd to early detect the lame sheep to prevent the worse situation of trimming or even culling the sheep.

For more details go to http://nectar.northampton.ac.uk/8311/


Supervisory team:
Dr Ali Al-Sherbaz
Dr Wanda McCormick
Dr Scott Turner


If you'd like to find out more about Computing at the University of Northampton go to: www.computing.northampton.ac.uk. All views and opinions are the author's and do not necessarily reflected those of any organisation they are associated with