Poor Man's Transmitter for Pet Containment System

Discussion in 'The Projects Forum' started by Renbo, Sep 11, 2013.

  1. Renbo

    Thread Starter Member

    Apr 12, 2009
    15
    2
    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:

    [​IMG]

    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!).
     
    strantor likes this.
  2. wayneh

    Expert

    Sep 9, 2010
    12,155
    3,061
    Wow, an ambitious project well done.

    You should take some pictures of your build and submit this to the Completed Projects section.
     
    Renbo likes this.
  3. MrChips

    Moderator

    Oct 2, 2009
    12,451
    3,371
    Very nice. One thing is missing.
    Gives us the big picture. What is the principle of operation?
    How does it keep pets in containment?
     
  4. Renbo

    Thread Starter Member

    Apr 12, 2009
    15
    2
    Sorry, I was going off the assumption that those interested already had buried wire dog fences like I do, which is silly. :) There would also be a good case for building one of these units initially as opposed to building one when your existing one fails (like mine did).

    The Basics

    The PetSafe pet containment system is comprised of 3 parts, the transmitter, the buried wire, and the dog collar.

    The transmitter (which I've built a replacement for) generates a 10.66 kHz signal with a duty cycle consisting of an off phase, a low amplitude phase, and a high amplitude phase.

    When the collar gets close enough to the buried wire receive the high amplitude signal, it vibrates and emits a beep to warn the dog, but no shock correction is given.

    When the collar gets close enough to receive the lower amplitude signal, an electrical shock is sent through electrodes that are close to the dog's skin, producing a shock.

    The phases must be precisely timed or the collar will ignore the signal.

    Building this circuit, one can buy the collars alone to achieve this goal. BUILD THIS UNIT AT YOUR OWN RISK, I DO NOT WARRANT ITS PERFORMANCE.

    I am including some scope snapshots to illustrate the various signals that are created by the unit.

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    I hope this answers your questions. Feel free to ask if you need furthre information.

    ALSO: Helpful ideas on how to improve the circuit would be GREATLY appreciated!
     
    MrChips likes this.
  5. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
    Hello,

    Its nice to have a transmitter, but how do the receivers look like.

    Bertus
     
  6. Renbo

    Thread Starter Member

    Apr 12, 2009
    15
    2
    As it is, the build in on a proto board / EASYdsPIC6 dev board and messy desk. Once I am happy with the circuit, I will order out a few custom etched PCBs and do it up right. One for the home, one for the car, and a spare.

    [​IMG]
     
  7. Renbo

    Thread Starter Member

    Apr 12, 2009
    15
    2
    The receivers are off-the-shelf PetSafe collars. They are working fine, and would probably be beyond my own DIY capability.

    One such receiver: http://www.amazon.com/PetSafe-Extra-Collar-Wireless-Containment/dp/B000A09C4K

    One thing to keep in mind! I just checked that collar, and I am not sure it works exactly the same way as the ones I have. It appears that there are 2 types of system they sell.

    One system emits a radio signal from a central station, and the collar appears to be programmed to go off when it LEAVES the transmission area. This type is NOT what my transmitter replaces.

    The second system works with a buried wire around the perimeter of the yard, and the collar reacts when it ENTERS the transmitted field by approaching the wire. This type IS what my transmitter replaces.


    Here is a link to the actual PetSafe in-ground system that my little transmitter works with: http://www.petsafe.net/fencing/in-ground-fences



    <whew>
     
    Last edited: Sep 11, 2013
  8. wayneh

    Expert

    Sep 9, 2010
    12,155
    3,061
    That's correct - it's a way to avoid the wire and thus be "portable". My friend has both systems. The in-ground wire has been a headache even though I built her a break detector (in completed projects). The cable company sliced her wire and chose to buy her the portable system instead of fixing the wire.
     
  9. Renbo

    Thread Starter Member

    Apr 12, 2009
    15
    2
    Yes, the buried wire can be a MAJOR pain. Unfortunately in my case I have a yard that is very long and narrow, and would be hard to get covered with the wireless version. I also hope to use the new transmitter to create forbidden zones like the car, which would only be possible with a system that sets the collar off when it nears a boundary wire.
     
  10. MrChips

    Moderator

    Oct 2, 2009
    12,451
    3,371
    Thanks for the explanation.

    In All About Circuits we are interested in solutions to problems regardless of whether or not we have a personal need to implement the solution.
     
  11. Renbo

    Thread Starter Member

    Apr 12, 2009
    15
    2
    I am working on a PCB layout for this project using ExpressPCB and targetting their budget MiniBoard size which is 3.8" x 2.5". If anyone sees any problems with the way I laid things out, let me know! This is my first time!

    [​IMG]
     
  12. Renbo

    Thread Starter Member

    Apr 12, 2009
    15
    2
    The "Poor Man's Pet Containment System Transmitter" project is complete. Here's a picture of the PCB that came from ExpressPCB:

    [​IMG]

    And here's a picture of the completed unit in operation:

    [​IMG]

    The 1000uF caps I used were probably WAY too much overkill for what was actually required. I think they might be more useful for the one I end up putting in the noisy electrical environment of the car.

    The sole connector is the female equivalent to a PCI-Express power port. I harvested a PCI Express power cable from a dead power supply and figured that would make a good way to connect into the unit.

    The heat-sinked power regulator does get warm, but doesn't seem to be having any problems. I used leftover motherboard stand-offs as the nuts for the heat sinks, and regular screws from PC builds for the screws.

    I have no chassis for this thing, so I just drywall screwed it to some studs in the basement near where the dog wire loop exits the house.

    I messed up and electrically wired the "Strength" trimmer backwards, so it gets more powerful as you turn it counter-clockwise.

    The 1-4 LEDs just race back and forth, I suppose a decent indicator that the program loop is operational and interrupts are being hit.

    Normally the "Loop" LEDshould be on, and the "Fault" LED off, as shown. If oscillation fails, the "Fault" LED lights. If the loop looses continuity, the green LED goes out.

    The PC Board is the "MiniBoard PRO" from ExpressPCB, and is 2.5" x 3.8".

    My very first ordered PC Board, and it works!
     
  13. wayneh

    Expert

    Sep 9, 2010
    12,155
    3,061
    Awesome! Looks better than some "store bought" stuff.
     
    Renbo likes this.
  14. gcooper

    New Member

    Aug 6, 2014
    7
    2
    Yes, I know this is an old thread, but I just found it. In hopes that the author is still around...

    1) Thanks. After having several failures from lightning hits (current traveled from the wire loop to the AC mains) I'd decided to build my own as well. Your article lets me proceed with the firmware coding without waiting for the (ordered) replacement to reverse engineer the signaling.

    2) Can you advise where you found the FCC test docs you mentioned? I have the patent, but I suspect the FCC filings provide more detailed signaling info.

    3) This MAY be a problem with my browser, but: on your schematic, I can see no visual difference between lines that cross unconnected and lines that cross and ARE connected. An example is where the ends of R9 and R10 cross the 5V supply to the op amp. These are obviously tied to that 5V signal (as shown in the PCB). This area looks identical to where the line to the reset switch crosses the RB2 and RB3 lines, and does not connect to those signals. Was this circuit drawn with Express PCB?

    4) Now that your circuit has been in use for about a year, have you had any problems with it?

    Thanks again,
    Gerald
     
  15. Renbo

    Thread Starter Member

    Apr 12, 2009
    15
    2
    Still here :)

    No problemo

    I forget where I found it, but I have attached the FCC test report which includes the detected wave patterns emitted from the unit. This is what I used to bake my firmware.

    Yes, I used express PCB. And I used the cheapo mini board service. I will also attach a zip file with the files you can use with that software. Note that the transformer was hand made, and I forget the number of wire wraps. You might have to experiment with different values for C1 depending on the characteristics of the coil you wrap and the length of your buried wire.

    I originally built out 2 of the 3 boards I ordered. I intended one to go into a car as a way to train the dogs to stay away from vehicles (a problem with our dogs).

    Never got around to mounting the car one.

    About a month or 2 ago we had a rather nasty storm that caused all sorts of overvoltage/undervoltage/blackout spurts. That was what finally nuked the unit. I grabbed the other unit, swapped it out, and it's humming along. Haven't figured what broke on the first unit yet, whether it be from some sort of electrical back surge from the buried wire, or from the home electrical fluctuations.

    Another note: I noticed that the voltage regulator I used would get decently hot, so I bolted on a larger heat sink. Might want to watch that.

    Yet another note: The dsPIC30F2012 was programmed using a dev board, then popped out and seated on the board. The board has no ICSP headers, so if you plan on programming that way you might need to rethink the PCB layout and such.
     
  16. Renbo

    Thread Starter Member

    Apr 12, 2009
    15
    2
    One last note, the PCB I had made had the pins for the reset switch incorrectly laid out, so I just left off the switch and if I needed to reset, just unplugged the unit for a sec, then plugged it back in.
     
  17. MrChips

    Moderator

    Oct 2, 2009
    12,451
    3,371
    Wow! Glad you're still here. I guess subscribe works real good!
     
  18. gcooper

    New Member

    Aug 6, 2014
    7
    2
    Thanks for the quick response.

    I've lost a couple of these transmitters to lightning as well. Like you, I have a microprocessor environment handy, and this is an irresistible target for one of my existing ATXMEGA32E5 boards.

    I used PCB Express a few times: I thought I recognized their schematic capture format. I eventually moved to Diptrace, and now use DirtyPCBs for boards. I've run a few orders through them. They are slow but 10/$14 including shipping is a good price, and the quality is quite good.

    Thanks again for a very informative write-up, with good photography. And the FCC test data was a major find.

    I'll let you guys know how mine works out.
     
  19. mwe

    New Member

    Aug 6, 2014
    2
    0
    I am waiting with baited breath... I could use one of these also. If you want gcooper I will lay out a board after you get it sorted.
     
  20. gcooper

    New Member

    Aug 6, 2014
    7
    2
    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.
     
    Renbo and wayneh like this.
Loading...