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

Read external sensors with UART interface

Basically, it can be divided into two cases

Reading/sampling TX pin of the sensor (since usually nothing is sended back)

Send/Read possibility - in case of range switching/calibrating/programming

How easy/or how difficult is to have additional UART. I guess the only one is dedicated on the Bluetooth connection, and on first glance I don't see any UART connections. May be another serial standard as I2C will be OK, but there is sensors which really has only UART.

  • Sorry Dimitar but your question sounds confusing. What do you mean by UART exactly? Do you refer for Nordic BLE UART Service (NUS) which is just "something like UART over BLE radio and stack on top of GATT layer" or to physical wired UART interface? They have almost nothing in common (meaning that NUS is just "emulating" UART data transfer experience over BLE but it can be fed by data independently on wired UART interface which you can use on nRF5x chip for whatever else if you need).

    If you need two physical wired UART connections (e.g. to two peripheral chips like sensors which don't support SPI or IC) then you have a problem. You might try to emulate UART by bit banging GPIO pins inside your FW but that will work only if you will use this "interface" when nothing else is running (especially no BLE activity like Connection events) and when the baud rate will be low. Most of people facing this dilemma with nRF5x chips (which have only one native UART HW block) solved it by choosing different components support SPI/I2C or by using another multi-peripheral general purpose (low power) controller which served all these chips and then it aggregated all the data into one wired protocol with nRF5x (SPI is usual option due to speed).

    Cheers Jan

  • What chip do you have? There is 1 UART on the nRF52832. If you need 2 UARTs, you should go for the nRF52840.

  • Thanks Jan, I am quite a newbee in Nordic Thingy:52 (heard yesterday from a colleague of mine). I want one to have only one physical UART, and data received on it (very slowly, it is air quality parameters) to "fuse" with all other data from sensors onboard. Two serial ports will be quite advanced.

    Then of course read and log already "fused data".

    Of course I am also interested to add other analog/digital (SPI, I2C, 1 wire) inputs and may be outputs for external sensors and actuators.

    I guess it should work, but in anycase decide to ask on first place. Will order my devkit probably today :)

    Let me know what you think!

  • Yes, one UART should be enough. I added an answer below, quite a newbie in this place.

Related