Start here

Hi,

I am totally new to PICAXE. I am trying to make the start here robot which use an IR long range sensor. As far as I know, the sensor returns an analogue voltage corresponding to the distance measured. So, from this voltage level, how can I know what the distance is. I mean, I want to make my bot stop 10cm away from an obstacle. In the code provided in the start here page, the distance is simple provided with the coding like symbol dangelevel=70; How can the microcontroller understand the distance depending on the voltage level. Moreover, different sensors return different voltage levels. Please clear my query.

Plus I want to know what an LCD driver IC really is. I know that most LCD displays need micros with atleas 6 outputs. Is the IC used when I am short of the requirednumber of output pins?

Thanks.

Well…

This is a typical case of "send me the codes"

But since this is LMR, I’ll try and point you in the right direction.

The concept you are looking for is "Calibration"

Let me google that for you: http://lmgtfy.com/?q=calibration

Yes, like Stormbringer

Yes, like Stormbringer said.

Dan_M has a fine example here:

https://www.robotshop.com/letsmakerobots/node/31733

No need to be an ass about

No need to be an ass about it.

Agree…I think this kind of

Agree…

I think this kind of answer afraid new users away… The question is not lazy at all…

Not to mention typing

Not to mention typing “Calibration” as a google search won’t turn up any helpful results for the original poster. It should have been something like “robot ir sensor calibration”. Shame on you :slight_smile:

 

As for the original question, sorry I can’t be of much help at the moment with PICAXE as I’m still learning it myself, but if the poster would search for picaxe forums, they might have an answer over there since it’s more focused on that specific microcontroller.

"So, from this voltage

"So, from this voltage level, how can I know what the distance is"
This is simple, measure a distance you know. 10 cm, for example. Verify the analogue voltage that sensor returns. Do it again with 20 cm and 30 cm… calculate the voltage diference between this tests, now you can make a simple table of values  :smiley:

 

 

Maybe I am an ass

I just hate lazy unknowledgeble people.

They never learn. That is exactly why I gave him a link to a more general concept, I was hoping he may accidentaly think for himself.

There certainly are a lot of those about

But I don’t think the question in this case is unreasonable. Having been the grumpy old man a couple of times myself, I know where your coming from. But yeah I have seen the “please send me the codes” one many times. I wonder how many send the codes, lol.

Danger might be 70 to some but others may think 50 is dangerous

The mcu converts the voltage to a number. Most adc’s in mcu’s are 10 bit. This gives a range of values of 1024. You can also choose to work with an 8 bit(range 0 to 255) value from the registers for the adc. Sometimes it is more convenient to do this in an 8 bit micro.
Dangerlevel= 70 is the number chosen after testing different values to see how far away it stops. The accuracy is affected by the reflectivity, scattering and absorbing properties of the surface. Black absorbs more light than a white surface and a shiny surface will reflect more light than a matte surface. A smooth surface will scatter light consistantly compared to a rough surface.
As far as your question about lcd drivers goes there are a number of answers to this. The common 16x2,8x2 type displays have driver chips on them that handle the more complicated voltage levels the lcd requires. But this still leaves a lot of lines required to drive them. Up to 8 for data and 3 for control.
Some lcds come with an extra driver chip that allows you to control them with just 2 lines. These are serial or I2C type displays.
There are countless other ways to reduce the number of lines needed to control them and there are many places you will find this information on the net.
Most favour the serial enabled lcds for ease of use.

You hate lazy people? Your

You hate lazy people? Your own post was lazy and unhelpful to the contribution of the post.

You hate unknowledgable people? Then why are you here? Not only does your type of attitude scare off beginners or those interested in the field but don’t know where to begin, it also is demeaning to the livelihood and spirit of LMR.

Re-read the OP’s post and see for yourself that there was nothing lazy or unknowledgable about it; simply someone looking for help from those with more knowledge than themselves. Something that you, apparently full of knowledge and wisdom on robotics, should be able to help with.

Lets not get carried away

I think what would be sad is if we get too caught up on one comment instead of trying to help the original poster.