Atmega 16 Project / Dust sensor

Hi all,

I am doing a school electronics project with one atmega16, Lcd 16x2, 2 actuators and a couple of sensors. I am using Bascom-AVR to programme.

I would like to ask if anyone has a code for sharp dust sensor GP2Y1010AU.

http://pt.farnell.com/jsp/Industrial+Co … ku=9707956

Many Thanks :wink:

Hi,

Have a read of the datasheet http://www.farnell.com/datasheets/62649.pdf

Once you are have all the right connections for the supply and led, it looks like the voltage output is proportional to the density of dust, you will want to look at the ADC function in bascom.

Hi, thanks for your answer. Actually I started to work with that sensor last week. I have tested it without micro and now I’m trying to interface it with the mega16. I have done a simple code, just to see the adc changes on lcd, but it doesn’t work. Im using Adc(1). See the code please. I think it would be better to use a timer with 3rd pin but I don’t know how to do that. Could you help me please.

$crystal = 4000000

$regfile = “m16def.dat”

Config Lcd = 16 * 2

Config Lcdpin = Pin , Db4 = Portd.3 , Db5 = Portd.2 , Db6 = Portd.1 , Db7 = Portd.0 , E = Portd.6 , Rs = Portd.7

Config Adc = Free , Prescaler = Auto

Dim A As Long

Dim B As Long

Dim Total As Long

'Config Portc.5 = Output

Config Portc.6 = Output

Start Adc

Cls

Do

Set Portc.5

Set Portc.6

Waitms 0.24

Reset Portc.5

Reset Portc.6

Waitms 0.24

A = Getadc(1)

B = Getadc(1)

Total = A + B

Total = Total / 2

Home

Lcd “ADC(1):” ; Total ; " "

Loop

End

Thanks again :wink:

Hi, I am trying to use this sharp dust sensor for my project. I would appreciate if you could email me the circuitry to make this work. my email address sonenarayana@sify.com