loading
Picture of PetSafe Pet Barrier Transmitter

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.

 
Remove these adsRemove these ads by Signing Up

Step 1: Background

Picture of Background
oscope original transmitter.jpg
oscope original transmitter closeup.jpg
soundcard transmitter with plug.jpg
soundcard transmitter screenshot.gif
12-year-old-soldering transmitter.jpg
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?

Step 2: Getting Started

Picture of Getting Started
parts needed to build transmitter 2.jpg
Skill Set needed:
To build this, you should have a basic idea of how resistors and capacitors work. You should be comfortable using a multimeter to measure voltage and continuity, and have some experience soldering through-hole components on perf board. (This circuit really needs to be soldered to be reliable. A solderless breadboard isn't going to cut it.)

Theory of Operation:
We are, in essence, building two of this circuit. Our only significant change is that one of our circuits will feed its output to the reset pin (pin 4) of the other. This turns the other circuit on and off. By turning the circuit on and off we can pulse the frequency.

Materials (all available from Jameco's materials provided for Build Night unless otherwise noted):
 - 2 555 ICs
- 1 perf board with .1" grid cut to 1.5" x 1.1" (That's 15 holes on one side, 11 on the other. I cut up this stuff)
- 3 1K resistors
- 1 5.6K resistor
- 2 100 Ohm resistors
- 1 10uF capacitor (anything bigger than 1uF should be fine)
- 1 .1uF capacitor
- 1 .01uF capacitor
- 500K trim pot (I used this)
- 9V power source (Jameco provided 9V batteries and battery snaps, but since I want to leave this on continually I used an AC adapter from a discarded set of computer speakers instead.)
- wire

If you want a box and some nice plugs/jacks to give your project a finished look, here's some more materials you might also consider:
- DC Jack
- RCA plug
- RCA jack
- project box

Tools:
- soldering iron and solder
- multimeter
- drill (if you want to use a project box)
- some decent music (not that stuff you usually listen to)

Step 3: Schematic

Picture of Schematic
Technically you don't need to look at this schematic to build the board. However, if you want to understand what is going on, improve the design, or you need to troubleshoot, it's pretty handy.

A few notes:
 - As mentioned before parts decisions were based on what was available from the Jameco kit for August Instructables Build night.
 - The schematic and board layout were done in Eagle (free version).
 - R2 and R7 are in parallel to dissipate heat. A 47 Ohm resistor could replace these if it were 1/2 watt. Or use a 47 Ohm 1/4 watt and take your chances. :-)
 - R3 and R4 could be replaced with one 6.8K resistor

Step 4: PCB Perf Board layout

Picture of PCB Perf Board layout
555 instructables 1 pcb inverted colors.gif
555 instructables 1 pcb inverted colors flipped.gif
A few notes about the board:
 - Besides providing a screenshot of the board, I provide one with inverted colors (easier on ink if you print it) and one that is flipped (easier to trace stuff when looking at the back side of the board).
 - The grid shown is set to .1", exactly the distance of the holes on the perf board
 - Blue traces need insulated wire because they cross other wire.
 - R2 and R7 get a bit warm, so they are spaced a bit away from the other components to help reduce frequency drift.

Nervous to build this? Read on...

Step 5: Perf Board Construction

Picture of Perf Board Construction
9649767135_354408c19a_o.jpg
9649768725_f0a1f3fc73_o.jpg
If you are comfortable populating boards,skip this step and get to soldering! If you want more instruction though, here are the directions I used with my 12-year-old friend so he could put his together:

Soldering tips: 

- Keep your tip clean. Make sure your sponge is wet and you continually clean the solder tip with the sponge.
- Tin the soldering tip before applying solder
- Get the iron hot enough to melt the solder but no hotter. If the tip is turning blue, it's too hot.
- Tape the board and components with masking tape as needed to hold the board and parts in place as you solder. Taping legs as you solder them can help a lot too.
- Work on top of a scrap piece of wood.

Populating the board:

("right" and "left" in the directions below assume that you are looking at the front of the board where the components go)

1. tack the 555s on the board. Put just enough solder on the pins to hold the 555s in place. Make sure you get the orientation of the 555s right (match the orientation of the crescent between the PCB printout and the physical chip.)

2. Tack the 500k potentiometer on the board.

3. Insert C3 and solder right  leg to pin 1 of U$2. Cut the excess leg length.

4. Solder the other leg of C3 to pins 2 and 6 of U$1. Then bend the leg to reach the middle pin of the potentiometer and solder. Cut the excess length.

5. Insert C1 (make sure you get the orientation right) and solder lower leg to pin 1 of U$1 and the outer leg of C2. Cut excess.

6. Bend other leg of C1 to edge of board just to get it out of the way. We'll save that for later.

7. Insert C2 and solder upper leg to pins 2 and 6 of U$2. Cut excess.

8. Insert R2 and R7. Use the legs of R7 to connect to R2. Cut excess length.

9. Connect the other leg of C2 to the right leg of R2. You can use the leg of either R2 or C2 to connect the two. Cut excess lengths of both legs.

10. Insert R3 and connect the upper leg of R3 to the upper leg of C2. Cut excess.

11. Insert R4 and solder the lower leg of R3 to R4. Cut excess of both legs.

12. Insert R6 and solder it's outer leg to the upper leg of R4 and pin 7 of U$2. Cut excess.

13. Solder the inner leg of R6 to pin 8 of U$2.

14. Insert R1 and connect the left leg to pin 8 of U$1 and the upper leg of C1. Cut excess.

15. Connect the right leg of R1 to the upper leg of the potentiometer. Cut excess

16. Using a leftover piece of leg from some component, solder the right leg of R1 to pin 7 of U$1.

17. Strip 1/4" off both ends of an insulated piece of wire. Using the wire, connect the right leg of R2 to pin 1 of U$2

18. Strip 1/2" off one end and 1/4" off the other. Use the 1/2" side to connect the left leg of R6 to pin 4 of U$1. Then connect the 1/4" side to pin 8 of U$2.

Step 6: Finishing up

Picture of Finishing up
9654193983_73f49c464c_o.jpg
9657425532_2fd14eaa92_o.jpg
9660028590_b54e5426b5_o.jpg
If you want, you can connect a 9V power source to Vcc and ground, connect a wire as your antenna to Sig+ and Sig- and call construction "done." However, with this much effort already put into it, wouldn't it be nice to put the whole thing in a project box and use civilized items like plugs and jacks for your antenna and power connections?

Yes it would be nice wouldn't it? Here's how my friend the 12-year-old did it in 3 steps:

1. Cut 3 insulated pieces of wire 3" each. Strip each end 1/4". Solder a wire to each of the 4 solder pads shown on the PCB diagram.

2. Drill holes in the box for the jacks. Screw the jacks in the holes.

3. Solder the 4 wires to the appropriate connections on the jacks.

We also soldered up a loop of wire as a test antenna onto an RCA plug.

Step 7: Testing/Tweaking

Picture of Testing/Tweaking
For the less experienced, here are some suggestions before plugging the transmitter in:
 - Triple check all your connections with a continuity tester. Make sure neighboring pins that aren't supposed to be connected don't have solder bridges connecting them.
 - Triple check your polarity. The 555s will die if hooked up backwards. Don't ask me how I know this. :-)
 - If possible, use a current-limited power source until you are sure the circuit works correctly.

After you are sure everything is as it should be, power up the circuit with a 9V adapter and plug your test wire in. Place a shock collar near the test wire and slowly turn the potentiometer back and forth until you hear the collar clicking. From there you can fiddle with the potentiometer until you have the maximum range for all of your collars, and that they give warnings and shocks.

Note that the frequency of the circuit tends to drift, especially when first turned on. After verifying that the circuit works, leave it on for 5-10 minutes before finally tweaking the potentiometer to its permanent position.

Step 8: Making the antenna

Picture of Making the antenna
The antenna can be any size or shape you wish and mounted to anything you wish, provided it is a closed-loop wire. Here's an example of the antenna we made to slip behind the seat of our couch. You can check out how it works in the video at the beginning of this Instructable.

Step 9: Troubleshooting

Picture of Troubleshooting
Troubleshooting is tough without an oscilloscope. If you don't have one, I strongly recommend the Syscomp CGR-101. For $200 you can't beat it. You can also build an oscilloscope adequate for testing this circuit using your sound and a couple of resistors. Free software for this, such as xoscope, is available online.

When testing, test each 555 circuit independently. First confirm that the 555s are getting power. Then check if U$1 is outputting a pulse: if you don't have an oscilloscope you might check this by putting an LED in series with a resistor between pin 3 of U$1 and GND. If you do have an oscilloscope, put your probe on pin 3 and adjust the potentiometer so that the period is 36 mS. Then check U$2 similarly.

If either 555 is outputting the wrong frequencies, look for open connections. Some better multimeters can tell you frequencies. Otherwise, without an oscilloscope or substitute, you can't check this. Sorry, bud. :-(

Good luck and let us know if you have questions, clever additions, or other good problem-solving techniques.

nate64724 months ago
can I have this made for me?
Misant7771 year ago

Hey guys,

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?

If I need to build an amp, would a 2n2222 common emitter transistor amp like this one work?

http://www.ecircuitcenter.com/Circuits/trce/trce.h...

Or would I need something more along the lines of a fast power transistor?

Also,
is there any chance anyone knows how PetSafe's "YardMax" system
functions? If the dog runs through the boundary, it continues the
correction for a short period of time, or until the dog returns to the
safe area. Is this a change in collar design only, or is the transmitter
also different?

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.

I have since created my own instructable showing this circuit:

http://www.instructables.com/id/Arduino-PetSafe-Ca...

crazy1gadgets made it!1 year ago

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.

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.

Here is the code:

/*

* Astable multivibrator signal emulator

* for PetSafe fence

*/

#include "TimerOne.h"

void setup()

{

pinMode(9, OUTPUT);

Timer1.initialize(95.2); // initialize timer1, and set a 95.2us second period (10.5KHz)

}

// the loop routine runs over and over again forever:

void loop()

{

Timer1.pwm(9, 512); // setup pwm on pin 9, 50% duty cycle

delay(18); // wait for 18ms

digitalWrite(9, LOW); // turn the LED off by making the voltage LOW

delay(18); // wait for 18ms

}

2014-04-17 12.49.00.jpg2014-04-17 12.49.07.jpg

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.

whyameye (author)  crazy1gadgets1 year ago
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.
whyameye (author)  whyameye1 year ago

I'm curious if you tried leaving out the NPN. My guess is that the pin doesn't offer enough current without it?

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.

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.

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.

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?

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.

whyameye (author)  crazy1gadgets1 year ago

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.

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.

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.

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.

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 "fence" to see if that works better. I will keep you posted.

hi just wondering if this could be used as a garden fence solution? Many thanks

whyameye (author)  gabrieldillon1 year ago

Seems like it could work as a garden fence solution. If you try it, let us know and post your results! :-)

I don't need one myself, but may I say BRAVO.
The genius is in the simplicity.
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)
whyameye (author)  HelmutHound1 year ago
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!