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.

READING A PUSHBUTTON & display on LCD

Status
Not open for further replies.
I don't think it will vary with the type. The tweaking is needed to get the reflection from the liquid surface exactly into the sensor receiver. I just used a bit of stiff wire that held the sensor then bent the wire a bit so the angle was right and it started reading the surface.
 
I just used a bit of stiff wire that held the sensor then bent the wire a bit so the angle was right and it started reading the surface.

You see....i did fix the sensor & "tried" to get it as perpendicular as possible.....
& i used it in that position for the measuring the 3 different liquids....

& it did read the surface of the liquid BT only for the thick white liquid...and it gave accurate readings whilst i varied the level....

However when i changed the liquid type....
to the thick green liquid and later to water( with the sensor in the same position as b4)...
the readings were inaccurate....

for water....it was reading the bottom of the glass vessel...
for the thick green liquid it was a couple cm off....

I have enough stiff wire around:)ill give it a try
{my sensor was mounted on a long piece of wood which i kept on the table}
 
Last edited:
Does that mean i got 2 keep tweaking it for different liquids as well???So every liquid got to be held at a fixed angle at which it works?????

That is a possibility, but you have not characterized the problem well enough to say with certainty. That is not a criticism, only a fact.

First off, from the nature of this and related threads, I gained the impression that the most important aspect of the project was the programming and electronic aspects. The requirements specified in the problem with respect to using IR and reflection did not leave a lot of room for experimentation and change, e.g., using TOF. With respect to the programming, it appears you are almost finished.

As for the problems you are having with reflection, I suspect you have studied Snell's Law and know that the angle of the light rays relative to the normal will change dependent on the refractive index of the liquid. If not, see here: **broken link removed**

In sum, with an IR-opaque material like your white liquid or hard surface, you detect reflection from the surface only and the apparatus works. If the liquid is not opaque, you are getting reflections from other surfaces/interfaces and your measured values vary. If you trace some hypothetical light rays, you will see how your results could vary with different container dimensions and liquid refractive indices. In fact, with a little design and use of a slit, you could probably use your detector to measure refractive index.

Suggestions:

1) Talk with the lecturer/professor and describe what you are observing. Find out whether the apparatus is actually supposed to work or whether the programming and electronic part is all you need to get done.

2) If it must work, then find out whether a "floater" would violate the rules. I mentioned on another forum that I think a plate will work better than ping pong balls.

3) If it must work, and you cannot use a floater, then play with the geometry. Do some pencil and paper drawings or use one of the programs on the Internet for ray tracing. My guess is that you may be able to get it to function by defining a minimum diameter for the vessel and placing the IR-emitter and detector further apart. That may not be practical because of the unitized construction of your detector. However, you still might be able to use your current detector, if you add some front-surface mirrors. For example, you could bounce the beam obliquely off the liquid surface to get total reflection within a range of reasonable values of refractive index, THEN use one or more front-surface mirror(s) to reflect the beam back to the detector side of the module. As a rough guess, one mirror would be virtually on the opposite side of the small tank and the others would reflect the beam from that mirror to the detector.

In any event, #3 is clearly the most difficult option and may not be necessary, if the lecturer agrees with #1 or #2.

John
 
Last edited:
Thanks Jpanhalt, The design has to work. I like your idea:
In fact, with a little design and use of a slit, you could probably use your detector to measure refractive index

I got 5 days till exams start.....I will look into this more after & try to implement it......
Ill find out if I am allowed to use a floater...
 
Emailed my lecturer & waiting for a reply
 
Last edited:
In the meantime, you might want to play with the geometry that would be involved to exceed the critical angle with water. It is not going to be that easy, particularly if you want to use relatively small diameter containers.

Another option is to try the reflection with vodka. The alcohol should absorb IR at 940 nm, thus cutting down secondary reflections. Then, tell the examiners it is just water and prove it by drinking it. :D

John
 
Then, tell the examiners it is just water and prove it by drinking it.
lol very funny....:D The lecturer replied...I'm going to university tomorrow cz he wants to see me in person. Uhmmm & i write on the 7th & 8th THATS this Wednesday & Thursday:eek:...
 
I said very early on that I didn't think the problem, as written, has a proven solution. For example, if you took the critical angle approach, the diameter of the container would be on the order of 200 cm to give you that angle at 80 cm with water.

Frankly, I think with the programming you developed with Atomsoft and The RB, assuming it works as you intend, plus a demonstration with milk or other IR absorbing liquid would be sufficient. If it is not, then I would append a list of known "unknowns" or non-suitable liquids and potential solutions to those problems (such as changing the wavelength of the IR emitter, changing the container diameter, etc.) as have been discussed in you threads.

It is simply too late to develop those alternatives, and I believe it is far better to present something that works with known limitations than to present something that just doesn't work.

Good luck, and please let us know the outcome.

