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.

Measuring voltage levels

Status
Not open for further replies.

windozeuser

Member
I'm building a light chasing robot where it turns into the strongest source of ambient light. I'm using phototranistors as sensors. I was wondering how I could measure the voltage levels of the sensor to determine the weakest and strongest levels already statically defined from past tests with a variable light source.

I'm using an Atmel AT90 and also a Basic stamp trying two different architectures.

Thanks
 
I don't really understand exactly what you're trying to ask... but the way you measure a voltage with a microcontroller is with an analog-to-digital converter. Many microcontrollers have them built in, though I have never used either of the ones you mentioned so I don't know if they do. If not, you could use an external one with a digital interface.

But if all you're trying to do is turn toward the strongest light source, do you even need a microcontroller at all? that task can be performed with nothing more complicated than a comparator... and with just a little more analog circuitry you could make it fancier so when the light levels on the two sensors were relatively close, it would just go straight rather than oscillating left and right...
 
Is it an AT90S8535 or something? I would use ATmega16 instead. They both have ADC's anyway. It's simply the matter of setting a few registers and reading some other registers later on.

I don't follow you quite well either. How exactly did you statically "define" the brightness of the variable light source in past tests? I'm curious about how you interpret the brightness into anything.

The picture in the attachment is what I would do to find the brightest spot. A four quadrant matrix. panels absorb light and helps determining direction of stronger source. Compare average values in two directions to construct a two-dimentional ambient brightness map.
i.e,
if (A+B)/2 > (C+D)/2 Then brightest spot is to the front
if (A+C)/2 > (B+D)/2 Then brightest spot is also to the left

Whether or not you pass some parameters of any kind from former tests, I don't think these "defined" values are going to be of assistance. Coz the problem with absolute values is that they make things less adaptive. Once the environment changes, even slightly, they will have no idea what to do.

Actually you shouldn't have needed to run any "past test", just compare different values and use the relationship, instead of looking into the exact numbers trying to figure out something that won't be the same for ever.
 

Attachments

  • Demo.JPG
    Demo.JPG
    17.6 KB · Views: 120
THanks, well I'm using a micro controller because I plan to add a lot more to it. Anyways, what I did was I got a generic photoresistor and used a variable light source(Ceiling fan with dimmer switch). Then I took the lowest resistance under almost dark conditions, then the highest resistance I could get with the light source to give a rough practical range. Now that I think about it, it was probably redundant and trivial

PS. Yes I'm using an AT90S8515
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top