Selfmade NortStar Navigation Cube for iRobot Braava/Mint

Inside the Roomba and Scooba and more, Cool mods, Repair and Upgrades - including the all new iRobot Create Kit. Let's void that warranty baby!
Post Reply
User avatar
Serge_ISA
Posts: 34
Joined: May 16th, 2014, 1:57 am
Location: St.Petersburg, Russia

Selfmade NortStar Navigation Cube for iRobot Braava/Mint

Post by Serge_ISA »

First of all, excuse me for bad English. This is not my native language. The text is pretty big and I was too lazy to translate it myself, so I used Google Translator. :oops:

The project on the microcontroller ATTiny2313, the scheme in the picture:

NorthStar NaviCube for iRobot Braava & Evolution Robotics Mint:
Image


The cube number is set with jumpers JP0-JP1. The current version of the program can generate signals from cube #1 and cube #4. The parameters of the signals of cube #2 and cube #3 are not yet known to me.
The cube is turned on by short pressing the button. After switching on, it works for 2 hours, after which it turns off. During operation, the mode LED flashes at a frequency of 0.5 Hz. By pressing the button again, the cube can be turned off early.
For power supply is assumed lithium battery. A node on the TL431 is designed to control the battery voltage: when the supply voltage drops below 2.5V, the device will produce several series of "3 + 1" short flashes by the mode LED, and then turn off. The same effect will be when you try to turn on the device with a discharged battery. If the battery voltage control is not needed or another source is selected for power, the node on the TL431 can be removed, and the input "PB4" can be set to "0".
The battery is supposed to be used protected, therefore for charging the usual USB-charger is used.

When repeating a device, the IR-LEDs should be installed at about 120 degrees relative to each other and with an inclination of about 15-20 degrees "forward" (ie, to the center of the room).

The principle of the formation of the navigation cube of two "infrared spots" on the ceiling:

Image

Firmware in .bin and .hex formats here - https://yadi.sk/d/_ut1UjUiLgszvw

PS: The cost of a cube at the official store at the moment is 40$! :wink:
Last edited by Serge_ISA on January 11th, 2019, 2:25 pm, edited 3 times in total.
Other my projects can be viewed here - http://roboforum.ru/forum90/ , http://ixbt.photo/?id=user:1114936
User avatar
mfortuna
Robot Master
Posts: 5853
Joined: February 5th, 2006, 9:35 am
Location: NH

Re: Selfmade NortStar Navigation Cube for iRobot Braava/Mint

Post by mfortuna »

Thank you for sharing this project and your home base project!
Mike
Reds x 3, Dirt Dog, Disco (now a parts bot), Create, Scooba 350, and Security Dawg
Evolution Mint
Neato XV-11
Shark Ion 750
User avatar
Serge_ISA
Posts: 34
Joined: May 16th, 2014, 1:57 am
Location: St.Petersburg, Russia

Re: Selfmade NortStar Navigation Cube for iRobot Braava/Mint

Post by Serge_ISA »

Welcome!
And to be continued... :wink:
Other my projects can be viewed here - http://roboforum.ru/forum90/ , http://ixbt.photo/?id=user:1114936
User avatar
vic7767
Robot Master
Posts: 15556
Joined: January 14th, 2006, 7:31 pm
Location: Haughton Louisiana - USA

Re: Selfmade NortStar Navigation Cube for iRobot Braava/Mint

Post by vic7767 »

Serge_ISA wrote: to be continued... :wink:
Looking forward to your mods and improvements.
User avatar
Serge_ISA
Posts: 34
Joined: May 16th, 2014, 1:57 am
Location: St.Petersburg, Russia

Re: Selfmade NortStar Navigation Cube for iRobot Braava/Mint

Post by Serge_ISA »

I found Сube #4. The corresponding changes in the firmware and schemes.
Other my projects can be viewed here - http://roboforum.ru/forum90/ , http://ixbt.photo/?id=user:1114936
beckmx
Posts: 5
Joined: August 20th, 2020, 1:36 pm

Re: Selfmade NortStar Navigation Cube for iRobot Braava/Mint

Post by beckmx »

hey Serge_ISA, I am interested in replicating your mod, do you happen to have the source code?, maybe I can migrate it to esp8266
beckmx
Posts: 5
Joined: August 20th, 2020, 1:36 pm

Re: Selfmade NortStar Navigation Cube for iRobot Braava/Mint

Post by beckmx »

Hello everyone, 4 years later I still use both my:

- evolution robotics 4200 (mint 4200 or robot braava 320) with 1 cube
- irobot braava 380 which also uses a cube

Now, with Artificial Intelligence and some tooling I was able to disassemble the code shared by Serge, I will replicate later my code in an esp32, but this is the Arduino version in fully readable format:

Code: Select all

