robodude93
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
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:
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).
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).
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
andI2C.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.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.
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.
Why would I need i2c connection when the accelerometer is connected to the PC? Is anyone else willing to add their 2 cents?
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
Will ARC accept multiple accelerometers?
Yes, ARC allows up to 65,000 robot skills. You may benefit from the Geting Started guide here. specifically the section about what a robot skill is: synthiam.com/Support/Get-Started/how-to-make-a-robot/robot-skills
@athena
the EZ-bits accelerometer is no longer available for sale.
What accelerometer hardware can I purchase that well work with the existing Synthiam skills ?
Is there a magnetometer or compass that is available to interface with Synthiam skills ?
Thank You
While the EZ-Bits accelerometer is no longer available, you can still use other accelerometers with ARC by utilizing the I2C interface. The ADXL345 accelerometer is a popular choice and can be interfaced with ARC using the I2C protocol. You can find ADXL345 modules that are compatible with I2C, which will allow you to connect them to the EZ-B IoTiny or other EZB controllers.
For a magnetometer or compass, you can consider using the HMC5883L or QMC5883L modules, which are also compatible with the I2C interface. These modules can be used to provide compass functionality and can be integrated into your robot project using ARC.
To interface these sensors with ARC, you can create custom robot skills or use existing I2C communication functions within ARC. Here are some resources to help you get started:
If you have any further questions or need assistance with setting up these sensors, feel free to ask!
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.
Take a look at the existing robot skills that support imu's here: https://synthiam.com/Support/Skills/Skills-Overview#I2C
Maybe choose one of those first. And if the one you want isn't supported, just write the i2c commands in python or javascript in a script robot skill. Many ppl purchase an imu or sensor because "it's available" or "it's affordable" but that doesn't always mean it'll be easy to use if their manual/datasheet isn't good. However, if you can find an arduino library that works with your chosen IMU, i usually find it's easier to make an arduino into a translator, of sorts. Allowing the arudino to do the heavy lifting talking to the IMU with it's messy protocol and transmit the values over UART to the EZB.
Lastly, you can always consider taking an arduino or esp32 EZB firmware and modifying it to include an accelerometer. I feel that would be the most seamless option.
This is an example using the Arduino Leonardo EZB. I added the skeleton for an MPU IMU. @Athena, can you fill in the relevant MPU6550 code in this firmware? Also can you make sure writing the high and low bytes of the _accel, _gyro and _pose values are correct? Thanks
To integrate the MPU6050 (or MPU6550 as mentioned) with the Arduino Leonardo and communicate with Synthiam ARC, you can use the
MPU6050
library to handle the sensor data. Below is a modified version of your Arduino sketch that includes the necessary code to read data from the MPU6050 and send it to ARC.First, ensure you have the
MPU6050
library installed in your Arduino IDE. You can install it via the Library Manager by searching for "MPU6050".Here's the updated code:
Key Points:
MPU6050
library is used to interface with the MPU6050 sensor.updateMPUData()
function reads the accelerometer and gyroscope data from the MPU6050.doEZProtocol()
function handles communication with ARC, including sending sensor data.This code provides a basic framework for integrating the MPU6050 with ARC. You can expand upon this by adding more functionality or refining the data processing as needed. If you have any further questions or need additional assistance, feel free to ask!
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.