Connecting 2 AK9753 to one Arduino Uno

I want to connect 2 AK9753 Human Presence Sensors from Qwiic to one Arduino Uno.
I tried to do this as did someone else on the forum: Help with SparkFun Human Presence Sensor Breakout - AK9753 but I keep getting a message:

Device_2 not found. Check wiring.

I am posting the code below:

#include <Wire.h>

#include "SparkFun_AK975X_Arduino_Library.h" 
AK975X movementSensor1; //Hook object to the library
AK975X movementSensor2;

int ir1_1, ir1_2, ir1_3, ir1_4;
int ir2_1, ir2_2, ir2_3, ir2_4;

void setup()
{
  Serial.begin(9600);
  Serial.println("AK975X Read Example");

  Wire.begin();

  //Turn on sensor
  if (movementSensor1.begin(Wire, I2C_SPEED_STANDARD, 0x64) == false)
  {
    Serial.println("Device_1 not found. Check wiring.");
    while (1);
  }
  if (movementSensor2.begin(Wire, I2C_SPEED_STANDARD, 0x65) == false)
  {
    Serial.println("Device_2 not found. Check wiring.");
    while (1);
  }
}

void loop()
{
  if (movementSensor1.available() || movementSensor2.available())
  {
    ir1_1 = movementSensor1.getIR1();
    ir1_2 = movementSensor1.getIR2();
    ir1_3 = movementSensor1.getIR3();
    ir1_4 = movementSensor1.getIR4();
    

    movementSensor1.refresh(); //Read dummy register after new data is read

    ir2_1 = movementSensor2.getIR1();
    ir2_2 = movementSensor2.getIR2();
    ir2_3 = movementSensor2.getIR3();
    ir2_4 = movementSensor2.getIR4();
    

    movementSensor2.refresh(); //Read dummy register after new data is read

    
  }
  delay(1000);
}

From what I understand, you need to give a different address for the 2nd presence sensor so that the Arduino can distinguish them. Can this be done by using some program or does it have to be done physically (as per this site: How to Work with Jumper Pads and PCB Traces)

Please help :pensive:

Note: The I2C address of the AK9753 is 0x64 and is jumper selectable to 0x65 or 0x67

This doesn't provide 2 different addresses.

So you want to tell me this is imposible to do it right?

No @anon56112670 is telling you this:

Note: The I2C address of the AK9753 is 0x64 and is jumper selectable to 0x65 or 0x67

You must change the address using the jumpers on your sensor module. You will have to read the manual to find out the specifics.

Details of how to change the I2C address can be found at https://learn.sparkfun.com/tutorials/qwiic-human-presence-sensor-ak9753-hookup-guide

Here is an extract from that guide:

Addresses 0 and 1 can be used to change the I2C address of the board in case you have multiple devices using the same address. The below table shows the addresses that correspond to the different combinations of opened and closed jumpers.

Top View with Jumpers for Address

Address 0 Address 1 I2C Address
0 0 0x64
0 1 0x65
1 0 0x67
1 1 Switch Mode

No one is telling you that. You need to do some research on how to set the address of each module, carry out the settings and inform the sensor library of those addresses.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.