10/15/2017 at 20:46 •
I played with the MAX30105 breakout from Sparkfun to see what it will take to measure heart rate optically. The sensor has a red, green and IR LED and based on the amount of light reflected back to the sensor it should be possible to do, among others, optical heart rate sensing. Although the MAX30105 is technically a particle sensor, as far as I can tell from the data sheets it is identical to the MAX30101. The MAX31010 is specifically a heart rate sensor according to Maximum Integrated, but the only difference in the datasheet is the name and descriptions of some of the registers.
The Sparkfun Arduino library for the MAX30105 makes it quite easy to start up the sensor and start testing. An example sketch is included to measure heart rate, so that’s what I used. I’m not here to reinvent the wheel, right? The sketch makes use of the amount of reflected IR light to determine when a heartbeat occurred. Below is a graph showing the values for reflected IR measured while holding my finger on the sensor.
The graph clearly shows a repeating pattern in the measured reflected IR values. A bit of signal processing later and the sketch spits out a heart rate. This all looks great, but this project will not be used under laboratory conditions. These results were measured with me sitting still and keeping constant pressure on the sensor. Even in these ideal conditions, notice on the second half of the graph that the whole signal gets shifted up and down a bit. This is due to slight pressure differences of my finger on the sensor, making slightly more/less IR get reflected. Some signal processing could probably easily take care of slight differences in pressure on the sensor by detrending the signal or using a similar process.
The sensor would need to be fixed/held to the animal’s skin to enable measurement. If the device is worn as an ear tag, the sensor could be placed on the skin inside the ear. This would probably be the easiest place to access skin with little hair that could make measurement difficult. If the complete device is worn around the neck, wire will have to be run from the collar to wherever the heart rate sensor is placed. This does not seem practical or durable for livestock. The skin on the inside of the ear will also be thin, with the blood vessels close to the skin, which should also improve the result. I'm guessing thin skin will yield more accurate results than thick skin.
Some last thoughts relating to the use of optical heart rate measurement in practical applications: given conditions where the sensor can measure good quality data, optical heart rate sensing seems quite viable. The difficulty will lie in placing the sensor in such a location and fixing it in place reliably so that good data can be captured. This will have to be solved through trial and error and attaching the tag to an animal.
10/15/2017 at 20:27 •
Long Range Connectivity
For roaming animals long range communication is a must. Two different radios have been considered:
- Texas Instrument CC1310/1350 SOC
- RFM95W LoRa module
The TI CC1350 which was previously discussed is still a good candidate, but I have found that it does not have quite the community around it to help relative beginners like myself. I shelved it for now.
I have decided to go with the RFM95W LoRa module for long range communications. This is the module on the Feather Dev boards that I previously mentioned. The main reason for this is the “openness” of some of the LoRa based IoT frameworks, specifically The Things Network. There is are plenty of tutorials online and quite a hacker community around LoRa. I believe that LoRa based networks can be extremely valuable to farmers due to the massive range of possible applications in agriculture. It allows neighboring farmers to share the same network for different applications. I want to avoid going with a connectivity solution that is “unique”, since that would negatively affect adoption and interoperability.
I have shifted my development work to the Espressif ESP32, mainly because it has BLE capability and is compatible with both the Arduino IDE and Micropython.
I have found Micropython to be an absolute pleasure to work with. The built in REPL is extremely handy for testing ideas, code and sensors. Unfortunately there are stills some capabilities missing from the current version. So work is happening mostly with the Arduino IDE, which has the obvious convenience of libraries for some of the sensors I am using.
I wanted to get to know the ESP32 better anyway since it is perfect for some other projects I have planned due to it’s large array of features.
The project might move to another MCU later on, probably one of the many ARM based MCUs.
10/15/2017 at 20:21 •
I believe that BLE (Bluetooth Low Energy/Bluetooth 4.2) can be very handy for animals that are kept in relatively small areas (E.g. dairy cows) as well as for animals that roam large areas (E.g. field grazing sheep/cattle).
For animals in confined areas BLE can be used to transfer all data and since they should always be close to a base station. Since all smartphones and tablets are equipped with BLE it allows interfacing with individual tags directly without special equipment.
For roaming animals the applications for BLE gets more interesting. Since cattle, sheep, and goats tend to move in herds, BLE advertising and/or Bluetooth Mesh can be used to monitor herd behavior. The different tags in a group equipped with GPS can take turns to fix locations, so that the power consumption for each individual tag is kept to a minimum while still maintaining an accurate fix on the herd as a whole.
When an individual animal or group breaks off from the herd, it can be quickly determined by checking which animals are still within BLE range of each other and adapt the GPS usage accordingly. GPS usage can be even further reduced by placing BLE beacons in fixed locations to track animal movement.
For these reasons I plan to use BLE enabled MCU’s as the base for all future versions of this project. I will also be looking at Bluetooth 5 capable modules to allow upgrading as time goes on and it becomes more widely implemented.
10/15/2017 at 19:59 •
The hardware for field testing has been narrowed to the parts below:
- MAX30105 (Sparkfun Breakout) Particle/Heart rate sensor: Technically the MAX30101 is for optical heart rate measurement, but as far as I can tell the sensors are identical. ALL the registers are identical, just the names and descriptions in the datasheets differ in some cases. The idea is to measure the heart rate on the exposed skin inside the ear of an animal
- MPU9250 9-axis IMU (Sparkfun Breakout): Widely used IMU with integrated 3-axis accelerometer, 3-axis gyroscope and 3-axis magnetometer/compass. Used to detect movement and possibly do some intelligent activity recognition. Other lower costs sensors might be considered later but the Sparkfun unit is convenient for testing.
- LMT01 Temperature Sensor: Ideal for creating a temperature probe to insert into the ear canal of an animal to measure body temperature. The sensor comes in small TO-92 package with a digital pulse train interface.
GPS will not be in the basic unit, but rather an optional extra where the application requires it. This is mainly due to the additional cost and current consumption of a GPS module. The two units with the lowest current consumption and a small form factor I have found so far are:
- OriginGPS ORG1410 Hornet: A tiny 10x10x5.8mm GPS module with an integrated antenna. Low current consumption
- Quectel L70: Small GPS module. Does not include an antenna
07/24/2017 at 00:54 •
The first draft of my business plan has been uploaded under the files section as part of the Best Product entry requirements.
It is the 2nd business plan I ever wrote, and the experience was very rewarding. I I used this template to get a rough idea of what questions I should be asking myself. I also found the Virgin Startup Business Plan Template to be a valuable resource
Now for some sleep.
06/11/2017 at 17:46 •
A basic idea of how data is collected and used. One of the critical points is that the data is analysed in conjunction with the data from the other tags in the herd. A single animal suddenly moving is not necessarily significant, but if a couple of animals do so at the same time, it can be reasonably assumed that there is some sort of disturbance. When there is a spike in heart rates as well, it would indicate a threat.
As previously mentioned, body temperature and pulse is are a good indication of the health of a animal. Analysing the data of the IMU can also be used to identify the following:
- Cows that are in heat, commonly detected by increased activity
- Ruminating (chewing the cud). It is also a indication of health and stress levels.
06/10/2017 at 22:42 •
I did a basic schematic of the four sensor that I will be testing with the Adafruit Feather 32u4 LoRa. I'm using EasyEDA since it is cloud based and therefor really convenient when working from multiple computers. I have the GPS and IMU already, and I'm currently getting to grips with interfacing them with the Feather. Still waiting for the pulse sensor and RTD probe and amp breakout.
06/08/2017 at 21:21 •
A quick overview of the CC1350 Sensortag development boards that arrived today. I must say they pack a lot of capability into a very small package (42x32x5mm), at a affordable price.
- TMP007 IR thermopile and ambient temperature sensor
- OPT3001 Ambient light sensor
- HDC1000 Humidity sensor
- BMP280 barometric pressure sensor
- MPU-9250 Accelerometer, gyroscope and compass
- MK24 reed switch
- SPH0641LM4H-1 microphone
- ON board antennas for both the BLE and Sub-Ghz radio, as well as connectors for external antennas
- 2 buttons
- Coin cell battery holder
Connecting the sensors to my smartphone is as simple as downloading the TI app, pulling out the battery tab.
The boards also come with nice little enclosures. In the photo the module on the right has the Debug-DevPack added on top of it, which breaks out the remaining pins to a 1mm pitch header as well as some pads for grove sensors. It is also required to do firmware programming and debugging. It connects to the sensor tag via a hermaphroditic "SKIN connector". All the design files are available on the TI website, so designing my own DevPack to connect the other sensor I require should be relatively simple. I was able to get some free samples of the SKIN connectors which I will use for this purpose.
The board is actually the perfect size for testing as a ear tag. So the plan is to make a DevPack with the other sensor I require and make a enclosure that would allow use as a ear tag or collar. The GPS will add a bit to the size, and eat the coin cell for breakfast, but it should be enough for some quick testing. In short I believe this dev kit will be extremely handy for both this project and my FireBreakNet project.
06/07/2017 at 23:22 •
I will be relying primarily on a accelerometer, heart rate monitor and a GPS for theft detection and response. Since the majority of thefts happen at night when the animals are resting, the accelerometer will allow any major disturbances to be easily detected. Especially when multiple animals in a herd suddenly start moving simultaneously, with increased heart rates, it likely indicates some external disturbance. When major movement is detected for a certain amount of time, the GPS will be activated to pin the location and forward it to the base station. This will allow the power consumption to reduced since GPS will only be activated when the animal is moving.
For testing I selected a MPU-9250 intertial measurement unit and a Ublox Neo-7M GPS module.
Temperature and heartbeat sensors can also be added to enhance the tags capabilities. They can be a very good indication of the health of the animal. Heartbeat especially can be a good indication of the animal's stress levels. These two parameters will also clearly show if a tag is removed. Another simple method to detect this is to add a thin wire connection that will be broken when a tag is removed.
I have ordered a PT100 RTD precision temperature probe with amplifier module for initial testing. It will probably only arrive later this month. I have yet to order a heart beat sensor, but am looking at this one for testing. Of course the challenge will be to see if the see if sensors work as expected on animals.
Ear tag or collar?
To enable the implementation of heartbeat and body temperature sensors, a ear tag unit will be the optimal solution. It allows easy access to the animals ear canal for a temperature probe. From a ear tag the arteries just under the skin of the ear is easily accessible. This could allow the use of optical heart beat sensing to be used. Since ear tags are already in use on most farms, fitting animals with tags should be relatively simple.
The ear tag does have some disadvantages however. Firstly it limits the size and weight of the tag severely. An ear tag should be as small and light as possible. Secondly the constant movement of the animal's ear would cause the accelerometer to readings to be very "noisy" possibly limiting it's usefulness A collar will allow a more stable platform for the accelerometer that would allow much "cleaner readings" but makes implementing the temperature a and heartbeat sensors much more difficult.
I will test both approaches first, before looking at more complex/expensive solutions like using both a collar and an ear tag.
Any advice/suggestions are welcome!
06/07/2017 at 22:34 •
To get up and running quickly for this project I decided to use off off the shelf modules wherever possible for initial testing to make plug&play prototyping with a breadboard easy.
Microcontroller and radio
I will be using Adafruit Feather 32u4 LoRa dev boards for initial testing. They were available form my local supplier, so I could quickly get my hands on them. The boards have a 868Mhz SX1272 LoRa radio module onboard, as well as Lipo battery charger. I have no experience with ARM boards, so decided to stick with the 8 bit ATMega version of the board for a start, which I have some experience with.
The other MCU/radio combination I will be testing is the new Texas Instruments CC1350 Dual Band Wireless MCU. It integrates an ARM M3 processor, a Sub-Ghz radio, BLE radio, and an interesting low power 16 bit "Sensor Controller" processor on a single chip. This chip is also available in a version without BLE, as the CC1310. Although the learning curve to get this chip working for my purposes will be much steeper, I believe there is a lot of potential.
TI claim that the chip is extremely low power, as well as long range with the Sub-Ghz radio. The BLE allows for Over-the-Air updating from a smartphone/tablet, which can be very handy in the field. The on-board "Sensor Controller" is a very low power 16 bit processor that can function to independently check sensor inputs, and only wakes up the powerful ARM processor when absolutely necessary.
I have ordered the CC1350 Launchpad Dev board, which I intend to use as a gateway for testing, as well as 2 CC1350 SensorTag dev kits, which integrate 10 environmental sensors and a coin cell battery holder in a very small package. The SensorTags also allow add-on boards to be added on top of them. The TI website has some very detailed tutorials and examples which will hopefully speed up development.
I must give some credit to Shantam Raj with his SUN Project. I was introduced to the CC1350/CC1310 chips while reading his project logs.
I am considering adding a GSM modem as a modular add-on to the tags, to extend the range. My motivation for not making this standard on every tag is as follows:
- It would increase the cost and power consumption, even if only slightly. I want the tags to be as cheap as possible, to make equipping every single animal on a farm a viable option.
- Some of farms are extremely isolated and might not have GSM coverage.
- Tags can be cut off by thieves, and often cattle are simply slaughtered in the field where they graze. Therefor my focus will be on detecting theft/disturbances as they start, not after it is done
Where GSM is available, some of the tags in a group/heard can have the GSM module installed, to allow that particular tag to also act as a gateway for the other tags within range of the Sub-Ghz radio, snd so extend the detection range.