Poor Man's Transmitter for Pet Containment System

Status
Not open for further replies.

Thread Starter

Renbo

Joined Apr 12, 2009
15
MWE: Baited breath? What'd you use for bait? (perhaps you meant "bated" breath)

(Everyone else: I know MWE, otherwise I wouldn't tease him publicly.)

The results are in: an AXMEGA32E5 controller in conjunction with an 8-pin Class D audio amp works just fine. I used the controller's on-board DAC to generate the waveform Renbo so graciously discovered and published, and the Class D amp easily drives the 10 ohm resistance of my loop. The amp has short circuit protection. I will use external series resistors to control the width of the detection zone.

I will either layout a PCB or take MWE up on his offer. I probably won't bother with much in the way for surge protection, just a few components, since the cost of this board will be so low. (<$1 for the PCB and a couple of dollars each for the controller and audio amp) I'm targeting a PCB about the size of a USB thumb drive.
Excellent! Glad to hear your foray into a DIY transmitter worked out!

Do you happen to know what the model number is for that 8-pin Class-D amp you used is? Sounds like a much simpler approach than what I put together.
 

gcooper

Joined Aug 6, 2014
7
Sure, it's a TPA2005D1.

I actually re-purposed a controller board I was working on for a client, which contained the Atmel controller and the audio amplifier, and a few regulators and such. I only needed to add some firmware to recycle the leftover boards into transmitters.

The audio amp is a surface mount device, though, and might be a challenge to mount. It's simple enough to solder so long as you have young eyes (I don't) or a good microscope (I do.) It switches at approximately 250 kHz, so make sure to add some low-pass filtering between it an the wire loop (i.e. antenna.)

I think my PCB will end up being about 1.5" by 2".

I'm not familiar with PICs, as I work mostly with Atmel and TI controllers. Does it have a reasonable fast DAC available? I generated the output signal directly with the Xmega's DAC, using 8 samples per cycle of the 10.65 kHz signal.
 

mwe

Joined Aug 6, 2014
2
I have done one small project with PICs and I think I would rather be raped by a rino than do that again. I like the architecture of the TI MSP parts and gcooper is convincing me Atmel is the future. TI's path above the MSP430 family is brain damaged. A patchwork of stuff they bought.

Send me the schematic of the micro/amp thing and tell me how you want to hack it.

M
 

gcooper

Joined Aug 6, 2014
7
I don't blame you. They build some nice devices.

I like the Atmels because of their rich set of on-board peripherals, though they do have a reputation for occasionally shipping a device before it is "ready for prime time." I often have need for on-board ADCs and DACs, which Atmel offers on small-footprint, economical devices. Most of all, though, I dislike learning new device families unless someone else is paying for it.

Regarding the Petsafe signaling, I've been looking at the doc Renbo provided, and I'm beginning to think that the stepped output level drawing is just describing an allowable window, NOT mandating such an envelop. In fact, the broad amplitude tolerances shown in the drawing clearly indicate that a waveform in which the 10.65 kHz signal was of a constant amplitude for the entire active period.

That said, a controller is entirely unnecessary, and a pair of 555 timers could create the needed waveform. I'll revise my firmware to remove the stepped amplitude waveform and retest.
 

Thread Starter

Renbo

Joined Apr 12, 2009
15
Regarding the Petsafe signaling, I've been looking at the doc Renbo provided, and I'm beginning to think that the stepped output level drawing is just describing an allowable window, NOT mandating such an envelop. In fact, the broad amplitude tolerances shown in the drawing clearly indicate that a waveform in which the 10.65 kHz signal was of a constant amplitude for the entire active period.

That said, a controller is entirely unnecessary, and a pair of 555 timers could create the needed waveform. I'll revise my firmware to remove the stepped amplitude waveform and retest.
The doc I provided was an FCC test where they were showing the measured output of the device.

The reason for the envelope, IMHO, is the following:

When the collar picks up the higher amplitude bursts at the fringe of reception, the collar knows to emit the warning tone to the dog without shock correction.

When the collar picks up the higher *and* lower amplitude portions of the envelope (closer to the wire), it knows to enable the static electric correction (shock).

If one were to replace the 2 amplitude portions of the envelope with a single burst at the same amplitude, it might defeat the warning signal and only cause the static correction.

Another facet of the envelope is that if one were to increase the difference between the high amplitude and low amplitude portions of the envelope, one might be able to increase the "warning" range before the dog hits the "correction" range.

Incidentally, I did try to recreate the signal with analog devices. I used 555 timers together with counter IC circuits and did manage to get a close approximation. the downfall is the drift of those circuits led to the need for constant tweaking.
 

gcooper

Joined Aug 6, 2014
7
That's good insight, thanks.

It's interesting that the tolerances shown on the drawing appear to allow for the 2nd half of the active part of the signal to actually have LESS amplitude than the first. That said, my measurements show the amplitude step to be there, and to be consistent as the overall amplitude is increased.

Nowadays, there's little to be gained by building using discrete digital components anyway, considering how little a small controller costs. And the waveform from the DAC is much cleaner (with 8 steps) than the square wave from a LM555.
 

Thread Starter

Renbo

Joined Apr 12, 2009
15
That's good insight, thanks.

It's interesting that the tolerances shown on the drawing appear to allow for the 2nd half of the active part of the signal to actually have LESS amplitude than the first. That said, my measurements show the amplitude step to be there, and to be consistent as the overall amplitude is increased.

Nowadays, there's little to be gained by building using discrete digital components anyway, considering how little a small controller costs. And the waveform from the DAC is much cleaner (with 8 steps) than the square wave from a LM555.

