Most pet owners are familiar with the concept of a wireless pet containment system: the animal wears a "shock" collar; when the animal is too near an antenna of a transmitter, the animal gets warned with a vibration or beep, then shocked. Typically, the antenna to the transmitter outlines the perimeter of a yard --- an underground fence. If a pet owner also wants to keep an animal out of a certain area in the house, perhaps off a piece of furniture, they can buy an indoor transmitter as well. However, most pet owners do not do this:
1. The transmitter is expensive
2. The circular pattern of transmission for the indoor transmitter is often not appropriate for the area of containment. How would you use one transmitter to keep an animal off a couch while allowing them around the couch, for example?
3. The thing is big, ugly, and in the way. Where can you put it that will be convenient for you and still will outline the area of containment?

Ready for some good news? We can make our own transmitter, completely compatible with PetSafe collars but smaller than PetSafe's, with an antenna that can be any shape or size, for under $5! Our transmitter can serve as a replacement for an outdoor or an indoor system. And if you are ready for a break from the Arduino and friends I have more good news: we don't need a microcontroller. This can all be done with a couple of 555 timer ICs (available literally everywhere, including Radio Shack, Jameco, and All Electronics) and some supporting passive components. There's no code to write. You can build this thing without ever going near your computer (assuming you have a way to read this and surf the web without a computer.) And you can have the satisfaction of knowing you built the magical transmitter yourself.

Step 1: Background

Before we get too deep into making this thing, how about a high-level overview of how the thing works and why I created the transmitter the way I did? If you just want to just get to building, skip this step. My feelings won't be hurt.

This project was born out of Instructables/Jameco August Build Night. As you can see from the link, Makerspaces such as our Wichita-based MakeICT were challenged to host a Build Night focusing on using materials Jameco sent. After the Build Night we were encouraged to post instructables sharing what we built with these materials. The only IC we were given was the 555. Surprisingly, Jameco didn't provide any Cray Computers. They didn't provide microcontrollers either. There weren't even any 556s in the bag (2 555s in the same package). Besides the 555s, Jameco gave us a decent supply of resistors and a whole bunch of random passive components.

Just a week or two before our Build Night, a friend and I were lamenting that there still wasn't a good solution for keeping her dogs off the furniture. Sure there are products like The SofaScram Mat, but they are less than ideal. If you use this mat, for example, you either deal with the hassle of taking the mat off and on the sofa or, more likely, you leave the mat on the sofa for eternity so the sofa doesn't get used ever by anybody, animal or human. What a waste. Might as well let the dog use it then. And what about when guests just show up? Are you seriously supposed to instantly remember that the mat is there? Or do you just let your guests sit on the sofa, mat and all, and let the resulting loud beep freak them out? I'll bet your dog would think that was funny.

So that got me wondering about my wireless fence transmitter. "How do you work?" I asked it. When it didn't answer I used an oscilloscope to take a look at its output. I saw that it transmitted a pulsing a sinusoidal wave at about 10.5K Hz. The wave pulsed every 36mS.

This pulsed wave seemed like a simple thing to emulate using a sound card, so I took my favorite programming weapon of choice and wrote a patch (see couchAway.pd below) to confirm that a simple pulsed wave could trigger a dog collar. Yep, it did. Experimenting with the patch, I found any frequency between 9K and 12K worked, but the pulsing needed to be almost exactly 36mS. Much variance from that, and the collar would not consistently work.

We could call this project "done" at this point: if you have an old computer with a sound card around, you can turn it into a transmitter now with my patch, wire for an antenna, a resistor and an 1/8" plug (see pic below). It works well and consistently. You could also give a Raspberry Pi the job and still end up saving serious dough over PetSafe's transmitter. But seriously, are you going to waste a computer like that? It's like using a Ferrari to go to the grocery store. Not cool. Let's move on, shall we?

A pulsed wave can be thought of as 2 waves: one wave is used to turn another one on and off. Electrical Engineers call circuits that make waves astable multivibrators and a quick Google search verifies that the 555 is at home as diva for the design of an astable multivibrator. So when I saw the Instructables/Jameco challenge to build something cool given 555s and some passive components, the collar transmitter seemed like a good fit.

Please note that I do not advocate this solution as the best or most efficient way to build a wireless collar transmitter. For example, it's silly to use 2 555s when you can use a 556. (The Jameco kit didn't have 556s.) Also, the RC circuits that govern the frequency of the waves in this 555 circuit do drift a bit, and this could be a problem, especially if the transmitter is kept outside where temperature fluctuates. A more robust solution might be to use a microcontroller. Also, in the circuit I sometimes put 2 resistors in series or parallel instead of using only 1 resistor. This was so I could use only resistor values and ratings given in Jameco's assorted resistor kit. So feel free to build as is, tweak, improve...or just resurrect that old 386 in your garage and use its sound card. If you do build this as is though, you can feel good about having built something that PetSafe sells for over $60. And you did it using only a couple of 25-cent ICs. Cool, eh?

