Using LIS3dh with Thingy52

Hi

I am a student and this is my first project working on BLE. Please keep that in mind.

The end goal is to create a fingerprinting system with a Thingy (nRF6936) as a node. This Thingy currently broadcasts a UUID for gateways to pick up without a connection. The RSSI can then be derived inside the gateways. I am using the 17.1.0 nRF5 SDK

To increase the accuracy, I want to add accelerometer data inside the advertisement packet. Also, I want to make it more low power by sending very slow advertisements when the node isn't moving. 

I couldn't find any drivers for the LIS3dh that work on Thingies. That means I have to use SPI or I²C? 

The problem with this is that I need the pin layout of the Thingy to speak to the accelerometer directly. 

Where can I find these?

I have included the code of my beacon. 

 glass_beacon.zip

Parents
  • Hi Willem,

    For documentation for the Thingy:52, we got most of our documentation on our Infocenter. See this page for Thingy:52. And for the connectors of the Thingy:52, see Thnigy:52 Connectors.

    Some extra useful information can be found at the Thingy:52 Product page: Downloads, such as Hardware files, where you can find a pdf containing all block diagrams for the Thingy. This is often useful for finding pinouts as well.

    I couldn't find any drivers for the LIS3dh that work on Thingies. That means I have to use SPI or I²C? 

    If the sensor is interfaced using either SPI or I2C, it will always have to be interfaced using that communication protocol. Which communication protocol is up to the sensor, see the datasheet for each sensor to find how it can be interfaced.

    A driver for a sensor is premade code that will use said interface for the sensor.
    If you can not find any premade drivers for the sensor, you will have to write your own code to interface the sensor (using for example SPI). This would be called writing a custom driver for said sensor.

    Did this answer your questions?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd

    This would help if I hadn't stumbled upon another problem. Namely, flashing the Thingy. I tried using the pca10040 and pca10056 Makefiles from an example, but it seems that the Thingy uses pca20020. I couldn't find a working Makefile online and making one by myself seems difficult. 

    Any suggestions on how to do this?

    If what I'm trying isn't possible, I'll have to find an external accelerometer and use it on my nrf52840 devkit. 

    Greetings

    Willem

  • Hi Willem,

    See Using the SDK with other boards and our GitHub for Thingy 52 header file.

    Side note:
    We have two different SDKs. The old nRF5 SDK, which you are using, and the newer nRF Connect SDK. See this nRF Connect SDK and nRF5 SDK statement for more information on the difference.
    Personally, I think development for the Thingy:52 would be easier on the nRF Connect SDK, as it has integrated support for the Thingy:52.

    Switching SDK would mean you have to learn the new one, and rewrite any code you have already made. So depending on how much time this would take, it could or could not be worth it. Up to you really, but now you know your alternatives.

    Regards,
    Sigurd Hellesvik

Reply Children
Related