Joy-it SEN-GP2Y1014AU User guide

3
SEN-GP2Y1014AU
Optical Dust sensor
Veröffentlicht: 17.05.2019 Copyright by Joy-IT 2
3
INHALTSVERZEICHNIS
1. Introducon
2. How to use with RaspberryPi
2.1 Wiring
2.2 Installaon
2.3 Code Example
3. How to use with the Arduino
3.1 Wiring
3.2 Code Example
4. Informaon and Take-back Obligaons
5. Support
Veröffentlicht: 17.05.2019 Copyright by Joy-IT 3
3
1. Introduction
Dear customer, thank you for choosing our product.
In the following, we will show you what to observe during the use.
If you encounter any unexpected problems during use, please do not hesitate to contact us.
Veröffentlicht: 17.05.2019 Copyright by Joy-IT 4
3
2. How to use with the RaspberryPi
2.1 Wiring
2.2 Installation
Because this sensor is using an Analog signal, you need an Analog Digital converter. We recommend our ADC the KY-053.
Use the following command to install the required library:
Now you can use the Analog Digital Converter.
Raspberry Pi GP2Y
3v3 (Pin1) VCC GND (Pin 6) GND BCM17 (Pin 11) LED A0 (ADC) Out
sudo pip3 install adafruit-circuitpython-ads1x15
Raspberry Pi ADC
3v3 (Pin 17) VDD GND (Pin 14) GND SCL (Pin 5) SCL SDA (PIN 3) SDA
Veröffentlicht: 17.05.2019 Copyright by Joy-IT 5
3
2.3 Code Example
#!/usr/bin/python # coding=utf-8
import time import board import busio import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM) LED_Pin = 17 GPIO.setup(LED_Pin, GPIO.OUT)
# Create the I2C bus
i2c = busio.I2C(board.SCL, board.SDA)
# Create the ADC object using the I2C bus
ads = ADS.ADS1115(i2c)
# Create single-ended input on channels
chan0 = AnalogIn(ads, ADS.P0) chan1 = AnalogIn(ads, ADS.P1) chan2 = AnalogIn(ads, ADS.P2) chan3 = AnalogIn(ads, ADS.P3)
while True:
# print("channel 0: ","{:>5}\t{:>5.3f}".format(chan0.value, chan0.voltage)) #print("channel 1: ","{:>5}\t{:>5.3f}".format(chan1.value, chan1.voltage)) #print("channel 2: ","{:>5}\t{:>5.3f}".format(chan2.value, chan2.voltage)) #print("channel 3: ","{:>5}\t{:>5.3f}".format(chan3.value, chan3.voltage)) #print("---------------------------------------------------") # time.sleep(1)
GPIO.output(LED_Pin, False) time.sleep(0.000280) dustVal=chan0.value time.sleep(0.000040) GPIO.output(LED_Pin, True) time.sleep(0.009680)
time.sleep(1) if (dustVal>36.455): print(((dustVal/1024)-0.0356)*120000*0.035)
Veröffentlicht: 17.05.2019 Copyright by Joy-IT 6
3
3. How to use with the Arduino
3.1 wiring
3.2 Code Example
int dustPin=0; float dustVal=0; int ledPower=2; int delayTime=280; int delayTime2=40; float offTime=9680;
void setup(){
Serial.begin(9600); pinMode(ledPower,OUTPUT); pinMode(dustPin, INPUT); }
void loop(){
digitalWrite(ledPower,LOW); delayMicroseconds(delayTime); dustVal=analogRead(dustPin); delayMicroseconds(delayTime2);
digitalWrite(ledPower,HIGH);
delayMicroseconds(offTime);
delay(1000);
if (dustVal>36.455)
Serial.println((float(dustVal/1024)-0.0356)*120000*0.035); }
Arduino GP2Y
5V VCC
GND GND D2 LED A0 OUT
Veröffentlicht: 17.05.2019 Copyright by Joy-IT 7
3
4. Information and Take-back Obligations
Symbol on electrical and electronic equipment
This crossed-out dustbin means that electrical and electronic equipment does not belong in the household waste. You must return the old appliances to a collecon point. Before handing over waste baeries and accumulators that are not enclosed by waste equipment must be separated from it.
Return opons
As an end user, you can return your old appliance (which essenally fulls the same funcon as the new appliance purchased from us) free of charge for disposal when you purchase a new appliance. Small appliances with no external dimensions greater than 25 cm can be disposed of in normal household quanes independently of the purchase of a new appliance.
Possibility of return at our company locaon during opening hours
Simac GmbH, Pascalstr. 8, D-47506 Neukirchen-Vluyn
Possibility of return in your area
We will send you a parcel stamp with which you can return the device to us free of charge. Please contact us by e-mail at Service@joy-it.net or by telephone.
Informaon on packaging
If you do not have suitable packaging material or do not wish to use your own, please contact us and we
will send you suitable packaging.
Veröffentlicht: 17.05.2019 Copyright by Joy-IT 8
3
5. Support
We also support you after your purchase. If there are any questions left or if you encounter any problems, please feel free to contact us by mail, phone, or by our ticket -support-
system on our website.
E-Mail: service@joy-it.net Ticket-System: http://support.joy-it.net Phone: +49 (0)2845 98469 66 (11- 18 oclock)
For more information, please visit our website:
www.joy-it.net
Loading...