If you think this project is too difficult for you, also know that this makes you bested by a 12-year-old; I had a kid build this transmitter successfully using these directions. Now that I have shamed you...are you ready to get started?
<p>I have a young cat that is terrorizing my old cat. I want to put the &quot;fence&quot; in the collar of the old cat. This will have to run from a 9v battery. Any idea how much power the &quot;fence&quot; would use in these circumstances? If the battery lasts a few days that might be adequate. I'll put up with changing the battery for a few weeks and by then the young cat should be trained to avoid the old cat.</p>
<p>Hello, I have a question for anyone who really knows the RF principles at play. My dogs chew the PetSafe collars off of one another. I made a collar out of metal strapping (the kind with alternating large and small holes) and wrapped it in duct tape to make it look better and be more comfortable. I attach it to the dog with a lock nut and short bolt through the large strapping holes. PetSafe says intermittent signal disruption could occur but I just tested it a dozen times over the wire in different orientations and no problems. Why, EXACTLY, is a metal collar a problem?</p>
<p>(btw it is a YardMax system... different than traditional signal?)</p>
<p>Hay JohnM281, I had the same problem with the dogs chewing off the collars. I accidently found the solution. I bought some small metal studs to use on the nylon collars. While I waited for them to come, I took a soldering gun and burnt my phone number on the collars, in big numbers.</p><p> Seems the dogs did not like the feel of the rough burned areas in their mouths. Problem solved. :-) But they still chewed the plastic shock box. So I hot glued a couple of the metal studs to them and that took care of the chewing.</p>
Way over my head. Can you build this for me for a price. Worth $200 to me.
<p>This didn't seem to work for me. I've attached a screenshot of the waveform from the Petsafe transmitter and from the circuit I've built. Any help would be awesome.</p><p>Transmitter: </p><p><a href="http://postimg.org/image/sgilc19fl/" rel="nofollow">http://postimg.org/image/sgilc19fl/</a></p><p>Custom circuit:<br></p><p><a href="http://postimg.org/image/5t3c5vtvl/" rel="nofollow">http://postimg.org/image/5t3c5vtvl/</a></p>
<p>I made this and it worked. I can now leave my croc shoes anywhere and Bandit will not touch then. I would like to get more distance away from the wire if possible. The range now is only about 18&quot; away. I would like to get 15 or 20 feet. Bandit runs back and forth in front of the car when we drive up the driveway. if I could get this range I could stop this. Could anybody please tell me how to do this.</p><p>anand forth </p>
<p>looking to build ( or buy ) a transmitter that will send the same signal as an electric invisible dog fence. In effect, I'd like to be able to use the fence collar as an anti-bark collar. First, is this possible and, secondly, can an amatuer accomplish it?</p>
<p>Hi,</p><p>He mentioned to use a 556 if you are looking to have a transmitter collar. Can someone design and build for me (willing to pay)? I would like to see if it is possible to keep two animals AWAY from each other. Obviously small size and last for days is ideal.</p>
<p>Look at this option and the arduino option can someone tell me why someone would go with the arduino over the 555 circuits? I have heard about drift possibly with this one but technically shouldn't this do the same thing? Will this circuit really drift off of the needed frequency over time?</p>
<p>Also looking for someone to build a smaller version powered by a watch battery that I can put on another dog's collar to trigger a shock if the dog wearing the pet safe receiver tries to bite the dog wearing the transmitter. Of course I will pay for this. Please contact me at telecastg at gmail dot com</p>
<p>Looking for someone to help me make this &quot;Pet Barrier Transmitter&quot;, but smaller. I will pay. You need to be in Maryland, preferably Baltimore or Harford County. I can be reached at auditt4mark@aol.com. Thanks, Mark</p>
can I have this made for me?
<p>Hey guys,</p><p>This is a great project and I really like the arduino approach also, but I'm wondering: If I'm wanting to run this through about 1,000 feet of 20 gauge solid core wire, will I have to build an amplifier, or should it be ok on it's own? </p><p>If I need to build an amp, would a 2n2222 common emitter transistor amp like this one work?</p><p><a href="http://www.ecircuitcenter.com/Circuits/trce/trce.htm" rel="nofollow">http://www.ecircuitcenter.com/Circuits/trce/trce.h...</a></p><p>Or would I need something more along the lines of a fast power transistor?</p><p>Also, <br> is there any chance anyone knows how PetSafe's &quot;YardMax&quot; system <br>functions? If the dog runs through the boundary, it continues the <br>correction for a short period of time, or until the dog returns to the <br>safe area. Is this a change in collar design only, or is the transmitter <br> also different?</p>
<p>I would just up the voltage on your loop. Since the added length of wire is just like adding an extra resistance in series, I should thing raising the voltage to 9 or 12VDC should do a lot to enhance the signal. See my additional uploads which include a simple circuiit diagram and another photo of my arduino version of this project.</p>
<p>I have since created my own instructable showing this circuit: </p><p><a href="https://www.instructables.com/id/Arduino-PetSafe-Cat-Barrier/" rel="nofollow">https://www.instructables.com/id/Arduino-PetSafe-Ca...</a></p>
<p>Ok, here it is. I wired up an arduino with the output NPN power transistor on pin 9, just as if I were wiring up a basic LED blinking circuit, then wired a 100 ohm resistor in parallel with the output load wire loop. Powered with a 9V battery. </p><p>I used the arduino timer1.pwm routine to generate the 10.5KHz durin the onpulse, and a loop with 18ms on / 18ms off for the 36 ms pulse carrier wave. This emulates the astable multivibrator circuit you created with your 555 circuit. </p><p>Here is the code:</p><p> /*</p><p> * Astable multivibrator signal emulator</p><p> * for PetSafe fence </p><p> */</p><p>#include &quot;TimerOne.h&quot;</p><p>void setup()</p><p>{</p><p> pinMode(9, OUTPUT);</p><p> Timer1.initialize(95.2); // initialize timer1, and set a 95.2us second period (10.5KHz)</p><p>}</p><p>// the loop routine runs over and over again forever:</p><p>void loop()</p><p>{</p><p> Timer1.pwm(9, 512); // setup pwm on pin 9, 50% duty cycle</p><p> delay(18); // wait for 18ms</p><p> digitalWrite(9, LOW); // turn the LED off by making the voltage LOW</p><p> delay(18); // wait for 18ms</p><p>} </p>
<p>What type/model transistor have you used in this? I would like to replicate but not too sure. I have the arduino and your part seems a lot easier than me cobbling together the 555 circuits above.</p>
Fantastic! You beat me to it! I'll be duplicating your setup soon. Wonderful news that it seems to work so well. I appreciate your comment letting me know and sharing the code.
<p>I'm curious if you tried leaving out the NPN. My guess is that the pin doesn't offer enough current without it?</p>
<p>Yes, it does work, and just as well. I measure about 9mA, well within the pin 9 current limit of 20mA. (FYI, I wired the 100 ohm resistor in series with the wire loop, not parallel - my error). However, I like to be safe and source resistive loads with an external power transistor. If I am running the thing all night, I would rather dissipate heat through the external transistor than the arduino board.</p><p>I don't have time to delve into this project too much. If you want to take the reigns on this and research/develop the arduino version more, it would make a good part II to your excellent instructable page.</p>
<p>A follow up. I got the PetSafe receiver device and wired up and arduino to perform the signal pulse you described. It works wonderfully! I will follow up with more detals soon. Thanks again for your fantastic instructable post.</p>
<p>I have a cat which I want to keep off our kitchen counter. This seems like a great idea. I should think this would work with the PetSafe cat receiver collars as well? What about other brands, such as Innotek? </p><p>I should think that with some tweaking, one could get it to work, what do you think. I am an engineer, so I am familiar with electronics and am pretty sure I have the parts and equipment in my shop to make this. </p>
<p>I'm only familiar with the PetSafe dog collars so I can't answer anything definitively, but I agree with you that it will likely work with the cat collars and with other brands, perhaps tweaking the frequency and the timing between the bursts. If it were me, I'd play with the Pd patch I provide to confirm all the settings, then build the circuit tweaked for those settings.</p><p>Arduino clones are so cheap now --- it seems easiest and more robust to perhaps build the transmitter with one of those instead of the circuit I outline. I'll be trying that within the next few weeks and let you know how it goes.</p><p>BTW if your cat gets on the counter only when you aren't home/around, you might just connect a motion sensor to an alarm.</p>
<p>Thanks for your quick reply. I have ordered the PetSafe Cat collar online and will be testing it with an Arduino PWM circuit as you suggested. I have a 'scope so I will be able to tweak it to spec pretty easily, I think.</p><p>I had thought about the motion sensor, but the cat still does jump on the counter when we are around (albeit less than when not around, i am sure). I also wanted to try something a bit more localized, as the counter stretches around corners and into the other room. I may yet do a motion control sensor in conjunction with the wired &quot;fence&quot; to see if that works better. I will keep you posted.</p>
<p>hi just wondering if this could be used as a garden fence solution? Many thanks</p>
<p>Seems like it could work as a garden fence solution. If you try it, let us know and post your results! :-)</p>
I don't need one myself, but may I say BRAVO. <br>The genius is in the simplicity. <br>Yes of course some ATmega 8 pin microcontroller could do this without frequency drift, but they didn't give you one! LOL! The concept implementation was great given what you had to work with though. Good thing you had more than one 555 !.
Very nice ible! What programs and applications did you use for this? (I especially like the signal / wave form displays, and the circuit board blueprint)
Circuit board and Schematic are screen shots from the free version of Eagle. I inverted the colors and flipped the image with Gimp. Wave form displays are just pics from my phone of an oscilloscope. Glad you liked the idle!

About This Instructable




Bio: I am a musician and electrical/computer engineer. I also make new media art when I can create that opportunity. I currently serve as Concertmaster ... More »
More by whyameye:Networked RGB Wi-Fi Decorative Touch Lights PetSafe Pet Barrier Transmitter 
Add instructable to: