This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Assistance with programming NRF52840 dongle + accelerometer + infrared + arduino

Hi

Im currently having some problems with programming a solution for a small system that im making. 

The idea is a mailbox with a dongle and accelerometer that senses movement, if any turn on infrared to see if anything change from "empty state". If change, send pulse to  a "central" inside with another dongle connected to arduino + LCD.

The reason that infrared is off most of the time is that the system is powered by solar so to save energy im turning it on with movement. 

I have completed code for arduino, 

Schematic for the mailbox (the resistors on the right is just for testing since the battery bank has an internal currentmeter so to test we had to use more amps) :

Schematic for central inside.

I've tried to use blinky as a starting learning reference since I could find a youtube video about it. But as far as implementing accelerometer and infrared im having problems.

I am using VScode + makefile. 

Is there any examples that may be better suited for this project? Im not experienced with coding for embed, only done a few arduido projects in the past. 

Any help would be greatly appreciated

Parents
  • Hi,

    I would recommend that you start out with the TWI Sensor example for interfacing the I2C devices. You will have to read the datasheets of the sensors, to figure out which registers to read/write. When you have managed to implement a correct interface to the sensors, you can integrate your work with a BLE example, for instance, ble_app_uart or ble_app_blinky.

    Note that the nRF52840 Dongle is not recommended for development projects, as it does not have any debugging interface. You should consider getting an nRF52840 DK where you can develop the application. When you have completed development, it is simpler to migrate the code over to the Dongle.

    Best regards,
    Jørgen

Reply
  • Hi,

    I would recommend that you start out with the TWI Sensor example for interfacing the I2C devices. You will have to read the datasheets of the sensors, to figure out which registers to read/write. When you have managed to implement a correct interface to the sensors, you can integrate your work with a BLE example, for instance, ble_app_uart or ble_app_blinky.

    Note that the nRF52840 Dongle is not recommended for development projects, as it does not have any debugging interface. You should consider getting an nRF52840 DK where you can develop the application. When you have completed development, it is simpler to migrate the code over to the Dongle.

    Best regards,
    Jørgen

Children
No Data
Related