go_away

Author Topic: help: how to eliminate sensor's noise?  (Read 3901 times)

0 Members and 1 Guest are viewing this topic.

Offline black-codeTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
help: how to eliminate sensor's noise?
« on: August 13, 2007, 11:28:35 AM »
We try to make a line follower robot, but the problem of that project is the noise that comes from the sensors.

we use two line tracing sensors and they need from 12v to 30v, we applied to them 24v.

The microcontroller used is AT89C52, it needs 5v (we get this 5v from a regulator 7805) so when we common the ground of the two supplies (5v and 24v) the volt on the microcontroller becomes 7v and may reach 9v (7v is enough to make our microcontroller damaged) and that because of the noise that comes from the two sensors.

The problem happened when we common the two grounds of the two supplies so how we can solve this problem, how we can eliminate the noise to don't make the microcontroller damaged?

Any help will be appreciated, thanks in advance.

Offline elixier

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
  • http://www.techiesworld.org
Re: help: how to eliminate sensor's noise?
« Reply #1 on: August 13, 2007, 12:02:00 PM »
First of all you have not mentioned what type of Sensors you have used.

Now you must separate the power supply for your logic levels which you provide for your Micro controller. Even if it sounds too funny but try it out and i think the work will be o key.
http://www.techiesworld.org
  Techies Rules The World

Offline black-codeTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: help: how to eliminate sensor's noise?
« Reply #2 on: August 13, 2007, 12:15:09 PM »
welcome elixier .. :)

we can't separate the two supplies, we must common the two ground of the two supplies else microcontroller will not recognize on the sensors signals.

thanks for your reply

Offline elixier

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
  • http://www.techiesworld.org
Re: help: how to eliminate sensor's noise?
« Reply #3 on: August 13, 2007, 12:44:51 PM »
As using a sensor the Micro controller understand only On or Off so it will work and i have tested the same.
http://www.techiesworld.org
  Techies Rules The World

Offline jsmoker

  • Full Member
  • ***
  • Posts: 118
  • Helpful? 2
Re: help: how to eliminate sensor's noise?
« Reply #4 on: August 13, 2007, 02:24:50 PM »
I'm not positive I understand exactly what you're saying, but as I see it you have you're unregulated 24v going into your sensor and from the 24v you regulate 5v to your micro controller, right?  In this case what is the span of the output from the sensor? I'm also confused about your sensor output.  I'm assuming it has an analog output, but you mentioned the microcontroller understanding only on or off so are you refering to the Vcc or the input? 

Some solutions to think about:

If your output is just going out of range of the micro controller's input, consider a voltage divider. Vo = Vin*R2/(R1+R2).

 If you're also looking for somekind of filter for high frequency spikes try a low pass with a resistor and capacitor.  Be mindful that the resistor of the lowpass filter will also reduce your output voltage as well.  Here's a calculator.

http://www.muzique.com/schem/filter.htm


Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: help: how to eliminate sensor's noise?
« Reply #5 on: August 13, 2007, 03:02:56 PM »
Hi,

we use two line tracing sensors [...]

[...] when we common the ground of the two supplies (5v and 24v) the volt on the microcontroller becomes 7v and may reach 9v (7v is enough to make our microcontroller damaged)


The problem happened when we common the two grounds of the two supplies so how we can solve this problem, how we can eliminate the noise to don't make the microcontroller damaged?
First of all, you need to post the make and model of the sensors (and a datasheet will help immensely).
Second... Please post whatever schematic you have build from - it sounds like you hooked up something very wrong, but to be sure, we'll need to see the schematic. Connecting the grounds shouldn't cause any concern, but you have to interface "level corrected" of course.

I really don't think it's a question of noise - rather a case of bad design.

Btw. How did you connect the sensors to the micro?


If you post the needed info, it should be small matters to correct it.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline black-codeTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: help: how to eliminate sensor's noise?
« Reply #6 on: August 14, 2007, 07:37:07 AM »
welcome every body..

