RM3100 Arduino Quick Guide
RM3100 Arduino Quick Guide
com
Santa Rosa, CA 95407-5437 USA 707-566-2261 fax
Software
Arduino IDE
I. RM3100 Test Boards Pin Assignments (Pin numbers run counterclockwise from top left)
Note: Pin 1 is next to the top left white triangle.
Pin# Pin Name Description
Page | 2
Nov 24, 2021
PNI Document
Picture of RM 3100 Breakout Board below:
a. Note: If you are using a regular Arduino board (Nano, Uno, Mega, etc.) you will
have to find the correct corresponding pins from your specific board’s data sheet
as they will be different from this table below.
Page | 3
Nov 24, 2021
PNI Document
Pin# Pin Name Description
Red box above highlights the pins used for I2C and SPI communications on NUCLEO-L152RE
Page | 4
Nov 24, 2021
PNI Document
III. I2C Interface. Connect RM3100 I2C pins to Arduino I2C pins, like in the following table.
Note: If you are using I2C, you may have to enable the internal pullup resistors in the
code for your specific board. The sample code successfully enables pullup resistors for
the NUCLEO-L152RE board specifically and hasn’t been tested with other boards such as
the Arduino Uno or Arduino Mega. You can also use external 4.7k Ohm pull up resistors
on the SCL and SDA lines instead of the internal resistors.
Page | 5
Nov 24, 2021
PNI Document
IV. If SPI interface is desired, please connect RM3100 SPI pins to Arduino SPI pins, like in the
following table.
Page | 6
Nov 24, 2021
PNI Document
3 INSTALL ARDUINO IDE SOFTWARE
I. To use the demo code, you will first need to have the Arduino IDE installed. If you don’t
have it installed, here is a link to version 1.8.16 of Arduino IDE. You can also check the
IDE downloads page to see if there are any newer updates but the demo code was
written on version 1.8.16, so it may be incompatible with newer versions. Open the
*.exe and install the program using any settings you want.
II. If you are using a STM 32 board (like the NUCLEO-L152RE in this guide) then you must
install the STM 32 board package first. If you are using a regular Arduino board (UNO,
Mega, etc.) you can skip to step III.
a. Open the Arduino IDE program and in the toolbars press File > Preferences
b. In “Additional Boards Manager URLs:” copy and paste:
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicro
electronics_index.json and press OK to close the Preferences window
Page | 7
Nov 24, 2021
PNI Document
c. In the toolbars press Tools > Board: > Boards Manager
d. Search “stm 32” and install the latest version of “STM32 MCU based boards”
then close the Boards Manager page
e. Now select the corresponding NUCLEO board group in Tools > Board: and then
the specific board in Tools > Board part number:
f. Finally while the Arduino is connected to the PC, press Tools > Port and pick the
USB port the Arduino is connected to (this should be something similar to “COM
6” or “COM 3”). Your “Tools” dropdown should look something like this:
Page | 8
Nov 24, 2021
PNI Document
III. If you are using a standard Arduino (Nano, Uno, Mega, etc.), open the Arduino IDE
program and in the tool bar press Tools > Boards and choose your specific Arduino
board. Also, while the Arduino is connected to the PC, press Tools > Port and pick the
USB port the Arduino is connected to (this should be something like “COM 6” or “COM
3”). Your “Tools” dropdown should look something like this:
Page | 9
Nov 24, 2021
PNI Document
II. The red box above highlights the options you can change.
a. The option initialCC is the cycle count you want the RM 3100 to measure in.
i. The internal clock count of RM3100 MagI2C ASIC establishes the number
of sensor oscillation cycles. The number of oscillation cycle is “Cycle
Count”. Cycle Count as default value is 200 or 0xC8 in hex.
ii. Increasing the cycle count value increases measurement gain and
resolution. Lowering the cycle count value reduces acquisition time,
which increases maximum achievable sample rate or, with a fixed sample
rate, decreases power consumption.
iii. The minimum value is ‘0’ and the maximum is 65,536. However,
quantization issues generally dictate working above a cycle count value of
~30, while noise limits the useful upper range to ~400 cycle counts.
c. The option “useDRDYPin” is used to decide which method to use to wait for data
to be ready
i. Setting “useDRDYPin” to “0” will make the Arduino read from the internal
status register to see if data is ready
ii. Setting “useDRDYPin” to “1” will make the Arduino read from the
Pin_DRDY (pin D9) to see if data is ready
1. If you use the DRDY pin then you must have pin D9 connected to
RM 3100 pin 5 (DRDY)
Page | 10
Nov 24, 2021
PNI Document
III. Once you have the desired options selected, press upload button (Outlined in red in the
top left of the image below) to verify and upload the code on to the Arduino
a. You can also use “Ctrl + U” or press Sketch > Upload to upload
IV. After the code is uploaded to the Arduino, press the orange highlighted button in the
top right of the image above or press Tools > Serial Monitor or “Ctrl + Shift + M” to open
the serial monitor. This is where the output of the RM 3100 will be printed
Page | 11
Nov 24, 2021
PNI Document