Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with the si7021 temperature and humidity sensor #3

Open
Jasea opened this issue Jul 27, 2015 · 5 comments
Open

Problem with the si7021 temperature and humidity sensor #3

Jasea opened this issue Jul 27, 2015 · 5 comments

Comments

@Jasea
Copy link

Jasea commented Jul 27, 2015

I have been trying to get meaningfull readings from the si7021 sensor using read-bmp180-si7021-right.lua . I found the problem to be due to the incorrect GPOI pins being used in the program. The correct mapping is: VCC - GPIO14
SDA - GPIO12
SCL - GPIO13
This means the following changes need to be made:
Change lines 10 & 11
from
gpio.mode(GPIO13, gpio.OUTPUT)
gpio.write(GPIO13, gpio.HIGH)
to
gpio.mode(GPIO14, gpio.OUTPUT)
gpio.write(GPIO14, gpio.HIGH)
and amend the comment on line 9
change line 14
from
bmp.init(GPIO14,GPIO12)
to
bmp.init(GPIO13,GPIO12)
change line 34
from
si.init(GPIO14,GPIO12)
to
si.init(GPIO13,GPIO12)
When you save and complie and the run the programe you will see the correct Temperature and Humidity value preceeded by a T and H respectivley.
What I still do not understand is why a message is displayed saying that the BMP180 sensor intialised when there is not one on the board.

@mikewen
Copy link
Contributor

mikewen commented Jul 27, 2015

You are using J3 or J4 to connect to the si7021 sensor. If you connect to J5 or J6, you can switch the SDA, SCL pins. If you use J9 or J10 to connect to bmp180 or si7021 sensor, read-bmp180-si7021-right.lua is the connect mapping.

The bmp085.lua library only check if able to initial the I2C bus, did not check if able to read the address, or able to get meaningful data.
Maybe should report the issue to NodeMCU ?

@Jasea
Copy link
Author

Jasea commented Jul 28, 2015

Hi Mike,
I followed your instructions from the Wiki for the I shaped PCB. This shows the sensor being connected to J10, and this is what I did. In order to get the temperature and humidity from from the sensor I had to make the changes to the program.
I used your NodeUSB Pinouts drawing to determine that J3 had GPIO14 GPIO12 GPIO13 and GND on pins 1, 2, 3, 4 respectivley. J10 has D-, D+, VCC, GND and the sensor SDA, SCL, VCC, GND. This all means that the board has GPIO14 and GPIO13 swapped around compared to the program.

@Jasea
Copy link
Author

Jasea commented Jul 28, 2015

As a second thought could you make the drawings that you made for the PCB available to the community?

@mikewen
Copy link
Contributor

mikewen commented Aug 9, 2015

Hi Jasea,

I just updated this Wiki page to include images of universal PCBs:
https://github.com/NodeUSB/NodeUSB/wiki/Use-expansion-PCB-to-add-your-own-nodes

These 2 PCB just lots of 2.54mm 4 Pins headers connect straight to USB connectors.

@rhyde
Copy link

rhyde commented Sep 12, 2015

I second Jasea a clear version of the board and its labels for the main board would be very handy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants