DIY Perimeter Wire Generator and Sensor | RobotShop Community

Hi, really excited to see this kit can now be bought from you, that’ll make a big difference, I expect I’ll be ordering very soon! One question - how would you use this, either as it is, or modified, to allow the robot to follow the wire back to the base station for charging? I’ve seen some designs that allow the robot mower to know which direction to follow along the wire, but wasn’t sure if it was possible with this or not.

@Iain This is feasible with the perimeter wire generator and sensor boards but will come largely to how you will program the controller. Since the sensor board provide 2 x analog signals which its strength depend on the distance between the wire loop and the inductance (closer the inductance to the wire, stronger the output analog signal from the sensor board). The code/algorithm used to follow the wire loop would be very similar to the one used on line following robots using analog line following sensors (for example, the DFRobotShop Rover Line Follower Sensor with an example Arduino code here). The perimeter wire generator and sensor boards alone won’t be able to detect a direction but I guess this won’t be necessary since the robot will be following a loop, therefore any direction will get it to the generator board anyways (where the base station can be placed).

Thanks a lot @brahim

I understand that the theoretical length to the perimeter wire can go to about 800 feet. What is the best course of action if I have a farm that has about two acres of land and I would like a robotic lawnmower to follow a specific pattern which might take the total distance beyond the theoretical maximum? I was thinking of a simple amplifier, but you also mentioned the self inductive reactance of being simply a long wire. Should I need a repeater instead? Do you recommend a good design for that application? Thanks for the good work!

@David Thank you. We apologize as we don’t have yet a ready-to-use solution that can work for this DIY generator and sensor boards to increase the total length of the perimeter wire. Correct, this design has its limits and self inductance of the wire will have an important effect on the generator output wave if the wire length is longer than maximum. You can probably find more advanced (therefore, more expensive) designs online to allow longer perimeter wire.

Given that we have literally hundreds of unused arduinos sitting around is it possible to just use an arduino to create the signal on a loop? e.g. basically using a blink sketch or might need to manipulate the timer bits directly - any reason that wouldn’t work?

Also, so in the commercial invisible dog fence system they can alter the size/width of the detectable zone - what is it that’s being increased/decreased on those systems? Would we need to run the output from the 555 circuit (or the Arduino hack I mentioned above) into a transistor/amplifier to feed a variable voltage onto the perimeter wire? would that also be essentially the solution to David Ho’s question? Does higher voltage overcome, or at least extend, the distance limitation?

Thanks for the really great article!! I’ve been looking for something like this that explains the basics for at least a couple of years.

@John Ringer Appreciate the feedback. Quite a few of your questions would require some experimentation (don’t have enough time at the moment but nevertheless interested) - would you be interested in giving some of your hypotheses a try and telling us how they went? The kit we put up for sale is really inexpensive and is not soldered, so it should give you a good head start to mess with components on a breadboard. Brahim will provide additional insight shortly.

I just finished soldering up the two boards of the kit you sent me and now am beginning to test. I so far have noticed that the transmitter when connected to a 12V car battery and only using the short black wire for the loop that the large 47 ohm resistor gets hot. Will it be cooler when a 75 loop is connected?
Also, I would like to use an ESP32 (3.3V) rather than a 5V Arduino. Will the receiver work with a 3.3V connection and return a proportional signal between 0 and 3V. If not I’ll run the receiver from 5V and use a voltage divider to connect to the analog pin of the ESP32.

@Larry It is normal that the 47 Ohms resistor gets hot. The 47 Ohms resistor that comes with the RobotShop Perimeter Wire Generator and Sensor Soldering Kit is rated for 2 Watts power. Attaching the loop cable will normally get the output resistor hotter as the NE555 output current will increase.
For example, if the NE555 output current is at maximum (200mA) and you are using 75’ of 22AWG cable (16.14 Ohms per 1000’), the resistance of the 75’ 22AWG cable would be around 1.2 Ohms, the power dissipated by the output resistor would be around 1.95 Watts. If you are planning to use longer loop cable and the resistor gets excessively hot (and the power dissipated is beyond the resistor’s rated power), we suggest you to replace the output resistor with a 47 Ohms through hole resistor with higher power rating (for example 3 Watts or 5 Watts).
The supply voltage for the 324N Amplifier could be from 3V to 30V. Therefore, 3.3V on the receiver should work. However, if the receiver detection performances decrease, we suggest you to power it 5V and use a voltage divider on output signal pins to convert the 0-5V signal to 0-3.3V (with, for example, a 10K and 20K resistors).

@John An Arduino board alone won’t be able to drive a strong square wave signal through the loop wire enough for the signal to be detected with the LC circuit. Note that an Arduino digital pin is rated for an absolute maximum current of 40mA (at 5V). A possible solution to use an Arduino board is to interface it with a Motor Driver as amplifier (as explained in this article)

