-
Final Report and Video
11/10/2016 at 11:15 • 0 commentsSo the project is technically finished, in that I've submitted all my documentation and my time at university has come to an end.
Here is the video and technical report for those who are interested!
-
Nearing Completion of the Project
10/09/2016 at 22:24 • 0 commentsFour copies of the collar board have been put together. Only really three errors in the board design: micro USB pin spacing isn't quite the same as the footprint, regulator footprint had Vin and Vout switched, changed my mind about using the DAC for audio output (using a PWM output now).
Was able to try it on a cow a week ago. Safe to say it was a very interesting experience! Collar design isn't ideal, being top heavy it rotated upside down as she moved around, and it doesn't fit the shape of the neck particularly well. I would definitely redesign the enclosure to not have the square top and to have the majority of the weight at the bottom of the collar (was my original plan).
-
Initial Web Interface
08/13/2016 at 23:58 • 0 commentsA major task that was completed over the mid year break was to develop the web interface that will allow the easy placement of fences, and to track the movements of the animals.
It is built on the MEAN stack, utilising NodeJS, Express, Angular and MongoDB. Having not used this before (or really knowing JavaScript) there was a fair bit of a learning curve, and I'm sure that it hasn't been implemented perfectly in terms of following the principles of RESTful websites!So far I've only implemented the two important pages that allow the placement of fences and viewing of logged points. I'll continue to improve it over the next two months, as well as creating the other pages to allow updating website and collar settings and viewing statistics.
-
3D Printed Enclosure
08/13/2016 at 23:40 • 0 commentsHaven't updated this for a while so here comes a whole bunch of posts in a row!
An initial prototype of the enclosure has been printed. Whilst everything works fine with the enclosure, I'm not sure that it is ideal for actual use, it seems quite bulky, and the hinge would likely not be strong enough for actual use. Possible changes to the design would be to remove the centre section, and have one side contain the PCB and the other side the battery. Will look into this over the next few weeks, however I have limited time before the project is due to be completed and since most of my marks will be for the electrical and software design it will be a lower priority. -
Wireless Communications
06/27/2016 at 07:33 • 0 commentsAn important feature of the OpenFence system is the ability to update the fence position remotely and to be able to track the animals’ movements over the day. This requires some sort of wireless communication. As was mentioned in the component selection above, LoRa has been chosen for the physical layer of the system. The HopeRF RFM95W is a 915MHz module, which has the ability to transmit over long distances with low power consumption, and is available in relatively cheap modules.
The network will use a star topology with the collar nodes only looking to receive packets after they complete a transmission. This will reduce the power consumption significantly by not having the module always looking to receive data. The star topology was chosen over the option of a mesh network, as it would require the collar nodes to be always receiving and then sometimes retransmitting messages, consuming much more energy. Another flaw with using a mesh network for this application is that the position of the animals will be constantly changing, making it difficult for the network to find the most efficient path to a particular end node.
The “RadioHead” library (GNU GPLv2) is available for the RFM95W that is being used for this project. This library provides the ability to transmit and receive reliable (acknowledged) packets to up to 255 nodes as standard, with the possibility of altering this to allow more node IDs. It supports broadcasting to all nodes, and has the ability to classify messages into 16 different categories using 4 bits of flags in the header. The complete message format is shown below.
Currently there are two types of messages that are being sent between the base station and collar. The first is a position update from the collar to the base station and contains the location, time, date and number of alerts and shocks so far today. The second is a fence update from the base station to the collar and contains the fence version, number of corners, and the positions of these corners. Both of these two packets are 20bytes as can be seen in below.
-
PCB Manufacture!
05/26/2016 at 06:21 • 0 commentsAfter completing the PCB design I sent off the Gerbers to PCBWay for manufacturing, a week later they are here! The quality is excellent for the price and the service was really easy to use.
Components are starting to arrive. Soldering the components will be started once I have them all.
Software has been progressing with LoRa communications working well (next post will be on that).
-
PCB Design
05/19/2016 at 05:59 • 0 commentsPCB has been laid out in KiCAD, Gerbers generated and sent for manufacturing. The following are renders of the front and back from GerbLook. It is a two layer design, with a board size of 97mm x 57mm.
The design has tried to minimise opportunities for noise and interference. The high frequency components are towards the top, digital and power circuitry in the middle, and audio at the bottom.
To ensure the antenna output was matched to 50 Ohms, Saturn PCB Toolkit was used to design the coplanar waveguide. 50 mil with an 8 mil gap to the surrounding ground plane on 1 ounce copper was determined to provide 50 Ohm impedance.
Wasn't quite as impressed with KiCAD's PCB design tool, not being able to easily stitch the ground planes together and not being able to drag tracks were the biggest peeves. Still for a completely free program it does a good job!
As always if you want to look at the original Gerbers or KiCAD files they are available on GitHub.
-
Schematics
05/10/2016 at 11:34 • 0 commentsSchematics have been basically finalised, although check the GitHub one for the most up to date version. I have been using KiCAD for this project, having moved from designing in Altium for another project over the summer. Really impressed with the functionality and keyboard shortcuts of KiCAD, everything is just what you expect it to be.
Most of the circuits are based off each devices application circuit, along with comparisons to the breakout boards I have for many of them. If you have any feedback or questions, pleasedon't hesitate to comment!
MCU
Power Management
RF and USBAudio
GPS and IMU
Flash and SWD -
Component Selection
05/05/2016 at 22:57 • 0 commentsSo after many weeks of ordering and testing components, I have almost finished selecting the major components I will be using (at least for my first version). Here I will layout some of the comparisons of components that has led me to the selections in the hope that it might help others deciding between components for their project and provide the thought process behind my choices.
MCU
I have chosen to use the Atmel SAM D21 as the microcontroller as it is a low power chip that will provide enough processing power for this project. I have worked with this chip before so the development will be easier than moving to another manufacturer.
GPS
Global Top
PA6C
uBlox
NEO M8M
SkyTraq
S1216F8-GL
Antenova
M10478-A1
Chipset
MTK MT3339
UBX-M8030
SkyTraq Venus 8
SiRFstarIV
Current
Acquisition
Tracking
25mA
20mA
24.5mA
23.5mA
45mA
40mA
47mA
31mA
Interface
UART
UART, I2C, SPI
UART, I2C
UART, I2C, SPI
Input Voltages
3.0V to 4.3V
Ripple <50mVpp
1.65 to 3.6V
3.0V to 3.6V
1.8V
Acquisition Time
Cold: 35sec
Warm: 33sec
Hot: 1sec
Cold: 27sec
Warm: 4sec
Cold: 29sec
Warm: 3.5sec
Hot: 1sec
Cold: 35sec
Warm: 35sec
Signal Sensitivity
-165dBm
-164dB
-165dBm
-147dB
Position Accuracy
3.0m
2.5m
2.5m
2.5m
Update rate
Up to 10 Hz
Up to 10Hz
Up to 20Hz
1Hz
Additional Features
Includes antenna
Concurrent GLONASS and GPS
Concurrent GLONASS and GPS
Cost
$16
$59
$16.20
$22
I have selected the Global Top PA6C due to it's low cost, low current draw, and ease of implementation.
Communications Chipset
NXP KW40Z
TI CC2650
TI CC1310
X-Bee Pro 900HP
RFM95W
Protocols
BLE
ZigBee
Thread
BLE
ZigBee
802.15.4
802.15.4
ZigBee
LoRa
GFSK
Frequency
2.4GHz
2.4GHz
900MHz
900MHz
900MHz
Throughput
250kbps
250Kbps
50Kbps
200Kbps
10Kbps
Typical Receiver Sensitivity
BLE: -91 dBm
(802.15.4): -102 dBm
BLE: -97 dBm
(802.15.4): -100 dBm
-124dBm
-100dBm
-148dBm
Core
ARM Cortex M0+
ARM Cortex M3
ARM Cortex M3
-
-
Memory
160 KB Flash
20 KB SRAM
128 KB Flash
28 KB SRAM
128KB Flash
28KB SRAM
-
-
Power Consumption
RX: 6.5 mA
TX: 8.4 mA
RX: 5.9 mA
TX@0dBm: 6.1 mA
TX@5dBm: 9.1 mA
RX: 5.5mA
TX@10dBm: 12.9mA
RX: 80mA
TX: 210mA
RX: 10.4 mA
TX:
Range
100m
100m
Several km
6.5km
8 km
Cost
$5.65
$11.40
$11.40
$60
$12
For the communications chipset I am currently using a LoRa module, as I tried getting communications working with the TI CC2650 with the plan to move to the pin compatible CC1310 however I had a lot of difficulty getting them to work. So for my time constrained development I am using the HopeRF RFM95W as it has simple to use drivers available, is cheap and provides good range. I will definitely be looking into the CC1310 once the Launchpad development kit is released for it.
IMU
Invensense MPU9250
Bosch BMX055
STM LSM9DS0
Features
Accel/Gyro/Mag
Accel/Gyro/Mag
Accel/Gyro/Mag
Input Voltage
2.4 – 3.6V
2.4 – 3.6V
2.4 – 3.6V
Current
Accel
450uA 4kHz (8.4uA 1Hz)
120uA
350uA (A+M) 50Hz
Gyro
3.2mA 1kHz
5mA
6.1mA
Mag
280uA 8Hz
170uA 10Hz
350uA (A+M) 6.25Hz
Communications Protocol
I2C/SPI
I2C/SPI
I2C/SPI
Additional Components
3
2
4
Cost
$4.20
$9.25
$9.50
I need an 9DOF IMU for determining the rate of movement, compass heading and possibly dead reckoning. I have chosen the MPU9250 as it is a commonly used device, is available quite cheaply and has fairly comparable current draws to the others I looked at.
Amplifier
Linear - PAM8407
TI - TPA2008D2
Maxim - MAX98303
Linear – PAM8403
Class
Class D
Class D
Class D
Class D
Input Voltage
2.5 – 6.0V
4.5 – 5.5V
2.6 – 5.5V
2.5 – 6.0V
Quiescent Current
8mA
7mA
2mA
8mA
Output Power
2 x 3W (4Ohm, 5V)
2 x 2.5W (4Ohm, 5V)
2 x 3.1W (4Ohm,
2 x 3W (4Ohm, 5V)
Efficiency
83% (4Ohm)
80% (4Ohm)
87% (4Ohm)
83% (4Ohm)
Features
Up/Down Volume inputs
Analog volume input
Analog gain input
Mute input
Package
16-SOIC
24-HTSSOP
16-WFBGA
16-SOIC
Cost
$1.10
$5.70
$0.90
$0.20
Whilst the Maxim device looks the best out of these, the BGA package means I didn't choose it. With the cheap cost of the PAM8403 it is possible to add volume control a dual channel digital potentiometer that can be be controlled using your preferred method and end up costing about the same as the 8407. I chose the Maxim MAX5387MAUD+ which is controlled using I2C and costs a bit over a dollar.
Battery Charger
Microchip - MCP73871
Linear - LT3652
TI - bq24074
Input voltages
4.4 – 6V
4.95 – 32V
4.35 – 10.5V
Charge current
50mA – 1A
2A
1.5A
Quiescent current
180uA
85uA
50uA
MPPT
Yes
No
Temperature Monitor
Yes
Yes
Yes
External Components Required
8
14
7
Cost
$2.30
$9.30
$3.00
Using the MCP73871 as it works well with a solar input despite not having true maximum power point tracking. It requires less external components to a chip that provides MPPT which helps keep the cost down further. It also performs load sharing between the solar input and battery storage.
3.3V LDO Regulator
Microchip - TC1262
Microchip- MCP1700
STM - LF33ABV
Max Input Operating Voltage
6
6
16
Min Input Operating Voltage
2.7
2.3
-
Max Current
500mA
250mA
500mA
Quiescent current
80uA
1.6uA
500uA
Dropout Voltage (Vin-Vout)
With varying load current
20 – 60mV
30 – 130mV
200 – 390mV
350 – 650mV
100uA
100mA
300mA
500mA
178 – 350mV
250mA
200 – 350mV
400 – 700mV
200mA
500mA
Cost
$1.06
$0.48
$1.26
Flash Memory
I have chosen to use a 2MB serial flash chip as storage for data logging purposes. The SPANSION S25FL116K has a very low standby current and is very cheap at only 65 cents. It is communicated with over SPI and is the same chip as used on my Rocket Scream Mini Ultra Pro development board.
-
Enclosure Design
04/22/2016 at 23:51 • 0 commentsI have spent a bit of time improving the design of the collar enclosure in Solidworks, so I can start 3D printing some test versions once I receive and measure the last few components (speakers and solar panels) that I am waiting on.
In order to make the collar fit many sized animals I have made the two sides such that they can rotate up and down. This adds some difficulty in getting the wires from the solar panels, speakers, etc to the main circuit board and keeping it weatherproof. I have designed the hinge such that the wires can go through them, however this will require testing as to whether it reduces the strength of the pin significantly.
There are still a few things to add, but for now I will keep working on the electronics with final component choices being made (next log) and PCB design to begin.
Files are available at GitHub (GNU GPLv3).