The MCP3202 is a dual version of the MCP3201, and a better choice since you will need to measure 2 input signals. You may even want to consider the 4 or 8 channel version (MCP3204/8) to allow for future expansion.
Alex123, the schematic in post #90 looks pretty good as far as amplifying the signal goes but I do not see how it can detect or allow the adc to measure a peak. To me it looks like you will get an amplified signal on top of a 2.5V DC level. Perhaps I am so tired I am missing something. Do you have a reference or source for how this circuit works?
Yianie, ADC stands for Analog to Digital Converter. It converts the voltage to a number the microcontroller program can use. The REF chip provides a reference voltage of about 1/2 of the +5V supply voltage to the INA2126.
This what I have in mind.
When you sample the signal at 100kHz you get 10 samples (if the loop runs at 10kHz) per period. From these samples you get the max level.
If you want even more precision you can interpolate the max value based on the next or the previous sample or the sample close to the 2.5V level. I'm pretty sure we won't need that though. Getting the highest value per period will be enough.
Yianie, You'll get all the reading from 0 to 5V from the sensor (assuming my last schematic). I was asking why you think that the 1.7V is the right level for the signal detection. It's not. This is why I propose to use an ADC so that you make the decision of selecting the level in the code.
This is how the setup would go: Set the amp gain so that you get ~5Vp-p on the amp when the detector is directly above the wire. Make sure it's the same distance above the wire as it will be on the mower. Move the sensor away from the wire unitl the amp voltage is close to a flat line at 2.5V. This will be your critical distance at which you lose the signal. Ideally both detectors should be twice this distance apart from each other.
INA118 is a single amp in DIP8 while INA2126 has 2 amp in DIP14. INA2126 is lot cheaper than 2 INA118 and work just fine for our 10kHz signal.
This what I have in mind.
When you sample the signal at 100kHz you get 10 samples (if the loop runs at 10kHz) per period. From these samples you get the max level.
If you want even more precision you can interpolate the max value based on the next or the previous sample or the sample close to the 2.5V level. I'm pretty sure we won't need that though. Getting the highest value per period will be enough.
I thought you might have something like that in mind. That should work provided the uC chosen can handle the data burst coming in at that rate. I would suggest acquiring data for more than one cycle (perhaps 3 cycles), finding the min and max, and then subtracting min from max to use for the calculations. That will remove any DC drift from the results.
That should work provided the uC chosen can handle the data burst coming in at that rate. I would suggest acquiring data for more than one cycle (perhaps 3 cycles), finding the min and max, and then subtracting min from max to use for the calculations. That will remove any DC drift from the results.
If it's the Propeller chip, it can handle 8 of these simultaneously at 10MHz sampling . The 20MHz RISC can easily do 2 at 100kHz...
Yeah, the "max - min" will yield a better result unless the amp gets saturated. Averaging is good too to get rid of the noise. That's the beauty of the software... So easy to change... :cool:
alex123, I hope that you and Yianie realize that the op amp and adc need to be on a well designed pcb in order for this circuit to work well. A perf board or prototyping board will not give good reliable results.
alex123, I hope that you and Yianie realize that the op amp and adc need to be on a well designed pcb in order for this circuit to work well. A perf board or prototyping board will not give good reliable results.
Obviously having the board fabbed would be ideal. A nice ground and power plain... Oh well... Since we have no other choice I'd shoot for the perf board. The proto board would be the worst. We don't need to read the signal down to one digit. If we get 16 distinct values (with averaging) out of 4096 we should be good. Better than a fixed threshold. It helps that we'll be running this on batteries. On the other hand using this high speed (80MHz) Propeller actually worries me because of the fast edges. Now that you made me think about it it seems that using the Stamp may work better from the circuit noise perspective.
Yianie, I would suggest using the SMT resistors and capacitors instead of leaded ones. I found out long time ago that 0805 size parts work perfect with the 100 mil grid proto boards. You may need tweezers but you'll save a lot of time anyway.
Comments
Alex123, the schematic in post #90 looks pretty good as far as amplifying the signal goes but I do not see how it can detect or allow the adc to measure a peak. To me it looks like you will get an amplified signal on top of a 2.5V DC level. Perhaps I am so tired I am missing something. Do you have a reference or source for how this circuit works?
Yianie, ADC stands for Analog to Digital Converter. It converts the voltage to a number the microcontroller program can use. The REF chip provides a reference voltage of about 1/2 of the +5V supply voltage to the INA2126.
When you sample the signal at 100kHz you get 10 samples (if the loop runs at 10kHz) per period. From these samples you get the max level.
If you want even more precision you can interpolate the max value based on the next or the previous sample or the sample close to the 2.5V level. I'm pretty sure we won't need that though. Getting the highest value per period will be enough.
This is how the setup would go: Set the amp gain so that you get ~5Vp-p on the amp when the detector is directly above the wire. Make sure it's the same distance above the wire as it will be on the mower. Move the sensor away from the wire unitl the amp voltage is close to a flat line at 2.5V. This will be your critical distance at which you lose the signal. Ideally both detectors should be twice this distance apart from each other.
INA118 is a single amp in DIP8 while INA2126 has 2 amp in DIP14. INA2126 is lot cheaper than 2 INA118 and work just fine for our 10kHz signal.
I thought you might have something like that in mind. That should work provided the uC chosen can handle the data burst coming in at that rate. I would suggest acquiring data for more than one cycle (perhaps 3 cycles), finding the min and max, and then subtracting min from max to use for the calculations. That will remove any DC drift from the results.
If it's the Propeller chip, it can handle 8 of these simultaneously at 10MHz sampling
Yeah, the "max - min" will yield a better result unless the amp gets saturated. Averaging is good too to get rid of the noise. That's the beauty of the software... So easy to change... :cool:
Because it does. See its DS. In post #75 I told you that it's possible to "fool it". That's what I showed you in post #90....
Obviously having the board fabbed would be ideal. A nice ground and power plain... Oh well... Since we have no other choice I'd shoot for the perf board. The proto board would be the worst. We don't need to read the signal down to one digit. If we get 16 distinct values (with averaging) out of 4096 we should be good. Better than a fixed threshold. It helps that we'll be running this on batteries. On the other hand using this high speed (80MHz) Propeller actually worries me because of the fast edges. Now that you made me think about it it seems that using the Stamp may work better from the circuit noise perspective.