A breeder, friend of mine, asked me for help to find a technique to warn her in case one of her mare is giving birth. We could not find on the market any suitable device that would allow her continuing her other activities and alert her at any time, especially when she is not at the farm.
Requirements1. The device shall be able to send alert on a mobile phone, per SMS, per email…
2. The device shall be able to have access to a network at any time
3. The device shall be dust and moisture-proof
4. The device shall be shock-resistant
5. The device shall be able to monitor the pregnancy for at least 3 weeks
How the requirements are fulfilled1. The device shall be able to send alert on a mobile phone, per SMS, per email…
To give birth, a mare is lying on the flank. The strategy used is to detect this change of angle to trigger the alert.
The required range detection is from 45 to 90 °. It was decided to use two ball tilt sensors which also allows reducing the consumption.
This is not the calving season, so a reconstitution took placeThe first alert is sent if the mare stays at least 30 seconds on the flank, two more alerts are sent one and two minutes later to ensure the breeder saw the messages. The duration of 30 seconds was defined to avoid false alert due to other movements of the horse.
The arduino MKRFox 1200 sends the message "HORSE" to the Sigfox backend.
I created a Callback to the Twilio platform that sends an SMS to the breeder.
Fanfan not being too cooperative for a minute, here's how it works.
2. The device shall be able to have access to a network at anytime
In the frame of this project, the stable is 6km away from the closest GSM relay. The network is therefore very bad for using an arduino and a GSM card in a portable configuration. To overcome this issue, it was decided to check the coverage of Sigfox. The picture below shows that the Sigfox coverage using 3 stations is good.
3. The device shall be dust and moisture-proof
The mare may be outside, therefore the material for the housing of the device is selected to resist outdoor environment.
4. The device shall be shock-resistant
The housing material has been selected to have strong resistance. However, a horse is a very powerful animal and we cannot ensure that the housing will resist all treatments. To avoid risk related to the battery ignition in case of shock it was decided to ban the use of Li-ion or LiPo battery.
The use of mercury ball sensor was proscribed to not endanger the horse in case the device is damaged
5. The device shall be able to monitor the pregnancy for at least 3 weeks
The breeder knows approximatly the date of birth and it is important to monitor the last 3 weeks of pregnancy. The arduino MKR Fox 1200 consuming 650μAh in standby mode, 2 AAA 1250mAh batteries will allow a battery life of 80 days.
The Board and wiringYou need to create a twilio account
https://www.twilio.com/try-twilio
Enter the phone number that will receive the alerts.
Create your Sigfox account and associate your Arduino MKRFox1200
Select the device type
Select CALLBACKS, New, Custom callback
Enter informations :
Type : DATA, UPLINK
Channel : URL
Url pattern : https://AccountSID:AuthToken@api.twilio.com/2010-04-01/Accounts/AccountSID/Messages.json
AcountSID and AuthToken is in your Twilio account
HELPTanks to Jennifer, Fantasia, Zoe, Delphine and Elena for their help.
Comments