// NaviCube for iRobot Brava/Evolution Robotics Mint
// Arduino UNO implementation based on ATtiny2313 disassembly

// Pin definitions
const int IR_LED_1 = 2;     // PD0 equivalent
const int IR_LED_2 = 8;     // PD6 equivalent
const int STATUS_LED = 6;   // PD4 equivalent
const int BUTTON_1 = 14;    // PB0 equivalent (A0 on Arduino)
const int BUTTON_2 = 15;    // PB1 equivalent (A1 on Arduino)
const int SENSOR_PIN = 18;  // PB4 equivalent (A4 on Arduino)

// IR protocol parameters
const unsigned long PULSE_DELAY = 562;  // Microseconds (based on code timing)

// Device ID codes (extracted from the disassembly)
byte deviceID = 0;
const byte MAX_DEVICE_ID = 3;

// IR signal parameters for different device IDs
byte irParams[4][4] = {
  {7, 24, 7, 19},    // ID 0
  {9, 29, 9, 23},    // ID 1
  {9, 33, 9, 28},    // ID 2
  {9, 37, 9, 33}     // ID 3
};

// Timing variables
unsigned long lastTransmitTime = 0;
const unsigned long TRANSMIT_INTERVAL = 50;  // ms
bool ledState = false;

void setup() {
  // Initialize pins
  pinMode(IR_LED_1, OUTPUT);
  pinMode(IR_LED_2, OUTPUT);
  pinMode(STATUS_LED, OUTPUT);
  pinMode(BUTTON_1, INPUT_PULLUP);
  pinMode(BUTTON_2, INPUT_PULLUP);
  pinMode(SENSOR_PIN, INPUT);
  
  // Initial state
  digitalWrite(IR_LED_1, LOW);
  digitalWrite(IR_LED_2, LOW);
  digitalWrite(STATUS_LED, LOW);
  
  // Read initial device ID from buttons
  readDeviceID();
  
  // Flash LED to indicate startup
  for (int i = 0; i < 3; i++) {
    digitalWrite(STATUS_LED, HIGH);
    delay(100);
    digitalWrite(STATUS_LED, LOW);
    delay(100);
  }
  
  Serial.begin(9600);
  Serial.println("NaviCube for iRobot Brava/Evolution Robotics Mint");
  Serial.print("Device ID: ");
  Serial.println(deviceID);
}

void loop() {
  // Check if it's time to transmit
  if (millis() - lastTransmitTime > TRANSMIT_INTERVAL) {
    transmitIRSignal();
    lastTransmitTime = millis();
    
    // Toggle status LED
    ledState = !ledState;
    digitalWrite(STATUS_LED, ledState);
  }
  
  // Check for button presses to change device ID
  readDeviceID();
  
  // Check if we should enter sleep mode (based on sensor)
  if (digitalRead(SENSOR_PIN) == HIGH) {
    // In the original code, this would trigger sleep mode
    // For Arduino, we'll just dim the LED
    digitalWrite(STATUS_LED, LOW);
    delay(100);
  }
}

void readDeviceID() {
  // Read buttons to determine device ID (0-3)
  int buttonState1 = !digitalRead(BUTTON_1);  // Inverted because of pull-up
  int buttonState2 = !digitalRead(BUTTON_2);  // Inverted because of pull-up
  
  deviceID = (buttonState2 << 1) | buttonState1;
  if (deviceID > MAX_DEVICE_ID) deviceID = 0;
}

void transmitIRSignal() {
  // Get parameters for current device ID
  byte param1 = irParams[deviceID][0];
  byte param2 = irParams[deviceID][1];
  byte param3 = irParams[deviceID][2];
  byte param4 = irParams[deviceID][3];
  
  // Send header
  sendIRPulse(IR_LED_1, 16);
  delayMicroseconds(PULSE_DELAY * 8);
  
  // Send device ID specific pattern
  for (int i = 0; i < param1; i++) {
    sendIRPulse(IR_LED_1, 1);
    delayMicroseconds(PULSE_DELAY);
  }
  
  delayMicroseconds(PULSE_DELAY * (param2 - param1));
  
  for (int i = 0; i < param3; i++) {
    sendIRPulse(IR_LED_2, 1);
    delayMicroseconds(PULSE_DELAY);
  }
  
  delayMicroseconds(PULSE_DELAY * (param4 - param3));
}

void sendIRPulse(int pin, int numPulses) {
  // Send IR pulses at ~38kHz
  for (int i = 0; i < numPulses; i++) {
    for (int j = 0; j < 12; j++) {  // 12 cycles at ~38kHz
      digitalWrite(pin, HIGH);
      delayMicroseconds(13);
      digitalWrite(pin, LOW);
      delayMicroseconds(13);
    }
    delayMicroseconds(5);  // Small gap between pulses
  }
}
Post Reply