John
 
I spoke to my lecturer today:

in the specifications i had posted...it stated that the project is:
NON-CONTACT....hence NO FLOATERS ALLOWED...

He said that the detector should be able to measure AnY TYPE of liquid....&
i must find a way of TWEAKING it to work with all liquids including transparent liquids....

He said that the DESIGN comes in when THERE iS a problem & i have to design to solve that problem.

He said there has to be a solution to reading the surface of the water...& he wants the project to read water...its a basic liquid...& i must get that to work.

He says water has to have some reflection from the surface of the liquid...& the intensity from the surface will be less than the reflection intensity from the bottom of the container.

& i should find a way to get the "lesser intensity".....maybe by using a filter.

He is happy that it works with dense liquids....he said now i must concentrate on getting it to work on water. If it works on water it will work on any transparent liquid.

How can i overcome the problems i get when i measure the liquid level of water?Any MORE Solutions?

problems:

1. detector does not ALWAYS read the surface of water(usually reads the bottom of container)

2. measurements fluctuate often


AND how can i implement the tweaking coz the GP2 is constrained by its structural design?


He said he wants to make it difficult lol because if he doesn't then that would mean im complete...& it is a final year project & it cant be that simple

I got to be going now....I'm writing my exam tomorrow & Thursday....Going to study more.....
 
Last edited:
Tweaking the electronics will not solve the reflection problem per se.

Shooting from the hip, consider these options:

1) Differentiate bottom reflection from top reflection by the time difference. That gets back to a TOF method, and you simple do not have the time or devices to do it. NOT PRACTICAL

2) Some "filter": 1) The wavelength of the reflected light is not affected by the surface from which it reflects. 2) Could one look at polarization differences with a filter? Reflected light from the liquids is partially polarized relative to incident light.

[url said:
https://www.uwgb.edu/dutchs/PETROLGY/GENLIGHT.HTM][/url]
Light reflected from non-metallic surfaces is polarized (bottom). The incident light causes electrons in the material to vibrate. Vibrations parallel to the surface emit radiation. Vibrations perpendicular to the surface have a large component in the direction of the reflected light and emit much less radiation. There is one angle where reflected light is 100 percent polarized, but it's not 45 degrees. It depends on the index of refraction of the material but is typically about 30 degrees.

Can you in the time remaining determine IR polarization? Do you have a pair of polarized sun glasses to experiment with? You could polarize the IR emitter with a filter and then look only at light where the polarization is rotated. That is, set the receiver filter to block light of the same rotation as the emitter? EDIT: Oops. Foggy thinking. The underlined sentences are wrong. Reflection should polarize the light, not rotate the the plane. So all you need to do is put the filter over the receiver and rotate for maximum signal from the surface. MAYBE

3) Use a different wavelength -- one that is absorbed. Possible. Might be done with a near IR fluorescent material over the emitter. I don't know off-hand whether such materials are available. Near IR photochemistry was not a subject we studied when I was in school. There would be a lot of work to do to make it work. PROBABLY NOT PRACTICAL

4) Increase top surface reflection relative to reflection from other interfaces. We have briefly touched on that possibility here. Geometry could be a killer, but the lecturer did not mention that as a restriction. So you might look at a design based on a relatively large, minimum diameter for the container. The critical angle for water is: 48.6°. Therefore, the minimum diameter for 80 cm distance with sensor in the center is = 2X92cm= 184 cm (i.e., 2X80Xtan(48.6)). If it were placed asymmetrically, then the diameter could be smaller. However, you need to exceed the critical angle to get the beam to emerge from the surface. I believe this is an option, but it leads to some possibly implausible constraints on the vessel, will be hard for you to test at home, and will require carefully aligned mirrors and different math in your program. HARD TO GET A WORKABLE MODEL IN THE TIME AVAILABLE

5) Assume that the unwanted reflections will always give a larger apparent distance (premise). If that is the case, and if your detector gives various sampled values over time, you might choose to write code that would only consider the lowest value in, say, 10 determinations. I am not sure the premise is true, because there are multiple reflection paths. How will you know that the reported set of values includes at least one from the surface? Ripples will kill this method. PREMISE PROBABLY NOT TRUE

So, I vote for #2 or #4 with #2 being the more elegant, if you have the polarizers and if they pass the near IR that you are using.

Other ideas? I'm stumped.
John
 
Last edited:
Wed 21st OCT Second Interim Report and Presentation.
Thu 22nd OCT DP refusals posted on the Departmental notice board.

Well i never start with my report yet. I am waiting complete my exams. That will be this Thursday. Anything I include in PHASE2 report...is binding....& i will have to demonstrate it in the Final phase3.


Thanks for taking your time Jpanhalt to provide me with alternative solutions......
I do not have polarizers...I will have to get them. Its 20:17 at the moment....
I need to go over a few more things for my exam...will be here often from Thursday
 
