Method for Collecting Data from 12 Magnetometers

Project description:

12 magnetometers need to send MagX, MagY, and MagZ values to 1 computer. Each sensor is operating on I2C protocol.

Methods I have considered:

One Arduino attached to each sensor. All 12 Arduinos would need to send data to one Arduino Mega.Can I do this with SoftwareSerial? How slow is SoftwareSerial? How long would it take for each round of readings? I understand that SoftwareSerial can not read from different sources simultaneously. The Mega wouldn't be SENDING data. Only receiving.

i2C multiplexer(s) I have no experience with these and have more "peace of mind" with individual Arduinos for each sensor. The sensors are several feet apart from one another and I feel like this would require more cable spread across the project space.

What are some other options? Is an Ethernet hub a possibility? All data is being sent into Max/MSP.

Thank you!


Using a separate Arduino for each board is expensive and tedious to maintain, and comes with its set of disadvantages, talked about in quite a few other threads which I just can't seem to find right now. The I2C multiplexer sounds like a convenient and cheap option, considering that you need only one bus going to your main Arduino. If you have the option of using an alternate I2C address on your modules, you could maybe use an 8-channel multiplexer with two devices on each bus, with six buses. This thread looks useful:

Hope this helps.

Why would you leave out important information like which magnetometer?

If it is one which has a choice of 2 I2C addresses via a single pin being low or high then it is easy: connect those 12 pins to your Mega, set all of them high except for the one you wish to talk to. Only use the 'low' address to talk to the magnetometers.

If each sensor is in a close remote location from the main uConstoller you'd need to, obviously, work out an idea of how to do the thing.

Something to consider:

With the thought that each sensor is remote, but close by, I'd use STM32 BluePills to process the sensor data and CAN buss to propagate the data to the main collection unit.