NHS3152 External Sensor Data Acquisition

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NHS3152 External Sensor Data Acquisition

1,198 Views
albertlauyule
Contributor I

Hi everyone,

I am currently want to build an external sensor connected with NHS3152 hoping to read the external sensor sensor value through NFC. The project is similar to the official temperature logger example. Instead using the internal temperature, I hope to read the external sensors made by myself. I have bought a NHS3152 General Starter Kit and and LPC-Link2 board.

As I have limited experience in using Arduino. I am wondering is there any similar firmware/library so I could modify on to perform the function. If there is none, I am wondering if where and how I can start with.

Thank you very much.

Albert

0 Kudos
Reply
5 Replies

934 Views
driesmoors
NXP Employee
NXP Employee

Hi,

At first sight, the code looks OK. Can you attach a scope and see the full communication on the SCL and SDA lines?

You can also start a debugging session to see if HW I2C block issues interrupts on the NHS3100.

Also, double-check the I2C address, the write portion and the read portion of what you are sending from your Arduino board. After glancing through the example code, it looks like you only need to send a single byte, not 4, after issuing the I2C address.

Best,
Dries.

0 Kudos
Reply

934 Views
driesmoors
NXP Employee
NXP Employee

Hi,

We don't provide a high-level abstraction to a generic sensor. In the SDK, examples are provided how to use the I2C and SPI interfaces.

Best would be to abstract away the external sensor, so that fetching sensor data is just one or two functions calls away.

Regards,
Dries.

0 Kudos
Reply

934 Views
albertlauyule
Contributor I

Dries,

Thanks so much for your reply.  May I further ask about what kind of examples are provided to use I2C and SPI interface. Actually, my aim is just to read the external sensor signal via NFC. I think currently do not need to use high-level abstraction.

Thanks so much!
Albert

0 Kudos
Reply

934 Views
driesmoors
NXP Employee
NXP Employee

Hi,

In SDK 11.1 (BETA) you can find the example applications app_example_dp_i2c and app_example_dp_ssp. And in the documentation, under docs/firmware.html , you can navigate to the description of the I2C or the SPI module and find a full description, together with minimalist code on how to use them.

That will hopefully get you started.

Good luck,
Regards,
Dries,

0 Kudos
Reply

934 Views
albertlauyule
Contributor I

Hi Dries,

Thanks for the help! As your suggestion, I have upload the Debug_slave/app_example_dp_i2c onto it and pressed 'reset'. Then I tried to use Arduino Uno to communicate through I2C by one of its slave address 0x01. But unfortunately I can not get any response. Did I miss any step to establish I2C?

If it helps, here is the Arduino code I used:

pastedImage_3.png

Your advice is much appreciated. 

Regards,

Albert

0 Kudos
Reply