Asked

Does Arc Recognize ADXL345 Accelerometer?

Hello everyone i am in the planning phase of a robot build, it has a 2dof head and 2dof right and left arm and 1dof base rotation. I was wondering if an off-the-shelf accelerometer like ADXL345 be used to control those servos? They make ADXL345 accelerometers that already have a type c port which would make it easy to plug into a computer. I was thinking of using 3 of them one for the xy of the head and one for the xy of each arm. Is this possible with arc? https://www.ebay.com/itm/395208581870?chn=ps&_trkparms=ispr%3D1&amdata=enc%3A1mdXCaP-YTY-NQ78j-4r8Ww93&norover=1&mkevt=1&mkrid=711-117182-37290-0&mkcid=2&mkscid=101&itemid=395208581870&targetid=1584739239974&device=c&mktype=pla&googleloc=9011873&poi=&campaignid=19894961968&mkgroupid=148855406073&rlsatarget=pla-1584739239974&abcId=9307911&merchantid=561512228&gad_source=1


Related Hardware EZ-B IoTiny

ARC Pro

Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro

PRO
Canada
#1  

Using an ADXL345 accelerometer with ARC to control servos in a robot build is indeed possible, but it requires a bit of setup and possibly some custom scripting. The ADXL345 is a popular accelerometer that communicates over I2C, which the EZ-B IoTiny supports. However, ARC does not have a built-in robot skill specifically for the ADXL345 accelerometer. You would need to use the I2C communication capabilities of ARC to interact with the ADXL345.

Here's a general approach to integrating the ADXL345 with ARC for your robot:

  1. I2C Communication: First, ensure that your ADXL345 accelerometer is correctly wired to the EZ-B IoTiny. The ADXL345 will communicate with the IoTiny over I2C. You'll need to connect the SDA (data line) and SCL (clock line) from the ADXL345 to the corresponding I2C pins on the IoTiny, along with power (VCC) and ground (GND).

  2. Identify the I2C Address: Each I2C device has an address. You'll need to know the I2C address of your ADXL345 accelerometer. This information is typically found in the device's datasheet. Common addresses for the ADXL345 are 0x53 (when the ALT ADDRESS pin is grounded) or 0x1D (when the ALT ADDRESS pin is high).

  3. Custom Scripting: Since there isn't a dedicated ADXL345 robot skill in ARC, you'll likely need to write some custom scripts to communicate with the accelerometer over I2C. You can use the I2C.read and I2C.write commands in ARC's scripting languages (JavaScript or Python, EZ-Script) to interact with the ADXL345. You'll need to send the appropriate commands to the ADXL345 to initialize it and read the acceleration data.

  4. Servo Control: Once you can read the acceleration data from the ADXL345, you can use that data to control the servos in your robot. For example, you might map the X and Y acceleration values to the movement of the head and arms. This will involve some math to convert the acceleration values to servo positions and some scripting to update the servo positions based on the accelerometer data.

  5. Testing and Calibration: It's essential to test and calibrate your setup. Accelerometers can be sensitive to orientation and may require calibration to ensure accurate readings. You'll want to experiment with the mapping between acceleration data and servo positions to get the desired behavior from your robot.

While using the ADXL345 with ARC requires some custom work, it's certainly feasible. The key is to become familiar with I2C communication in ARC and to be comfortable writing scripts to process the accelerometer data and control the servos accordingly.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#2  

Why would I need i2c connection when the accelerometer is connected to the PC? Is anyone else willing to add their 2 cents?

#3  

If there is a usb version, it would most likely create a COM port on the pc. In this case, you can create a robot skill or communicate with the sensor using the COM functions in ARC scripting

this is the Python COM manual: Com commands