here is a quick schematic showing the connection between the MC and the sensors



http://noor22o.net/photos/Snap1.gif

How it works : sensors are connected to 24v and with regulator 7805 we connect the MC to 5v the gnd is common for all the circuit as we see.

when sensors sense an object it will output 15v so we can't use 15v as an i/p to our MC so we use a transistor and connected it to 5v so when the two sensor sense an object it will output 15v so transistor will be on so the i/p to the MC will be 0 (GND) and when the two sensors don't sense any object the output will be 0 so transistor becomes off so the i/p to the MC will be 5v..

the problem here when the GND of the two sensors connected with the GND of the MC the noise of these sensors will rise the 5v to 7v and may be 9v so how we can eliminate the noise effect.

as we can't separate the two grounds to make the MC able to read sensors o/p.

mmm thanks for every body and wait your help..

Offline jsmoker

  • Full Member
  • ***
  • Posts: 118
  • Helpful? 2
Re: help: how to eliminate sensor's noise?
« Reply #7 on: August 14, 2007, 08:28:12 AM »
you have four leads going to your transistor in the diagram, but the BC337 only has 3 leads on it. 

Offline black-codeTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: help: how to eliminate sensor's noise?
« Reply #8 on: August 14, 2007, 10:45:42 AM »
welcome jsmoker ..

the last lead that is connected to the MC is not a lead from the 3 leads of the transistor but it's the o/p taken from the collector terminal of the transistor let's see the pic below :



http://noor22o.net/photos/Snap2.gif

Offline jsmoker

  • Full Member
  • ***
  • Posts: 118
  • Helpful? 2
Re: help: how to eliminate sensor's noise?
« Reply #9 on: August 14, 2007, 01:19:24 PM »
Perhaps your sensor output is leaking through the transistor.  Maybe a diode would help?  Again, I'm still a bit confused are you getting the 7v simply in your MC input, or is your MC power supply going up to 7v?  Also, is it a steady 7V depending on the sensor input or random spikes.  If it's just an steady input of 7v depending on your sensor input, I wouldn't really call it noise.  As Soeren said, "it's just a case of bad design".  I'd still recommend using a voltage divider in place of your transistors.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: help: how to eliminate sensor's noise?
« Reply #10 on: August 14, 2007, 04:50:58 PM »
Hi,

How it works : sensors are connected to 24v and with regulator 7805 we connect the MC to 5v the gnd is common for all the circuit as we see.

when sensors sense an object it will output 15v so we can't use 15v as an i/p to our MC so we use a transistor and connected it to 5v so when the two sensor sense an object it will output 15v so transistor will be on so the i/p to the MC will be 0 (GND) and when the two sensors don't sense any object the output will be 0 so transistor becomes off so the i/p to the MC will be 5v..

the problem here when the GND of the two sensors connected with the GND of the MC the noise of these sensors will rise the 5v to 7v and may be 9v so how we can eliminate the noise effect.

as we can't separate the two grounds to make the MC able to read sensors o/p.
I'll repeat...
"make and model of the sensors (and a datasheet will help immensely).
Second... Please post whatever schematic you have build from "

And please, no quickies...
If you want others to spend time on your problem, at least spend enough time on your own posts to make it understandable.

Provide:
1) A complete and correctly drawn schematic with component values.
2) Complete make and model of the sensors (+ a datasheet if available).
3) A complete description of what goes wrong - like where and when you measure the 7 to 9V.

This shouldn't happen if the basis resistor and the pull up resistor is adequately sized and connected correctly (check orientation of transistor in a datasheet). And a transistor IS the best way to go - configured as an open collector, pulled up at the 5V side - voltage dividers should never be used in such a situation.

This has absolutely nothing to do with noise!

You could use an opto coupler to run it with separate grounds, but it shouldn't be necessary.


If you can't (or aren't willing to) describe your problem, how are others to solve it?

My last word on this until you post what I mentioned above - life's too short to drag out of a poster what he should have provided in the first post anyway, so if you want help, provide what's needed.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline black-codeTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: help: how to eliminate sensor's noise?
« Reply #11 on: August 15, 2007, 06:26:53 AM »
welcome every body ..

jsmoker, the problem not in the transistors, look if we separate the two GNDs (GND of sensors and the GND of the MC) the voltage on the MC will be 5v as we want but our MC will not able to understand the sensors reading (so the state of the MC will not changed) but if we connected the two GNDs our MC will understand the sensors reading but the noise of the two sensors rise the voltage on the MC to 7v so our MC will be damaged ..

Soeren, sorry i can't remember the types of the sensors used (currently they are with my friend).

and here is the schematic ..

http://www.filmazzika.com/New/sch.gif

thanks every body..

Offline jsmoker

  • Full Member
  • ***
  • Posts: 118
  • Helpful? 2
Re: help: how to eliminate sensor's noise?
« Reply #12 on: August 15, 2007, 01:09:30 PM »
Soeren,

I'm not trying to be snotty or anything, I'm just furthering my quest for knowledge.  What's the advantage of the transistor over the voltage divider?  Less current? Less components?  I just have a knack for running into problem with more complex components (yeah, I know a transistor isn't that complex).

-JSmoker

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: help: how to eliminate sensor's noise?
« Reply #13 on: August 15, 2007, 10:59:59 PM »
Hi,

What's the advantage of the transistor over the voltage divider?  Less current? Less components?
Less error ;)
With an "open collector" transistor, pulled up at the receiving end, you allways know the max. voltage possible (that's why I know that the OP either has a bad component or a wrong connection, as the schematic does work correctly - too bad he doesn't care enough for his own circuit to answer the crucial bits about it).

With a voltage divider, it is possible to get too high a voltage, but not with a transistor.

If you tend to loose the overview with circuits as they "grow", just test them out as building blocks, until you're satisfied that a circuit does as expected, then add a bit and test once again and so on.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline black-codeTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: help: how to eliminate sensor's noise?
« Reply #14 on: August 16, 2007, 01:14:31 PM »
welcome jsmoker and Soeren ..

the problem not in the MC i/p but in the MC supply it should be 5v and raised up to 7v so this 7v will damage our MC..

i put the schematic but no one say his opinion to solve the problem ..

jsmoker, i want to ask what u mean by using voltage devider, u mean to use it instead of the transistors or instaed of the regulator 7805 ?

thanks ,,

Offline jsmoker

  • Full Member
  • ***
  • Posts: 118
  • Helpful? 2
Re: help: how to eliminate sensor's noise?
« Reply #15 on: August 16, 2007, 02:12:11 PM »
yes, I had meant to use it instead of the transistor so that from the specs of your sensor, the highest output would only be 5v, but Soeren is right to say you should check your transistor configuration.  You might have it in wrong.  Do a simple test with just the transistor alone, make sure the leads are correct.  Check your datasheets, only rely on it 99.9%.  I've come across a datasheet (for the TO-92 package of the L4931 voltage regulator) where the leads are in the reverse order of what it shows on the datasheet. 

Offline black-codeTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: help: how to eliminate sensor's noise?
« Reply #16 on: August 16, 2007, 06:17:18 PM »
welcome jsmoker,,

i had tested the transistors output and they are correct 100% when sensors sense an object the o/p will be 0v and when no object the o/p will be 5v ,and i said before that the problem isn't in the transistors the problem found in the GND connections and the supply for the MC not the i/p to it's pins that comes from the two sensors because the supply must be 5v after connecting the GNDs of the circuit (24v and 5v) the supply of the MC becomes 7v and may be higher ..

so please understand what i say to help me solving this problem,,,

thanks,,

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: help: how to eliminate sensor's noise?
« Reply #17 on: August 16, 2007, 09:30:17 PM »
Hi,