Still, I would be curious to see if what I am guessing is correct. If you get a chance, let us all know if the removal of the stepped amplitude stuff actually results in a change in the characteristics of how the collar reacts to the wire. Or for that matter, if increasing the difference between the two phases increases the distance between sound and shock. I could be totally wrong!
 

Thread Starter

Renbo

Joined Apr 12, 2009
15
Will do, I am curious sort also. By the way, are you also a firmware developer?
I am a software developer by trade (SQL Server, .NET stuff, Web stuff). I tinker with micro-controllers for fun and hobby purposes. I know enough C to get me into trouble! So far I've only been messing with PIC stuff, but looking to get into the Atmel world soon.
 

mod440

Joined Sep 13, 2016
1
I am a software developer by trade (SQL Server, .NET stuff, Web stuff). I tinker with micro-controllers for fun and hobby purposes. I know enough C to get me into trouble! So far I've only been messing with PIC stuff, but looking to get into the Atmel world soon.
I am interested in this thread but can not see any of the images. Have they been removed?
 
Last edited by a moderator:

tcmtech

Joined Nov 4, 2013
2,867
I am interested in this thread but can not see any of the images. Have they been removed?
The thread is 2+ years old.

He shot the dog and solved the source of the problem a long time ago.

It's not dead but with only three legs now it's far less inclined to running anywhere. ;)
 

wayneh

Joined Sep 9, 2010
17,498
For what it's worth, I can not see any of the attached photos either. They must have been removed from the server?
 
So we have this pet containment system by PetSafe. It's the buried wire type that transmits around the 10.66 kHz range. Our buried wire perimeter encircles around 2 acres of yard, so it's a decently large loop.

We've now had our 2nd transmitter fail (over about 11 years), which isn't THAT bad on average. At about $100 a pop, they're not super expensive, but I figured I'd see if I could cobble together one on my own with spare parts laying around on the cheap (and maybe amp up the power a bit for areas where the line is buried deeper and doesn't trigger the collar all that well)

One barrier of entry on this project is that it requires an MCU, in my case a dsPIC30F2012. This particular chip is WAY overkill for such a purpose, but I had it around, and it's a $4-5 part or so. Most any 5v MCU will do the trick.

I did a little web search for the patents on the transmitter and actually found FCC tests that laid out the wave patterns needed (and a schematic of the unit I had actually).

After some messing around and fiddling with the oscilloscope, I got the thing to work. The power levels are adjustable to FAR more than I'd need. The only part that gets warm to the touch is the voltage regulator, but I can always throw a heat sink on that.

The schematic:



The dsPIC30F2012 does 2 important things: it supplies the signal and timing, and it detects oscillation fault.

The waveform for the PetSafe system uses a signal at about 10.66 kHz. The signal is amplitude modulated between zero signal, low signal and high signal. RB2 provides a 10.66 kHz square wave during the low and high phases, and RB3 biases the signal depending on the high or low phase. The two are mixed into the base of Q1.

Q1 feeds a high power switching transistor (Q2), which I had harvested out of an old power supply. I tested other power supply NPN transistors which also worked: C2810, C5027, E13009, E13007F2, and STD13007.

LED2 is a simple continuity checker. D1 is there to prevent inductive kick-back (not sure if even needed).

T1 is some spare wire wrapped around a ferrite core (from an old PSU). C1 values might be different for different size loops. T1, C1 and the loop act as a tuned circuit, so fiddling might yield good results depending on your setup.

The other side of T1 generates about 2.5v when the circuit is oscillating. The LM311 is used to detect this signal and discharge C5. When the oscillation stops, C5 will charge up, the output being fed to the dsPIC's RB4 lead. When the program sees this happen, it lights up the fault LED.

LS1-LS4 are for diagnostics, and currently just light up back and forth for amusement.

C2, C4, C3 and C2 are just there to provide clean stable power to the board.

I'm no brain surgeon, so I am sure there are MANY ways to improve this circuit, not the least of which would be to add some sort of fuse to the output stage in case of short circuit.

If anyone's interested in the code for the dsPIC, or for the general waveforms that should be outputted in case you're using a different MCU, just let me know.

At any rate, thought I would share the schematic. It's been up and running for a couple of days now, and seems to work fine!

p.s. I plan on building a couple of these, one for the car, which is the main reason I used a regulator to handle 12v instead of just using a 5v supply. (our Jack Russel likes to charge after cars, we'd like to train that behavior out!).
Hi, I know this is an old thread, but I am starting a project to build a portable device that attaches to a mobile unit, so when the dog approaches it triggers the shock collar...your post made me curious to see if you had an recommendations for a low power (9v battery) approach on the side of the device that would act similar to the ground wire border, but instead be a portable and small type device
 
Last edited by a moderator:

wayneh

Joined Sep 9, 2010
17,498
There is a portable version available commercially. I think it works by zapping the pet if it attempts to leave the range of the mobile transmitter. Would that work for you?
 
There is a portable version available commercially. I think it works by zapping the pet if it attempts to leave the range of the mobile transmitter. Would that work for you?
Thanks for the reply, actually, I want to accomplish the opposite affect , when the dog approached a mobile unit , and enters the proximity of that unit , the shock collar is set off. I have found proximity units ( ex; to keep your dogs away from the trash can ). But they are large and stationary and plugged into the wall socket
 

wayneh

Joined Sep 9, 2010
17,498
...I want to accomplish the opposite affect...
That may require some hacking if you can't find something pre-made.

I'm wondering if instead you could use RFID to trigger the dog's collar when it comes in range of a mobile RFID transmitter.

There is also a range of bluetooth "tags" out there, for instance for finding your keys. You might be able to hack something like that.
 
Status
Not open for further replies.
Top