Last edited:
There is a chance that polarized sun glasses will work. Otherwise, that link I gave gives some commercial sources. So-called photography gels and some crystals might also work.

I think it might be the best option and is most consistent with the response you got from the lecturer.

John
 
Have you tried making the bottom of the container CLEAR?? Technically that's non-contact because you are not putting something foreign in the water. The clear plastic bottom of the container when wetted with the water will probably not reflect much IR at all but instead pass it through.

Also the chance of detecting the bottom of the container is reduced as it nears the end of the range. I was using a 4-30cm range device and with the bottom of the container close to 30 it was much more likely (much easier to find the positioning sweet spot) to detect the water. If you are using a 10-80cm device and the bottom of the container is near 40cm the bottom of the container then the BOTTOM of the container is in it's optimal zone for detection.

You might also look into using both a 4-30cm sensor and a 10-80, and interpreting both results with the PIC. You could set each sensor up to work in its sweet spot where it detects the water. Or maybe use 2 sensor both 4-30 and mount at different heights.

Ie if the bottom of the container is 40cm in my tests the 4-30cm sensor always got the surface reflection, ie much better reliability, as the bottom of the container reflection was outside the focal/geometry range of the sensor lens.

If you are finding it hard to get the reading reliable I think you might be using the 10-80cm sensor with the bottom of the container much closer than 80cm....
 
Last edited:
Have you tried making the bottom of the container CLEAR??
Well not with the latest code for the detector. I did most of the testing with a glass container....
I think you might be using the 10-80cm sensor with the bottom of the container much closer than 80cm....
Yeah, the bottom is usually 27-37 cm from the sensor

I will use a longer plastic container and test the detector....
 
Just more info on polarizing sunglasses and reflection of light:



Mark Severn asked the Naked Scientists:

Hi All

Love the show and listen to it every week via podcast.

I have a question about polarising sunglasses. I am a keen fisherman and use polarising sunglasses to help me see into the water and spot fish. I understand that they work because the light reflected off the water is polarised horizontally. The sunglasses block this horizontally polarised light. The same effect can be seen with the windscreen of a car and when viewed with polarising lenses it makes it possible to see an oncoming drivers face more clearly.

So why can I still see a reflected image in a mirror? If all reflected waves are horizontally polarised, that is parallel to the reflected surface, should not the light be blocked by the sunglasses as well?

Water is, essentially, an insulator. Light is reflected at an air / water interface due to the change in refractive index. The amount of reflection for normal and parallel polarisation is different (particluarly at oblique angles) which is why polaroid glasses work. You've already lost one polarisation component (50% ) before the glasses get in the way -they just get rid of the other component.
The reflection in a mirror is due to the metal silvering having very high conductivity. Reflection of all polarisations at a highly conducting surface is the same , giving you almost 100% reflection.


Not all reflected waves are horizontally polarised, but only those reflected in an almost horizontal plane. When light from the sun is reflected off a windscreen or a water surface, it is polarized with the same plane of that surface; if you have, instead, a mirror or another reflecting surface near the road, for example, which is put in vertical and a source of light which doesn't come from above but from the road, then light is polarized vertically and you would see the reflection completelly; but you understand that such a situation is very unusual, you should have, for example, lights from a car's lamps reflected off a window (during the night) or something of that kind.
Anyway, remember that even if the surfaces are horizontal, reflected light is not completely polarized; this would happen only at a specific reflection angle: "Brewster's angle", which, for glass is about 56°:
Brewster's angle - Wikipedia, the free encyclopedia

Hi Lightarrow

Are you saying that the only light reflected from a transparent surface is likely to be polarised in the same plane as the surface, and any other polarisations are likely to pass through the surface or be absorbed? Where as a Mirrored surface will reflect all polarisations? I did check the Wiki entry but don't quite understand what is going on in relation to my question.


Yes, semplifying it's that way. What you say however happens only for a specific incidence angle, as I said, the Brewster's angle; at other angles, the light is not totally polarized (along the plane of the surface) but however is prevailingly polarized in that direction.
**broken link removed**

In the following video the reflecting surface is in a vertical plane, so light reflected off it is prevailingly vertically polarized: a laser emits horizontally polarized light and the reflected light is very low, near brewster's angle:
**broken link removed**
 
The polarizing glasses don't work..........:(

I used a bigger container this time as suggested by MR RB and moved the sensor until the LCD measurement reading was = the level of water in the container......

Then i fixed the sensor at that angle & position & varied the liquid level and took more readings.....

The sensor does detect the water surface....& the liquid level measurement is right BUT ,thereadings fluctuate quite a bit whilst varying the liquid level even after averaging 4 readings..................



i know it fluctuates because the water is not still whilst i vary the liquid level...is there a better way to prevent fluctuations ???
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top