i had tested the transistors output and they are correct 100% when sensors sense an object the o/p will be 0v and when no object the o/p will be 5v ,and i said before that the problem isn't in the transistors
Is the problem showing JUST when you connect the grounds (before you attach the sensor outputs to the micros inputs)?


Quote
the problem found in the GND connections and the supply for the MC not the i/p to it's pins that comes from the two sensors because the supply must be 5v after connecting the GNDs of the circuit (24v and 5v) the supply of the MC becomes 7v and may be higher ..
Then your voltage regulator must be bad. OR you connected something different from what you think you did
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: help: how to eliminate sensor's noise?
« Reply #18 on: August 17, 2007, 04:05:18 AM »
hi black-code,
your circuit diagram here:
http://www.filmazzika.com/New/sch.gif
doesn't show any capacitors across the power lines.
are you just seeing voltage spikes over 5V or are you seeing constant over voltage conditions at the output of your regulator?
if it is only voltage spikes add some decoupling capacitors between ground and the input to the regulator and between ground and the output from the regulator.

i don't think you ever did say what kind of sensor it was you are using.
it is relevant because it will allow us to determine how much electrical noise they might be creating.

dunk.

Offline black-codeTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: help: how to eliminate sensor's noise?
« Reply #19 on: August 17, 2007, 05:15:58 AM »
welcome every body,,

soeren, yes the problem appears when connecting GNDs but the o/p of the sensors to the MC don't cause any problem.
i had tested the regulator without connecting GNDs (of sensor and MC) the o/p is 5v (fine), when connecting the two GNDs becomes 7v or higher..

dunk (welcome)  ;),,

i had used some decoupling capacitors at the i/ps of 24v and  5v with the GND but don't test it with the regulator's i/p and o/p but if i do it can eliminate a noise of 2v or 3v ??

thanks every body,,

Offline jsmoker

  • Full Member
  • ***
  • Posts: 118
  • Helpful? 2
Re: help: how to eliminate sensor's noise?
« Reply #20 on: August 17, 2007, 12:03:16 PM »
I'm assuming you've tried disconnecting the MC and are checking the 5V power supply. This leave you with two possible problem areas, either the voltage regulator or the transistors.  You said that when you connect the ground of the sensors to the MC you get the problem, but all your doing is putting the voltage potential in relation to everything else.  At this point I'm inclined to believe it's a problem with your transistor circuit. You still haven't answer the question dunk and I both asked of whether the 7v are spikes or constant levels.  To check the transistor, try to create a scenario where the sensor output steadily inclines from 0 to it's max output value and check the resulting voltage above the resistor on your transistor (the 5v input to the transistor).  As I mentioned before, you might have a problem with the current flow in the transistor and the high input in the transistor may be making the 5v go to 7v.

If you want to check the voltage regulator you could always try switching that one out as well, but 7805 are pretty rugged (electrically, the radioshack ones tend to break easily at the leads physically).  I doubt this is the problem, but also check that your not trying pull too many amps from the regulator.  I think the 7805s are rated at 1amp which is pretty big for a circuit with no motors. 

Offline black-codeTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: help: how to eliminate sensor's noise?
« Reply #21 on: August 18, 2007, 04:36:12 AM »
welcome jsmoker,,

i said before that the 7v isn't a constant value it may reach 9v,8v,6.5v,.. so it's a spikes and i don't see any problem in the transistors circuit the values of the o/p was correct when i tested it.

i am sure that the problem comes from the two sensors they have a noise and this is the reason of risisng up the 5v to whatever.

i think about getting two batteries and connecting the GNDs as shown:



http://filmazzika.com/New/untitled.GIF

here we return each GND to the last point of connection so the current comming from the sensors will not reach the GND of the MC so no noise will appear ..

so what's your opinions?
« Last Edit: August 18, 2007, 04:38:31 AM by black-code »

 


Get Your Ad Here

data_list