Things used in this project

Hardware components:
A000066 iso both
Arduino UNO & Genuino UNO
13632 01
Sparkfun Simblee BLE Breakout - RFD77101
Texas Instruments FRAM
Maxim DS3231 Temperature Compensated - Real Time Clock with integrated crystal


High-Level Schematic
System Diagram


Sample Code for Master-Master ArbitrationC/C++
These functions make sure that one or the other microcontroller but not both can control the i2c bus.
// Example of how to use the functions
unsigned long FRAMread32(unsigned long address)
  long four;
  long three;
  long two;
  long one;
  if(TakeTheBus()) {  // Request exclusive access to the bus 
    //Read the 4 bytes from memory.
    four = fram.read8(address);
    three = fram.read8(address + 1);
    two = fram.read8(address + 2);
    one = fram.read8(address + 3);
  GiveUpTheBus();// Release exclusive access to the bus
  //Return the recomposed long by using bitshift.
  return ((four << 0) & 0xFF) + ((three << 8) & 0xFFFF) + ((two << 16) & 0xFFFFFF) + ((one << 24) & 0xFFFFFFFF);

// Function that takes control of the i2c bus
boolean TakeTheBus() 
  int timeout = 10000;  // We will wait ten seconds then give up
  unsigned long startListening = millis();
  //Serial.println("Simblee has the Bus");
  while(digitalRead(SQWPin)) {} // The Simblee will wait until the SQW pin goes low
  while (!digitalRead(TalkPin))  { // Only proceed once the TalkPin is high or we timeout
    if (millis() >= timeout + startListening) return 0;  // timed out
  pinMode(TalkPin,OUTPUT);  // Change to output
  digitalWrite(TalkPin,LOW);  // Claim the bus
  return 1;           // We have it

// Function that gives up control of the i2c bus
boolean GiveUpTheBus() 
  pinMode(TalkPin,INPUT);  // Start listening again
  //Serial.println("Simblee gave up the Bus");
  return 1;


Img 20140919 080037
Chip McClelland

I build connected sensors.

Thanks to Pete Soper.


Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback


Similar projects you might like

Bluetooth Controlled Car
  • 130
  • 7

Full instructions

It's a basic 4 wheel drive car which can be controlled by android phones.

Ambient 2 click board on Arduino101
  • 45
  • 2


Short article about testing Mikroelektronika Ambient 2 click board on the Arduino 101 microcontroler

Easiest Way to Add A Full Color LCD Display
  • 4,622
  • 5


An Arduino library that, abstracts away all the complexity of a CRC based serial communication protocol into a single variable assignment.

Happy birthday melody on Arduino Nano with 3-way polyphony
  • 1,471
  • 21

Full instructions

Playing polyphony Happy birthday theme on Arduino Nano with three buzzers on a single mini breadboard.

Kaleidoscope Infinity Mirror
  • 3,088
  • 29

Full instructions

Build a beautiful “infinity mirror” Illusion that you can control by changing this mirrors' orientation. Rotate for changing colors!

ProjectsCommunitiesContestsLiveJobsBetaFree StoreBlogAdd projectSign up / Login
Respect project