GrovePI Port to use


#1

Hello all,
I’m currently using 3 different sensor for my Lab Project

  • Air Quality Sensor v1.3 – SKU 101020078
  • Temp&Humi Sensor – SKU 101020011
  • Gas Sensor(MQ3) – SKU 101020006

If i look at the python script for each of them a specific port needs to be connected for each of them, however Air Quality and Gas Sensor seems to have the same port A0.
I assume that i can change the value in the python script but how to make the difference between A2 and D2 ? since the script only states a number ?

Thank you all for your input ?

Williams


#2

What python script is it?


#3

Hey Kevin,
I would like to adjust the Air Quality script in order to use the port D7.

NOTE: # Wait 2 minutes for the sensor to heat-up

import time
import grovepi
from datetime import datetime

Connect the Grove Air Quality Sensor to analog port A0

SIG,NC,VCC,GND

air_sensor = 0
now = datetime.now()


#4

A sensor is either Analog or Digital - so you can’t put an Analog sensor (such as the Air Quality and Gas Sensor) into a Digital port and assume it will work. Best to stick with the appropriate port types.

As far as I know, you can move sensors between ports of the same type. In the example you pasted, they tell you to put the sensor in port A0, simply so the code doesn’t need to be updated. If you put the sensor in A1, then modify the air_sensor variable to be 1, then the script should work.


#5

Thanks quasipickle for the precision.

Williams