Background
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.
Requirements
1. 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 fulfilled
1. 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 place
The 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.
Technical Implementation: Motion Vectors and Low-Power Telemetry
The project reveals the hidden layers of simple sensing-to-cloud interaction:
- Identification layer: The tilt sensors act as the primary spatial trigger, detecting the horse's posture change to coordinate the alert events.
- Conversion layer: The system uses digital input pins to receive sensor state changes to coordinate mission-critical sensing tasks.
- Cloud Interface layer: The Sigfox Backend acts as the data dashboard for monitoring device status (e.g., message count, signal strength).
- Processing Logic: The Arduino code follows a "threshold-dispatch" strategy: it interprets the sensor states over time and matches them to alert states to provide safe and rhythmic livestock monitoring.
- Communication Dialogue Loop: Status bits are sent rhythmically to the Serial Monitor during initial calibration to coordinate system status.
Hardware-Equine Infrastructure
- Arduino MKR Fox 1200: The "brain" of the project, managing the multi-sensor sampling and coordinating the Sigfox cloud sync.
- Tilt Sensors: Providing a clear and reliable "trigger link" for detecting the equine's lying-down movement.
- Sigfox Module (Integrated): Providing a high-capacity and reliable physical interface for long-range "Alert Missions."
- AAA Batteries: Essential for providing clear and energy-efficient power for extended mobile monitoring, chosen for safety over Li-Po.
- Weatherproof Enclosure: Provides a clear and professional physical interface for field missions and protects the internal components in the stable environment.
- Micro-USB Cable: Used to program the Arduino and provides the primary interface for the system controller.
The Board and wiring


Monitor Automation and Interaction Step-by-Step
The foaling alert process is designed to be very efficient:
- Initialize Workspace: Correctly set your tilt sensors inside your collar harness and connect them properly to the Arduino pins as shown in the wiring diagram above.
- Setup High-Speed Sync: In the Sigfox dashboard, initialize the device and define the callback properties to coordinate the alert messaging.
- Internal Dialogue Loop: The device constantly performs temporal checks on the sensor states and updates its status in real-time based on the defined activity logic.
- Visual and Data Feedback Integration: Watch your phone for SMS alerts, which act as a rhythmic status signal, following the mare's activity in the stable.
Twilio
You need to create a twilio account
https://www.twilio.com/try-twilio
Enter the phone number that will receive the alerts.

Sigfoxbackend
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
Future Expansion
- OLED Identity Dashboard Integration: Add a small OLED display on the side to show "Battery %" or local status messages.
- Multi-sensor Climate Sync Synchronization: Connect a specialized heart rate monitor to perform higher-precision health tracking wirelessly via the cloud.
- Cloud Interface Registration Support Synchronization: Add a specialized web dashboard accessible via smartphone to precisely track and log total foaling history.
- Advanced Velocity Profile Customization Support: Incorporate machine learning logic to allow triggers to be adjusted automatically based on the individual mare's behavior patterns.
[!IMPORTANT] To ensure accurate detection, always perform a static calibration of the system's timing thresholds in the code; always ensure you have an appropriate Fail-Safe flag in the loop if the battery is low!
HELP
Tanks to Jennifer, Fantasia, Zoe, Delphine and Elena for their help.