I am going to buy a SODAQ R410 or R412 board to test NB-IoT connectivity for sensors for environental monitoring.
Before I buy a board I want to be sure that I can get data from a sensor with RS232 output (not real RS232, but 0-3,3V) into it. My first particular case is a MaxBotix ulttrasound distance sensor.
Can somebody confirm that this will work. Which pins are to be used for Rx/Tx from the sensor?
I am quite new to Arduino-like developer boards. Since I am electrical engineer with lot of experience with sensors and M2M solutions I hope to manage a steep learning curve.
Thanks for your help
Most of the SODAQ boards have at least 1 or 2 UARTs available. These operate with 0-3.3v LVTTL levels, where 0.0V is LOW and 3.3V is HIGH.
The RS232 signal is a bit different. Given an operating voltage of 3V, LOW will be +3V and HIGH will be -3V. You will need a converter as the signal needs to be inverted and the low needs to be clamped to 0.0V.
Some Arduino boards (such as the UNO) operate with 5.0V logic levels. The SODAQ boards however, all use 3.3V.
You may cause damage if you apply a voltage higher than 3.3V or lower than 0.0V to any of the IO pins (the absolute maximum rating is VDD + 0.6 or 3.9V, and similarly 0.0V - 0.6V or -0.6V).
That sounds good since my sensor uses 0-3.3V levels.
Is there any sample code available to get RS232 LVTTL communication running?
If it is RS232 you will still need a converter, at the very least to invert the logic levels.
This tutorial here gives an overview of communicating over a UART from Arduino. In this specific example it is communicating with a host PC, but the process is the same for other UARTs.
Ok, maybe I need to use a MAX-232 then.
I figured out that the ATSAMD MC has SERCOM interfaces than can be used as USART, SPI or I2C. One pair of these pins is connected to the groove connector J3 on the Sara board. This groove connector is labeled as I2C connector. Can this be redefined to USART?
Maybe it is easeier to use an external RS232 to I2C converter.
Any sugestion what is the best way to read data from a RS232-sensor and getting data vi NB-IoT to a cloud?
A stack of a standard Arduino-like board with a NB-IoT shield and a UART shield maybe another way to go.
I really appreciate help for the decision.
Which board are you using? (SARA AFF?)
Yes, Sercoms can be mapped to UART, I2C or SPI, but not easily. However, there is usually at least one available UART on most boards. On the standard Arduino pin out this can be found on pins 0/1, and the UART instance is named Serial.
I have no board so far. I consider buying a SARA AFF R410M but I was in doubt because I need to get it running with the RS232-ish sensor.
I would appreciate if you could give me a recommendation for a suitable board. I need NB-IoT.
Each of the SODAQ boards have at least one UART available. For example the SARA R410 AFF, has two UARTs, but one is used for the Ublox R410 module. The other is available on D0/D1.
The schematic can be found on the support page, but here is a link to the specific image:
Thanks. I think I will go for a SARA AFF R410M.
I assume it is possible to use a Arduino-compatible RS232-shield.