Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Analog to squared signal, need help...

Status
Not open for further replies.

Zane83

New Member
Hi.. a newbie need some design idea here... thx:(

I'm currently doing a final project and wish to get some ideas and help here.

What i'm doing is an automatic weigher. I'm using a PIC16F877A for controlling the whole system. Somehow i'm having problem with the signal. I'm using load cell as the weight sensor; and using the integrated ADC in the microcontroller.

The problem is, while an object pass through the load cell (if speed is fast), the ADC could not seems to finish the conversion. Hence, i'm thinking of 'squaring' the analog signal from load cell. Somehow, the analog signal from the load cell is very small (in mV) and i can't figure out what can i do to finish the conversion (to get more precise reading) as soon as possible other than squaring the signal.

I'd tried to used Schimitt Trigger to square the signal but somehow i could not get the desired peak squared signal. Besides, i'd tried using a peak detector, but it is only possible to detect (more precise) with signal higher than 1V while i need to do with mV.

Could anyone give me some ideas???:confused: Thanks
*I'm using Op-Amp 741*
 
Could you post a schematic of the circuit you've already tried?
 
This is the diagram i'd simulated before i try building it..

Thanks for your very prompt reply..

I'm actually using Multisim7 do the simulation in advance before building the real-time circuit.

As i'd mention, i tried peak detector but it seems not appropriate for low voltages (in mV)... and yet the Schimitt Trigger is not responding to what i want (the peak of squared wave should be the same with the input signal)

The components availability is kinda problem to me now. Hence, I'm using some of the common devices such as opamp 741.

hope to get some ideas or suggestion...

Thanks alot..

Regards,
Zane83
 

Attachments

  • Peak Detector.JPG
    Peak Detector.JPG
    24.4 KB · Views: 282
  • Schimitt Trigger.JPG
    Schimitt Trigger.JPG
    20 KB · Views: 253
Oh ya... the speed (lesser rise time) is kinda critical problem to me as i need a very fast conversion and yet accurate reading from the PIC.

Thanks again..
-Zane83-:eek:
 
The old 741 opamp is nearly the slowest opamp available.
The 10uF filter capacitor will take "all day" to charge from the low output current of the opamp.

Use a fast opamp like a TL081 , increase the value of the 100k discharge resistor and reduce the value of the filter capacitor.

Or the opamp could drive a transistor emitter-follower to quickly charge the capacitor with a high current. The signal must be 5V or less to avoid reverse breakdown of the transistor's emitter-base. The base-emitter becomes the rectifier.
 
Sounds like you need a sample and hold buffer. It will basically 'hold' the value on the sensor long enough for the A/D to perform the conversion.

Look for "sample and hold" or "track and hold"
 
audioguru said:
The old 741 opamp is nearly the slowest opamp available.
The 10uF filter capacitor will take "all day" to charge from the low output current of the opamp.

Use a fast opamp like a TL081 , increase the value of the 100k discharge resistor and reduce the value of the filter capacitor.

PHP:
Or the opamp could drive a transistor emitter-follower to quickly charge the capacitor with a high current. The signal must be 5V or less to avoid reverse breakdown of the transistor's emitter-base. The base-emitter becomes the rectifier.[/QUOTE]

Thanks for the ideas. Do you mean that i should purge after the op-amp using a transistor?

Anyway, i did try to do some simulations by increasing the resistor to 1MHz and the signal look nice. Somehow, if i decreased the input signal to few mV, the output signal seems to be 'clamped' above. May i know that if TL081 could be able to saturate the output signal??? (as a peak-detector)...

Thanks audioguru
 
poopeater said:
Sounds like you need a sample and hold buffer. It will basically 'hold' the value on the sensor long enough for the A/D to perform the conversion.

Look for "sample and hold" or "track and hold"

Thanks poopeater!

Actually i'd been thinking of several method such as schimitt, amplifyin and clipping it; and the holding and sampling as you had mention. The problem that runs around my mind is do we have to wait for the input signal to reach the peak before the holding and sampling take place? If i were to be mistake, please correct me.. thanks!

-Zane-:)
 
Attached new peak-detector circuit design

Mr. Audioguru,

I'd actually found another peak-detector circuit from www.edn.com for design ideas and now i am still studyin on it with sleepless night. The opamp used is TL084 instead of a TL081 together with a buffering component of LM306. The paper written that the input should would be from 500mV to 4V. Is there any amplifier i could use to get my input signal to adapt the peak-detector circuit?

(my input signal may be around or less than 1mV - analogue signal from load cell)

I'd attach the pdf file and do point me out if i made some mistakes..

Thanks again!
-Zane83-:)
 

Attachments

  • Precision Peak Detector.pdf
    201.2 KB · Views: 668
Zane83 said:
[/PHP]
Somehow, if i decreased the input signal to few mV, the output signal seems to be 'clamped' above.
Thats what a peak detector does. It charges the capacitor very quickly for its "attack time" then discharges the capacitor slowly for its "release time". The 100k or 1M resistor controls the release time if the input resistance of the ADC is much higher.

Here is a fast peak detector circuit:
 

Attachments

  • Peak Detector.PNG
    Peak Detector.PNG
    61.4 KB · Views: 413
May God Bless!

