The biggest project I want to complete this year is my smartphone app for controlling a ponyboy. I have not been as on top of this as I would like, but I'm determined to get a basic prototype built, which I can then add new features to.
In the most basic sense, I want to develop a shock collar that is controlled by a smartphone app. Since I have an iPhone, it will be an iPhone app (though it will have to be an app only for jailbroken (i.e. rooted) iPhones since I seriously doubt that the app store will want anything to do with an app like this).
Controlling a basic shock collar with an app does not seem that difficult to do using a bluetooth interface. After examining the collar's shocking mechanism, I believe it would be trivial attach a bluetooth headset via a relay and activate the collar's shocking mechanism. However, my worry here is the limited range of bluetooth devices.
The alternative would be to attach the phone to an RF transceiver, but this would of course require the trainer to carry both the phone and transceiver. Another possibility would be to use a separate RF transceiver that communicates with the phone/app via bluetooth (so it could be kept in the trainer's pocket or otherwise nearby but not physically attached to the phone) but uses a different frequency to communicate with the collar.
I actually like the last option best, and that is what I would like to ultimately implement, but for my initial design I will use straight bluetooth communication from the phone to the collar so I don't overly complicate things right away.
The features I would like to include in the collar/phone combination are:
After looking through the feature set I want above, I'm going to have to completely gut the commercially available collar I'm using for this project. The only components I can use from it are the later parts of the shocking unit chain: everything from the amplifier to the electrodes can stay, but everything else will have to go.
Here is an overview of the features I intend to implement:Advanced Shocking Mechanism
Once these values are set within the app, the trainer simply depresses the "shock" button (and holds it down for as long as she wishes the stimulation to continue), which transmits the digital waveform to the collar. The collar receives transmission, demodulates it, and passes along the received waveform to the DAC. The output of the DAC is amplified, and the output of the amplifier is passed on to the step up voltage transformer, which is connected to the electrodes, which are in contact with the pony.
Being able to choose the waveform, basic frequency, pulse length, and pulse repetition frequency in addition to the amplitude gives the trainer significantly more granularity in determining the sensation the pony experiences.GPS Corralling
The trainer can then specify the size of the "corral", which will transmitted to the collar and also be stored in the collar's memory. The microprocessor on board the collar will then compare the distance from the collar's current location to the original "set" location 20 times per second. If the distance between the current and set location is less than the preset "corral" size, it will do nothing. If the distance is greater than the preset size, the microprocessor will pass on a simple, pre-determined waveform to the shocking unit, which will amplify it and deliver the shock.
Since the GPS unit is contained on the collar itself, and both the "set" location and corral size are stored within the collar's own memory, corralling is a "set and forget" feature. Even if the trainer walks away from the pony and the app loses contact with the collar, the pony must remain within the pre-designated area until the feature is disabled by the trainer from within the app interface.Accelerometer Motion Restriction/Enforcement
When the value of the "movement" variable is true, the microprocessor will accept the output of each of the accelerometer's axes and calculate a speed for the pony by averaging several samples of the accelerometer (the accelerometer I was thinking of using has a sample rate of 50Hz, so averaging 5 samples would give an average sampling rate of 10Hz, which might or might not be sufficient). The speed will then be compared to the value set by the trainer (and now stored in memory). The error between the values must remain below a preset threshold (which will have to be empirically determined) otherwise the pony will receive a shock.
Thus if the "speed" value set by the trainer is 0, the pony will have to remain still. This also has the advantage of allowing the trainer to keep the pony in four legged mode by simply making him get onto all fours and then setting the speed value to 0. Alternatively, the trainer may set the "speed" value to something other than 0 and require the pony to move at the speed specified (though it can be walking in place or in circles, so it would still be compatible with the corralling feature).
Similar to the corralling, the motion restriction/enforcement is also "set and forget" since all values are stored within the collar's own memory.Piezoelectric Noise Sensing
When the "quiet" value is true, the microprocessor will accept the amplified piezo signal and compare it to a preset (empirically determined) minimal value multiplied by the integer selected by the trainer. If the amplified piezo signal is greater than the product of those two values, the pony will receive a shock, otherwise the collar will do nothing.
The value from piezo will be sampled at an appropriate rate (likely around 48kHz) to ensure adequate sampling of the pony's noises while still attempting to conserve battery life.
Ideally, I would like to include a DSP to do the Fourier analysis of a ponyboy's whinny in-collar to permit/require the pony to whinny (based on comparison and error analysis to a pre-recorded whinny or set of whinnies), but a quality one of these is not inexpensive, and I'm not really sure what the accuracy would be, so I'm leaving that part for future development.Development
What do you think? Are there any other features you would like to see included? If so, please let me know. Since the design isn't final, I would love to include other features that might be useful to human pony trainers.