Asked — Edited

How To Connect Ezb To A Create 2

I have been looking on the forum for a wiring tutorial for the ezb and create 2. There are a lot of ideas and very complicated ideas that seem to work but no simple tutorial to connect ezb to a create 2.

Please let me know if there is a tutorial or can you provide me with one.

Thanks,


ARC Pro

Upgrade to ARC Pro

Elevate your robot's capabilities to the next level with Synthiam ARC Pro, unlocking a world of possibilities in robot programming.

PRO
Canada
#113  

You can certainly stuff a lot of stuff in that space like Lipo batteries, the EZB controller and a windows PC in that space. Nice.

#114  

Hi Frank,

Thanks for addition info. I updated my interface for mobile. Let me know what you think.

Is there a way to get sensor data on mobile interface, say sonar information>

I cannot see a way to do this.

Thanks.

Jack

#115  

Jack, I’ll check that tonight

What is the name of the project you posted?

Frank

#116  

Hi Jack, I assume its the Roomba 500_test project you are referring to.

The Mobile Interface can access variables you set in the program.

For example, your script "battery_check" could loop and update the variable $voltage so you could display that in the Mobile Interface

That variable $voltage is automatically accessible in the mobile interface and could be accessed in a "script label" that you add in the mobile interface... for example

User-inserted image

I think you are talking about these sensors

User-inserted image

So you would need to modify the battery_check script to read the additional sensors you want access and add the script labels in the mobile interface

If this doesn't make sense to you, I could modify the battery_check script, as a sample, to add a sensor you would like to access so you can add the rest of the senors and Mobikle Interface script labelslater

Frank

#117  

Hi Frank,

This my project working on for Roomba.

Roomba Test

Actually I wanted monitor IR sensors.

Also, I have been buying up broken Roombas. One was doing the circle dance with a nine beep error. Use this program to disable sensor and see if would go in a straight line. It circled. I replace the right wheel/ motor assembly and it is fixed.

I may want jut want to dedicate an EZ unit for testing these Roombas as they come in.

Thoughts?

Jack

#118  

Hi Jack, I loaded your Roomba Test project and modified the battery test script which was actually based on original work done by Richard R

I addded in the reading of two IR senors so you could use that as a sample. This creates the two variables which can be read by the mobile Interface

$left_signal $front_left_signal


$voltage=20 # default value
uartinit(0, 1, 115200) # Init UART
sleep(500)
uartWrite(0,1,128) # Send Start(128) command

repeatuntil(IsConnected(0)=0)
  uartinit(0, 1, 115200) #have to clear the buffer
  sleep(500)
  $RX_DATA=0
  
  uartWrite(0,1,142,22) # Voltage check command
  sleep(50)
  
  uartWrite(0,1,142,46) # Light Bump Left Signal command
  sleep(50)
  
  uartWrite(0,1,142,47) # Light Bump Front Left Signal command
  sleep(50)
  
  #*** Add other sensors commnands here ***
  
  $rx = UartAvailable(0, 1) # Read UART 
  print("******* $rx= " + $rx)
  
  if ($rx=6) # number of return bytes expected **** be sure to bump this number when more commands are added ***
    $RX_DATA = UARTRead(0, 1, $rx) # read all the bytes from UART 
    $MSB=GetByteAt($RX_DATA,0)
    $LSB=GetByteAt($RX_DATA,1)
    $voltage=($LSB+(256*$MSB))/1000
    $voltage=$LSB+(256*$MSB)   
    print("$voltage= " + $voltage)
    
    $MSB=GetByteAt($RX_DATA,2)
    $LSB=GetByteAt($RX_DATA,3)
    $left_signal=($LSB+(256*$MSB))/1000
    $left_signal=$LSB+(256*$MSB)   
    print("$left_signal= " + $left_signal)
  
    $MSB=GetByteAt($RX_DATA,4)
    $LSB=GetByteAt($RX_DATA,5)
    $front_left_signal=($LSB+(256*$MSB))/1000
    $front_left_signal=$LSB+(256*$MSB)
    print("$front_left_signal= " + $front_left_signal)   
    
  endif 
  
  

  if ($voltage<13.9)
    uartWrite(0,1,143)
    print("Low battery, attempting to dock")
    halt()
  endif 
    sleep(2000)  
endrepeatuntil

I also added two "script labels" to your Mobile Interface so that the variables could be displayed in real time

On the mobile interface, the script labels look like this

User-inserted image

I just added in text that looks like this "front_left_signal= " + $front_left_signal

Frank

#119  

Frank,

Thank you. I will test and get back to you on this. It looks like a good way to do it.

Jack

#120  

Frank,

I believe the way you set this up it will only read when connected to PC not just by using mobile alone?

Have you noticed that EZ camera can "see" the IR signal coming from docking station and virtual walls as white flashing light. I guess it sees IR. Not sure how to use this yet.

I want to create to types of apps here, one for mobile and one for PC. Mobile is for demo off site uses. PC I have a bunch of ideas that I will update you with when I do.

In the mobile app I want to do something other than just move around, maybe lock on to Gyph and track.

Jack