At last many of thorns in my brain had been unplucked. I'll carry on the work with the ideas. Hopefully the could works with my small voltages!:D

This is just a great place for discussion.:p

Thanks alot!
Best regards,
-Zane83-
 
Your small voltage problem could be caused by the input offset voltage of opamps. It is 10mV max. It can be nulled if you add an offset adj. pot to pins 1 and 8 of the opamp as shown in its datasheet.
 
audioguru said:
Your small voltage problem could be caused by the input offset voltage of opamps. It is 10mV max. It can be nulled if you add an offset adj. pot to pins 1 and 8 of the opamp as shown in its datasheet.

Thanks again!

Anyway... gonna catch my lecture now. Never knew it was morning until my alarm buzzing me!

I'll try with the ideas and get back to you soon! Thanks for being so patient on me!! Take care!

Best regards,
-Zane83-:)
 
The PIC A2D already includes an internal sample and hold, so no need for an external one.

But it's useless saying you need a 'fast' conversion, but don't give any suggestion of how fast it needs to be?.

Assuming it's an AC signal?, you also need to low-pass filter it, to prevent anti-aliasing errors.
 
Attached information of my project

Nigel Goodwin said:
The PIC A2D already includes an internal sample and hold, so no need for an external one.

But it's useless saying you need a 'fast' conversion, but don't give any suggestion of how fast it needs to be?.

Assuming it's an AC signal?, you also need to low-pass filter it, to prevent anti-aliasing errors.

Hi Nigel,

Sorry that i'd miss out some information here.:eek: I'd attached a file here on what actually i'm doing and had calculated. From what i'd calculated, it seems like the A2D conversion speed is not fast enough for the optimum result of my project. The signal came from a load cell of a platform and i'm to calculate the axle weigh automatically.

Well, its better for me to be silly now than for the rest of my life. :rolleyes: I have something which i'm not very sure is whether will the A2D perform continuously for the 877A? If so, is it the matter of programming to know the peak of the value? (such as by subtracting again and again to get -ve value to know that the previous is the peak - highest value). Or is there any other recommendation? This seems to delayed the performance.

Anyway.. do correct me if i've done any mistake here as it's the first time i'm using 877A and its function pratically. Thanks alot everyone!:DSignal.JPG
 
Thanks!

audioguru said:
Your small voltage problem could be caused by the input offset voltage of opamps. It is 10mV max. It can be nulled if you add an offset adj. pot to pins 1 and 8 of the opamp as shown in its datasheet.

I'd tried using TL082CP for simulation. And now i got a low voltage. Somehow, if the voltage is varying from 0.1mV to 1or2mV, we have to re-adjust the resistor (connected to pin 1 and 8) again. i think i gonna make sure which voltage happens the most so that the thing could work nicely and automatically (without readjusting resistor)

Success.JPG

Success signal.JPG
 
Well that's a VERY confusing collection of metric and imperial figures?. But I'm rather baffled where you figures come from?

110kmph is 30.55m/s - so to travel 1m takes 1/30th of a second (33mS). I'm not messing about with metres and feet, so 1/2m will take around 16/17mS.

This gives you 16mS or so to take as many readings as you can!, then find the highest. Acquisition time is specified in the datasheet, and gives a formula to calculate it - the example given in the datasheet results in 19.72μs, which means you could get quite a few readings in 16mS, even counting storing the results.

However, an easier method might be a peak-detector as suggested earlier (now I know what you're trying to do), use a PIC output pin to discharge it after reading it.
 
You are going to weigh an axle of a moving vehicle?
What about momentum?
What if the road is not perfectly flat, or a pebble or hole was there in front of the scale, or the vehicle put the brakes on?
What about aeonautics lifting or adding downforce?
What if the wheels are out of balance?
 
Try your opamp again without the extra resistors. The output resistor is not needed since the opamp output is push-pull, and the high current in the resistor overloads the opamp and causes heating which changes its input offset voltage. Use a single opamp since the other one in the dual might be causing heating.
 

Attachments

  • Opamp.PNG
    Opamp.PNG
    33.6 KB · Views: 170
audioguru said:
You are going to weigh an axle of a moving vehicle?
What about momentum?
What if the road is not perfectly flat, or a pebble or hole was there in front of the scale, or the vehicle put the brakes on?
What about aeonautics lifting or adding downforce?
What if the wheels are out of balance?

Yep.. i'm sure you'd heard of the WIM system (Weight-in-Motion system origin Canada in the 90's if not mistaken). That's what my final year project about.

As for the momentum, we have to take consideration of the speed of the vehicle (typically using Doppler Radar or economically using ultrasonic sensor). Somehow, this would extend the level of my project and i don't think i would be able to complete it by time.

Hence, i'm building this system in my campus at the most even road (at the same level with platform - imbedded). This could avoid some unnecessary impact.

So, i'm trying to make this simple WIM system first with few conditions:
1. Able to take weigh dynamically
2. Able to capture the overload axle (of trucks)
3. Able to capture image (registration plate)

After i complete this part only i'll further on to the other conditions such as aerodynamic force. This system actually operate similarly to the speed trap but this is weigh-trap. So, building this at the long straight road (highway) which brakings are almost impossible to happen to get more accurate reading. I think increasing the width of the platform could solve the wheel imbalance problem (but some adjustment are needed).

ThankS! :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top