1kHz generator - switches on and off at the rate of 1000 times per second
Loop driver - provides a high current drive for the loop (+ circuit protection)
Loop - creates an electromagnetic field
Detector (coil) - acts as an antenna to pick up the electromagnetic field and converts it back to the electric current
Amplifier - increases the weak signal picked up by the detector
Dave Hein may have a point regarding the use of higher frequencies. Also, I am wondering if it might be possible to use the 555 to drive the loop directly. It is a pretty rugged chip and can provide up to 200mA output. I would suggest trying that by laying the loop on top of the ground and then seeing what signal level you get with the sensor coils about 6 inches above the wire at different frequencies.
Good point Kwinn. I was thinking of 10-20kHz instead of 1kHz. This way the detector coils could be smaller.
It's possible not to use the driver but I'd add 2 diodes on the output. The L293D has them. Also we'd need more gain on the detector's amps that way.
I found a dual amp - INA2126. It's 1/3 the price of the single INA118. We'll get a little bit more crosstalk but I think that should not be an issue.
Is it not possible to get a voltage reading when the coils get close to the wire? If so, the idea will be to connect both side of the coil to a PBASIC CHIP to get anything over 1.4V to get a high. With the current design, you are dealing with a frequency change which means you have to somehow interpret the frequency. If I am wrong, please correct me.
The coils will pickup the electromagnetic field when they are close to the wire but the current will be weak. You need that amplifier to convert the milivolts to volts.
Are you talking about the Basic Stamp modules? I couldn't find detailed datasheets for these quickly. They look like the regular 5V micros. I'm not sure why you're saying that you'd need to get it over 1.4V. For the 5V CMOS Vih (min input high voltage) is at least 2.5V or so.
Now. The difference between the digital and analog signal detection. As I said before, I liked Kwinn's idea to use an ADC because the digital detecting will give you zigzaging when the mower will be over the cable. Let me elaborate a little more on that.
For the digital detector you will be setting the detection threshold in the hardware. If you don’t choose it right you may get into the situation when you get 0 (no signal) or 1 (signal detected) from both detectors when you're tracking the cable. In both cases your mover will zigzag. Moreover, it’s impossible to set a good threshold because it will vary with detectors' position, weather, even time…
With the ADC on the other hand, your threshold is soft. Set in the code on the micro. The loop tracking can be implemented by comparing the 2 voltage levels from each coils. If one voltage is slightly higher than the other you turn toward it hence moving it farther from the cable hence lowering the voltage level. The mower will still zigzag but if your control loop runs 1000 times a second the turns will be very minimal. That's of course if your mower will move slower than a speeding bullet…
It would be better to use an op amp that operates from one voltage and biasing it so the output is slightly higher than the forward voltage of the diode when there is no signal from the coils. For example, if the op amps run from +5VDC the op amp output would be approximately 0.7V, and after the diode it would be close to 0.0V. When the coils get close to the buried wire the positive half of the AC signal would add to the 0.7V and charge the capacitor between the diode and the ADC. The ADC would be measuring this filtered DC voltage on the capacitor. The gain of the op amp would be high enough to provide close to a 5V peak signal when the coil is right over the wire.
A wire in the ground solution you're talking about (just like the Invisible Fence for pets) would be to run an insulated wire around the perimeter of your yard and connect it to a frequency generator (e.g. 1kHz). On the lawn mower a simple unshielded inductor with an RF amplifier would do the trick. The inductor may just be a piece of transformer wire wound to form a coil. When the inductor will get close enough to the wire you'd get the same frequency on the output of the RF amplifier. A rectifier and a simple low pass filter (resistor + cap) would give you an indication that you're close to the wire. Some experimenting would be required to get the right amplitude in the wire and the gain of the amplifier. The orientation of the coil will matter too by the way.
I can foresee some problems if you have some electrical wires in the area. If so the 60Hz (50Hz) would give you the false positives. That can be alleviated by a lock-in amplifier at 1kHz or some digital frequency meter at the output of the amp.
Hope this helps...
I have seen something similar to this, but it uses three of the inductor circuits described... but only one 'wire in the ground'. It uses the three inductor circuits like QTI to determine how to navigate. Although it follows the wire.
Alex, I'm doing the wiring diagram and you have your Parallax chip with pin 15 for both your input and output:
Connect all 4 drivers together in parallel. Pins 2-7-10-15 (this is your input) and 3-6-11-15 (this is your output).
Is this correct? Also, do not understand dual power sourse for the amplifier, I thought if the mower was 24V I can lowere it to 12V. What also would you use for a common cap coupler?
I am going to post the wiring diagram on Monday. Do not have a printer.
I was thinking of a circuit more like what you had in post #65. This would make the voltage in to the adc close to the peak of (coil x op amp gain).
Yanie, the voltage driving the motors can be quite different from that going to the rest of the circuit. I would suggest going with parts that are available from parallax as much as possible. Until an op amp, adc and micro are selected it is difficult to provide concrete suggestions.
I would suggest going with the LM358 for the op amp, the MCP3208 for the adc, and the prop as the micro controller.
Some amps need a positive and a negative voltages to work right. Athough you can 'fool' them by proivding a virtual ground at 0.5 x V+ while V- is at 0V.
Yes, this is what you have to do - switch the voltage down to 12V.You will aslo have to eventually regulate it (or use another switcher) down to 5V (or 3.3V) for the micro. Choosing between an LDO or a switching regulator depends on the current drawn by the digital circuitry.
Kwinn, sorry Im a little confused. What is adc? Can you please tell me what your using for the generator, driver, and coil amp. Need help with the wiring.
I would suggest going with the LM358 for the op amp, the MCP3208 for the adc, and the prop as the micro controller.
For the LM358 you'd need more external discrete parts. At least 3 resistors and a cap. What's wrong with the INA2126?
We could use a micro that has the ADC built-in. Less things to worry about. How about a PIC or an AVR? I think a propeller would be like using a cannon to kill a fly. I use ATTiny's for tiny project like this. $2, DIP-14, 20MHz RISC. There is this nice C compiler - CodeVisionAVR. It has a built-in wizard that generates the register init code for you. As much as I like programming in assmblers, coding in C seems to be faster. Dispite of what Dunkin Donuts commertial says - "America runs on C"...
Kwinn, sorry Im a little confused. What is adc? Can you please tell me what your using for the generator, driver, and coil amp. Need help with the wiring.
With all the information I was able to understand, these are the line diagrams I made. The frequency was developed using the formulas given in the data sheet with the resistors in the data sheet example. I do not have a oscilliscope so I will need help wih the resistor in the receiver and I do not know what do use for a coupler capacitor. Any help and your overview of the diagrams will be greatly appreciated.
Here is the annotated detector schematic. The decoupling caps should be placed as close as possible to the amp chip. Use 0.1uF. Use 100uF or more for the bulk cap on the output of your 12V ps. BTW what do you use for your power supply?
Use the 50k multiturn pot for the gain setting. Once you get it right I'd suggest to remove it and put a fix value resistor. Your mower has to work outdoors and the potentiometers are sensitive to the temperature changes.
On the loop driver. We can't use 1k pullup to 12V. The max input voltage on the L293 is 7V. Since the pin 3 is a push pull output it will be close to VCC when it's high. We have to reduce it somehow. Use a simple volate divider to bring down a little. Use 2k and 1k resistors in series from pin 3 to ground. Connect the 2k to the 555 output. The other lead to 1k and to ground. Connect the L293 input where the 2k and 1k resistors connect. This will give you VCC/3. It's 4V at 12V. This should work fine.
You're missing the series resistor on the driver output.
Alex,
Your tormenting me again. Can you please finish marking the attachments with whatever I should add and please be specific on the drawings with part numbers. I am doing the best that I can, but I do feel that I am chasing a carrot in another country. Thanks
That's the thing. I can't do it for you. It's going to be your baby...
You still have a couple of decisions to make too. Did you decide on what micro you're going to use?
Kwinn brought up a good point about the diode drop. I'm waiting for him to comment while I'm toying with some ideas here.
I did what I could on the detector schematic. You could start prototyping with that. We'll get back to it once we have a better understanding of the last 10%. You're good on the loop driver though expect for the resistors. If you don't do that you're going to hear this little 'puff' 10us after you power the board up and endup replacing the dirver chip. I'd try to avoid it if possible
I am going to use a Parallax Micro as the master controller. In terms of the timer, driver or amp. I will use whatever you tell me to use. I think you said that the driver is limited to 7V. Does it make sense to use 2 - 6V batteries in series for 12V and just tie into 1 of the 2 batteries to get the 6 volts for the driver and NE 555
For the LM358 you'd need more external discrete parts. At least 3 resistors and a cap. What's wrong with the INA2126?
We could use a micro that has the ADC built-in. Less things to worry about. How about a PIC or an AVR? I think a propeller would be like using a cannon to kill a fly.
Nothing wrong with the INA2126 as long as you don't need high gain at the higher frequencies (above 10KHz). It also requires a dual power supply. One reason I suggested the LM358 is that it only requires a single supply.
As for suggesting the Propeller, this is a Parallax forum, and if Yianie needs help with his project it will be easier to come by if he is using a uC that the folks on the forum are familiar with. It is also better to have a little more cpu power than you need rather than not enough. I am sure that it will be put to good use. For one thing it would be a good idea to have sensors to detect obstacles so the mower does not run over people, pets, and other objects.
In addition both parts are available from Parallax, and with small projects shipping costs are a large percentage of the overall cost of parts so getting all the parts from one vendor can save a substantial amount of money.
IMO we don't need the optocoupler. The analog output can go directly to the ADC input.
True, the opto is not required as long as the analog input to the adc does not exceed it's maximum input voltage rating.
We're still debating what to do with the voltage drop on the diode though and/or maybe to use a single voltage rail-to-rail opamp intsead.
We could to this on the output of our instrumention amp:
A single voltage rail to rail op amp is a good idea but that particular circuit will not work. You need to connect the feedback before the diode or you get unity gain once the output of the op amp exceeds the forward voltage (~0.7V) of the diode.
I wish I had the time to provide more help but work is taking up virtually every waking minute right now. What I will try to do is to provide a block diagram with descriptions of the receiver circuitry if time permits. The details (gain, offset, etc) will need to be worked out with the actual hardware.
The Parallax Micro? What's that? Are you talking about the Propeller or Stamp modules? I just took a quick look at all of them. Unless I'm missing something none of these have ADCs. You'd need an external one.
As for the batteries I would use LiPO's. 3 cell will give you 11.1V. That's close enough. LiPOs are cheap and high capacity. Do you want to power the loop circuit with a battery too? Can't you use the AC outlet and use a 12V power supply?
Don't power the 555 chip with another voltage just put these two resistors. That's simpler.
Than again, it may be as simple as powering the whole thing with just 5V.
As far as powering up INA2126 with single supply. That's perfectly doable. We'd need a simple voltage reference chip on the REF pin. Similar to the confiuration in Figure 4 in the DS. That may actually be a really nice soultion. The ADC may sample the entire signal since it will be offset by the reference voltage. The peak detection can be done in the code just by oversimpling the input signal and doing the max seach in each period.
Now that I think about a single voltage rail-to-rail opamp could be setup the same way...
Ok, this is where I am at right now. To answer some questions, I am planning on using a stamp processer. I am hoping to detect over a 1.7V so that the parallax input will go '1' . I know going with all Parallax parts would be easier on the shipping, but someone has to tell me all the parts and how to wire the pins. Any volunteers?
The idea at this point is to modify the existing attached drawings and not really change parts at this time. Should I consider that these attachments will work?
Kwinn, this is what I was thinking in post #81 - a 0V drop diode. This still doesn't solve the dual voltage issue.
Yianie, How do you know that 1.7V is the right threshold to detect the 14kHz signal from a distance of 10 cm and at a temperature of 23 deg C?
Here is a complete schematic of a single 5V detector.
Here's an ADC you could use. http://ww1.microchip.com/downloads/en/DeviceDoc/21290e.pdf
Cheap and small. You need 2 of them. The Stamp's use PIC's so they should have an SPI controller. If it's not available on the module pins it'd be trivial to bitbang it using 4 I/O pins. I can help you with that too.
BTW, Parallax may not carry all the parts you need.
Alex, I do not know if I can get 1.7V reading on the sensor, but that is what I need as input into the pin of the Basic Controller. Sorry for asking but you refer to ADC, does this mean Amplified DC signal? Do you believe your schematic will work better than the INA 118? Can you please tell me what the REF chip does?
Comments
Loop driver - provides a high current drive for the loop (+ circuit protection)
Loop - creates an electromagnetic field
Detector (coil) - acts as an antenna to pick up the electromagnetic field and converts it back to the electric current
Amplifier - increases the weak signal picked up by the detector
It's possible not to use the driver but I'd add 2 diodes on the output. The L293D has them. Also we'd need more gain on the detector's amps that way.
I found a dual amp - INA2126. It's 1/3 the price of the single INA118. We'll get a little bit more crosstalk but I think that should not be an issue.
http://datasheets.maxim-ic.com/en/ds/ICL7662-Si7661.pdf
The only thing that worries me a little is its switching frequency. It's close to the frequency we want to detect now.
Here is the schematic update:
The coils will pickup the electromagnetic field when they are close to the wire but the current will be weak. You need that amplifier to convert the milivolts to volts.
Are you talking about the Basic Stamp modules? I couldn't find detailed datasheets for these quickly. They look like the regular 5V micros. I'm not sure why you're saying that you'd need to get it over 1.4V. For the 5V CMOS Vih (min input high voltage) is at least 2.5V or so.
Now. The difference between the digital and analog signal detection. As I said before, I liked Kwinn's idea to use an ADC because the digital detecting will give you zigzaging when the mower will be over the cable. Let me elaborate a little more on that.
For the digital detector you will be setting the detection threshold in the hardware. If you don’t choose it right you may get into the situation when you get 0 (no signal) or 1 (signal detected) from both detectors when you're tracking the cable. In both cases your mover will zigzag. Moreover, it’s impossible to set a good threshold because it will vary with detectors' position, weather, even time…
With the ADC on the other hand, your threshold is soft. Set in the code on the micro. The loop tracking can be implemented by comparing the 2 voltage levels from each coils. If one voltage is slightly higher than the other you turn toward it hence moving it farther from the cable hence lowering the voltage level. The mower will still zigzag but if your control loop runs 1000 times a second the turns will be very minimal. That's of course if your mower will move slower than a speeding bullet…
Yeah, we could use a rail-to-rail opamp. More external parts though.
Here's another idea. Power our instrumentation amp asymmetrically (+V = 12V, -V = 0V) and bias the Ref pins (5 and 12) at 12V/2 + 0.7V (or + 0.3V).
How about skipping the diode and the cap completely like this:
and add the peak detection in the code?
Just thinking out loud here...
I have seen something similar to this, but it uses three of the inductor circuits described... but only one 'wire in the ground'. It uses the three inductor circuits like QTI to determine how to navigate. Although it follows the wire.
Connect all 4 drivers together in parallel. Pins 2-7-10-15 (this is your input) and 3-6-11-15 (this is your output).
Is this correct? Also, do not understand dual power sourse for the amplifier, I thought if the mower was 24V I can lowere it to 12V. What also would you use for a common cap coupler?
I am going to post the wiring diagram on Monday. Do not have a printer.
Thank you for all the help
Yanie, the voltage driving the motors can be quite different from that going to the rest of the circuit. I would suggest going with parts that are available from parallax as much as possible. Until an op amp, adc and micro are selected it is difficult to provide concrete suggestions.
I would suggest going with the LM358 for the op amp, the MCP3208 for the adc, and the prop as the micro controller.
Ha! The pinout depends on the DS:
http://www.parallax.com/Portals/0/Downloads/docs/prod/compshop/603-00019-L293D-Datasheet.pdf
2-7-10-15 for input, 3-6-11-14 for output
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00000059.pdf
2-9-12-19 and 3-8-13-18
It think it depends on the manufacturer - TI vs. ST Micro. Same chip name though. That's new...
Some amps need a positive and a negative voltages to work right. Athough you can 'fool' them by proivding a virtual ground at 0.5 x V+ while V- is at 0V.
Yes, this is what you have to do - switch the voltage down to 12V.You will aslo have to eventually regulate it (or use another switcher) down to 5V (or 3.3V) for the micro. Choosing between an LDO or a switching regulator depends on the current drawn by the digital circuitry.
For the LM358 you'd need more external discrete parts. At least 3 resistors and a cap. What's wrong with the INA2126?
We could use a micro that has the ADC built-in. Less things to worry about. How about a PIC or an AVR? I think a propeller would be like using a cannon to kill a fly. I use ATTiny's for tiny project like this. $2, DIP-14, 20MHz RISC. There is this nice C compiler - CodeVisionAVR. It has a built-in wizard that generates the register init code for you. As much as I like programming in assmblers, coding in C seems to be faster. Dispite of what Dunkin Donuts commertial says - "America runs on C"...
ADC - Analog to Digital Converter. I would suggest to use a micrcontroller that has one built-in. See here:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=ATTINY24A-PU-ND
With all the information I was able to understand, these are the line diagrams I made. The frequency was developed using the formulas given in the data sheet with the resistors in the data sheet example. I do not have a oscilliscope so I will need help wih the resistor in the receiver and I do not know what do use for a coupler capacitor. Any help and your overview of the diagrams will be greatly appreciated.
Use the 50k multiturn pot for the gain setting. Once you get it right I'd suggest to remove it and put a fix value resistor. Your mower has to work outdoors and the potentiometers are sensitive to the temperature changes.
On the loop driver. We can't use 1k pullup to 12V. The max input voltage on the L293 is 7V. Since the pin 3 is a push pull output it will be close to VCC when it's high. We have to reduce it somehow. Use a simple volate divider to bring down a little. Use 2k and 1k resistors in series from pin 3 to ground. Connect the 2k to the 555 output. The other lead to 1k and to ground. Connect the L293 input where the 2k and 1k resistors connect. This will give you VCC/3. It's 4V at 12V. This should work fine.
You're missing the series resistor on the driver output.
We're still debating what to do with the voltage drop on the diode though and/or maybe to use a single voltage rail-to-rail opamp intsead.
We could to this on the output of our instrumention amp:
Your tormenting me again. Can you please finish marking the attachments with whatever I should add and please be specific on the drawings with part numbers. I am doing the best that I can, but I do feel that I am chasing a carrot in another country. Thanks
You still have a couple of decisions to make too. Did you decide on what micro you're going to use?
Kwinn brought up a good point about the diode drop. I'm waiting for him to comment while I'm toying with some ideas here.
I did what I could on the detector schematic. You could start prototyping with that. We'll get back to it once we have a better understanding of the last 10%. You're good on the loop driver though expect for the resistors. If you don't do that you're going to hear this little 'puff' 10us after you power the board up and endup replacing the dirver chip. I'd try to avoid it if possible
Here is the pot for the gain adjustment: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=3590S-2-203L-ND
Nothing wrong with the INA2126 as long as you don't need high gain at the higher frequencies (above 10KHz). It also requires a dual power supply. One reason I suggested the LM358 is that it only requires a single supply.
As for suggesting the Propeller, this is a Parallax forum, and if Yianie needs help with his project it will be easier to come by if he is using a uC that the folks on the forum are familiar with. It is also better to have a little more cpu power than you need rather than not enough. I am sure that it will be put to good use. For one thing it would be a good idea to have sensors to detect obstacles so the mower does not run over people, pets, and other objects.
In addition both parts are available from Parallax, and with small projects shipping costs are a large percentage of the overall cost of parts so getting all the parts from one vendor can save a substantial amount of money.
True, the opto is not required as long as the analog input to the adc does not exceed it's maximum input voltage rating.
A single voltage rail to rail op amp is a good idea but that particular circuit will not work. You need to connect the feedback before the diode or you get unity gain once the output of the op amp exceeds the forward voltage (~0.7V) of the diode.
I wish I had the time to provide more help but work is taking up virtually every waking minute right now. What I will try to do is to provide a block diagram with descriptions of the receiver circuitry if time permits. The details (gain, offset, etc) will need to be worked out with the actual hardware.
As for the batteries I would use LiPO's. 3 cell will give you 11.1V. That's close enough. LiPOs are cheap and high capacity. Do you want to power the loop circuit with a battery too? Can't you use the AC outlet and use a 12V power supply?
Don't power the 555 chip with another voltage just put these two resistors. That's simpler.
Than again, it may be as simple as powering the whole thing with just 5V.
Now that I think about a single voltage rail-to-rail opamp could be setup the same way...
Ok, this is where I am at right now. To answer some questions, I am planning on using a stamp processer. I am hoping to detect over a 1.7V so that the parallax input will go '1' . I know going with all Parallax parts would be easier on the shipping, but someone has to tell me all the parts and how to wire the pins. Any volunteers?
The idea at this point is to modify the existing attached drawings and not really change parts at this time. Should I consider that these attachments will work?
Yianie, How do you know that 1.7V is the right threshold to detect the 14kHz signal from a distance of 10 cm and at a temperature of 23 deg C?
Here is a complete schematic of a single 5V detector.
Here's an ADC you could use.
http://ww1.microchip.com/downloads/en/DeviceDoc/21290e.pdf
Cheap and small. You need 2 of them. The Stamp's use PIC's so they should have an SPI controller. If it's not available on the module pins it'd be trivial to bitbang it using 4 I/O pins. I can help you with that too.
BTW, Parallax may not carry all the parts you need.