I see several problems with the receiver circuit. The first problem has to do with the limited bandwidth of the LM324N op-amp. At over 30kHz I am pretty sure that setting the gain of the non-inverted amplifier to 101 (1e6/10e3+1) is pretty much useless. I’ll guess from the LM324N’s datasheet that an open loop gain of 20dB is the maximum you can achieve for the used frequency; then the calculation goes as 20dB=20*log10(A), from which the maximum gain A is calculated as just 10 for about 30kHz! The second problem is related to the input offset voltage of the LM324N which could be as much as 9 mV but typically around 2 mV. After the first amplification stage that offset is amplified to say 0.2V (at DC the effective gain is still 101!). After the second stage the 0.2 is then amplified to “20V”; of course that doesn’t happen because the op-amp saturates first. A high pass filter is required between the first and second stage in order to remove any DC coming from the first stage. A simple RC circuit will do. Also, since the amplitude of the detected sine wave is the only thing we are interested in, why not “peak detect” it using a diode (preferably a Schottky diode) together with a resistor and capacitor in parallel? Finally, the LM324N powered with a single power supply doen’s “like” large negative voltages at the non-inverting input at all. But that depends on the kind of output you get from the tank circuit.

@JCF Thank you for your feedback and your thorough analysis of the receiver board. We agree that the receiver circuit could be improved in many ways, adding a “peak detect” circuit with a diode, resistor and capacitor is an option. Our objective with the receiver and generator boards was to keep it really simple and within 34mm x 24mm PCB. Regarding your note about the gain, from Figure 5. Open-Loop Frequency Response at page 8 of the LM324N Op-Amp, the lower curve of the hysteresis corresponds to about 35dB and the higher curve of the hysteresis corresponds to about 40dB, therefore the gain will vary from 56 to 100. Two stages amplification with the LM324N would be sufficient to detect a “signal” from the perimeter wire on the Arduino analog inputs even if the amplifer saturates at the second stage.

OK - so I have this soldered up, but am finding two problems:

  1. Sometimes it doesn’t give any response on the pin read (either zero, or low numbers, regardless of how near it is to the wire) - I guess this is poor soldering and something loose, but I’m not sure.
  2. On the times when it does pick up the wire, the numbers are quite erratic, even with the sensor in a constant position relative to the wire.

Can you give me any ideas of how to diagnose / solve these issues? This is my first project like this, and while I’m really comfortable with the coding of the project, the electronics is a leap into the unknown for me!

Thanks a lot :slight_smile:

@iain-6 Here is some things you might want to try to resolve/troubleshoot the issue :

  1. Verify that all the components are correctly soldered with a continuity test using a multimeter.
  2. Verify the generator output frequency. This frequency can be varied by the potentiometer and should be as close as possible to 34 Khz to match the tank circuit’s resonance frequency. You can monitor the generator’s frequency by using an oscilloscope, probing one end of the perimeter wire cable (while the other end of the cable is connected to the generator circuit output) and connecting the oscilloscope probe’s ground to the generator’s GND. You can keep the coil at a fixed distance from the loop cable while varying the generator frequency potentiometer to obtain the best results.
  3. Verify that the inductances are oriented correctly on the perimeter cable. The inductors longitudinal axis should be perpendicular to the perimeter wire axis.
  4. Also, confirm if the generator’s power supply is between 12V-15V with at least 500mA current rating

Why we use C2 and C5 ?!

I have had problems with a faulty receiver board in a Zucchetti Evolution robot mower and needed to investigate the system. The transmitter sends a very complex waveform from the so called harmonic generator which when picked up by the mower’s antenna is being seen as an audio frequency. The audio frequency varies depending on the mowers position along the perimeter wire. At the start its 7.83KHz and at the end 7.81KHz. The system seems to depend on the mower self calibrating itself at the start of the wire. I will enclose my oscilloscope traces (from a 10MHz bandwith PicoScope system) if I am allowed to.

@Esraa C2 and C5 are decoupling capacitors used to eliminate high frequency noise (voltage ripples)

If i used a 22AWG wire with 1000 meter length and its resistance is 52 ohm, can i replace the output resistor from 47 ohm to 10 ohm?!

@Esraa We are not sure that a 22AWG 1000 meters (about 3280’) loop cable will work properly with this generator circuit as the self inductance of a 1000 meters 22AWG cable is relatively important (about 0.00298H), therefore the inductive reactance at 34KHz would be around 636Ohms and this will badly affect the generator’s square wave signal. You can test it and let us know if it works but make sure that the 10Ohms output resistor has an appropriate power rating (at least 3Watts) and be careful where to put it as the resistor will get hot.

Hello bdaouas. well can this theory can be used to get our robot to follow/Track the perimeter wire and get back to its charging station? your help would be appreciated.