Now comes the most challenging part of this entire article: wiring the logic side, the sensors and the Arduino together. Even though we are using two shields (LoRenz shield and ROHM Sensor Evaluation Shield), there’s quite a lot of modules to connect. Here’s a Fritzing diagram of the wiring. Please note that the ROHM shield isn’t shown in the diagram, since it would cover most of the other connections.
Kind of a mess, isn’t it? All of the components are powered from the Arduino 5V regulator, with an exception of the motor drivers, which are powered directly from the battery. That is also the power source for the Arduino itself. With that out of the way, let’s take a look at all the important connections separately. I recommend connecting the modules one at a time and testing each new connection you make.
|Sensor Name||Shield Slot|
Because interrupt pins 2 and 3 are already used by LoRenz, we can’t simply select them by shorting some pins on the shield (for more information on how interrupts work on the ROHM Sensor shield, please refer to RohmMultiSensor wiki). BM1422GMV is in the slot I2C_1, which is connected to INT1. So, we’ll connect INT1 to Arduino pin 18, which has interrupt support. Similarly, KX022-1020 is in the slot I2C_2, connected to INT3, which we will connect to Arduino pin 19.
Did you make it this far? Great, because that was the most difficult part of this article! When you’re done wiring, you should end up with something that looks a little bit like this: