Data plan calculation

I am calculating the data plan i will need to send data from an Arduino MKR NB 1500 to the cloud.

I am wondering if my calculation is correct, any feedback is appreciated.

Let's say we want to send 2 integer values every second. An integer value on this board uses a 32 bit value. So a total of 64 (32*2) bits are needed, which comes down to 8 bytes (64/8).

There are 2.592.000 seconds in a month. So a total of 8 * 2.592.000 = 20.736.000 = 20.7 MB

I suspect there are extra bytes needed in every packet send, does anyone have an estimate for this?

Thanks in advance!

Sure, depending on the packet format, it could be anything from 1 to 12848794. :slight_smile: What is the format?

Are you designing the packet? If not, what software does it belong to?

I have no idea what you mean by packet format. Could you explain this?

I would like to send data from this arduino board to the arduino IoT cloud using a sim card which works on the LTE-M network. So i don't understand in what you mean by 'what software does it belong to?' Do you mean the encryption that is used?

I'm flummoxed because you brought up the subject of packet, not me. How are you planning to send the values from one place to another? I mean, how will you send the data, not on what device or over what communications medium?...

How will you send the data

Hmm using some arduino code of course, I really have no idea what you mean.

There are lots of tutorials ( Your Environmental Data on Arduino IoT Cloud - Arduino Project Hub) which shows you how data can be send to the IoT cloud, with some simple code like this:

temp = readTemperature();

Sorry for not understanding, but i am new to this kind of stuff.

What does the documentation on the IoT cloud software say about the transport mechanism?

1 Like

I am very pleased to launch the public beta release of the Arduino IoT Cloud with automatic dashboard generation, Webhooks support, and full TLS secure transport.

I have also seen MQTT somewhere, but i am not familiar with these terms to be honest

What do they say about the TLS secure transport?

(do you see how this method of enquiry works?) :slight_smile:

Or, have you Googled "TLS transport"?

  • Each record contains a 5-byte header, a MAC (up to 20 bytes for SSLv3, TLS 1.0, TLS 1.1, and up to 32 bytes for TLS 1.2), and padding if a block cipher is used.

So if i understand this correctly a minimum of 5 + 20 = 25 bytes are added to the packet size, which is quite significant. And 5 + 32 = 37 bytes if TLS1.2 is used

Thanks for the help!

1 Like

I acutally think the MQTT is used now, and this protocol uses the following, which is way better compared to the amount of bytes :slight_smile:

The MQTT packet or message format consists of a 2 byte fixed header (always present) + Variable-header (not always present)+ payload (not always present).

Also, what is the actual range of the integers you are sending? Surely not the full 0-4294967296? What is the largest integer value you need to send?

Are there significant periods of time when the same values are sent (they don't change)?

1 Like

I'm not saying you're wrong but you need to check if the MQTT packets are sent 'as is' over a mobile connection or if they are inserted into whatever packet format the mobile connection uses. If the former then no problem, if the latter the you have additional overhead bytes from MQTT. The MQTT packets have to survive in tact to the MQTT broker, not get stripped off by some part of the connection you are using, so I suspect, but do not know for sure, that the latter scenario is the one you need to consider.

1 Like

Do values actually have to be sent every second or just recorded? What about collecting data and sending it at a lower frequency (every minute/hour) to reduce the overhead?

1 Like

Do values actually have to be sent every second or just recorded? What about collecting data and sending it at a lower frequency (every minute/hour) to reduce the overhead?

Ya i was thinking exactly the same and that is most likely what i will end up doing, thanks for the tip! Arduino will arrive shortly so i can actually start testing :smiley:

No i surely don't need the full range, but the board uses a 32 bit integer right? or is it possible to use a 16 bit integer?

You can use an int16_t or an uint16_t: that's going to be platform-agnostic. Or, if you want to send 32-bit values, you can marshal 2 values into a 32-bit integer and send that in one go. Depending upon your actual range of values, you may even be able to fit 3 values into a single 32-bit integer and have room to spare for a parity bit, etc.

1 Like

How about telling us what that range is, you could have done that with a few more characters...