Connecting Arduino to ARC

Description

Program an Arduino and connect it to ARC to become an EZ-B.

Compatible Arduinos

This tutorial currently covers what Arduino's are compatible with ARC, where to download the firmware, how to flash the Arduino and connect to ARC.

Once you follow this tutorial and program an Arduino, you will be able to connect an Arduino to ARC and control the Arduino. Essentially, you will be converting an Arduino into an EZB. The best part about this is having access to the source code means you can add new functionalities to the Arduino and extend capabilities of ARC. The one item to note is each Arduino will have different capabilities or lacking capabilities (i.e. video, audio, etc.).

EZ-Builder Version
- This feature works with ARC 2019.01.31.00 Beta or newer

Arduino Capabilities
Additionally, each Arduino model will have a different MCU (microcontroller) with different capabilities for servos, PWM and Analog. Consult the datasheet/manual of the Arduino you're using to ensure you understand what ports are available for different commands. For example, some Arduino models only allow PWM/Servos on specific digital ports. Meanwhile, other Arduino's share I2C with Analog ports. You will have to determine what ports are available because we have no idea due to the number of Arduino versions out there. For example, servo ports on Arduino UNO must be PWM ports 3, 5, 6, 9, 10, and 11. These limitations are that of the Arduino libraries and hardware.

There's a significant number of Arduino's variations out there each with slight modifications. This means the base firmware provided in this tutorial can be modified for various Arduino configurations. Also, you are free to add new features to the Arduino firmware and register them as Capabilities to be used in ARC. But, that's a future edit of this tutorial :).

User-inserted image

*Arduino Mega shown in picture above


Compatible Official Arduinos
The ARC software is compatible a number of arduino products, which the firmware can be found on their respective pages. Find your Arduino board and download the firmware from this page: https://synthiam.com/Support/Hardware/Hardware-Overview

Download the firmware source code for your Arduino version or compatible from the above link and continue to the next step of this tutorial. *Note: compatible or clone Arduino's will require a toolset and library installation to compile the firmware. Check the Arduino compatible product manual for instructions on adding libraries and tools to the Arduino IDE for clone hardware.

#35  
DJ,
I assume you can use the EZ-B as connection 0 and add the arduino to connection 1 to give yourself additional I/O correct?

What If the arduino has WiFi already? Can we use it wirelessly?
PRO
Synthiam
#36  
Yes to the ezb #1

yes to the WiFi version of arduino. Look in the getting started guide for the WiFi enabled arduino
PRO
USA
#37  
Great tutorial

I used my Arduino today, com3 on ARC

sharp sensor:

used port ADC3

sharp IR radar

ADC graph

ADC meter

ADC read

All went well
PRO
Synthiam
#38  
That's great news! Appreciate the feedback:D
#39  
@DJ-Sures,

Any updates on adding "Capabilities"?  I'm looking to use an Arduino Mega as an EZ-B controller, but need to add (I think?) a library to manage some Neo Pixels.  Any thoughts or suggestions?

Thanks,

John
#41   — Edited
So, not quite.  If I'm reading that correctly, its flashing the Arduino sketch in that post and then the control plugin is connecting to that Arduino and its sole purpose is to run the ring?  I'm trying to add the neopixel library to the EZ-Mega.ino sketch and run two rings and a strip.  Am I overthinking it, or is that the right path?

***Update. so I added the library in the Arduino sketch, defined the strip, and have the lights animating via the sketch.  I can still connect to the Arduino from ARC so that part isn't broken.  My question now would be, how can I add a new function and call that from ez-script?  I think that will give me what I'm looking for.

***Update 2.   Ok. so I pretty much figured out that I need to add all the custom functionality to the Arduino sketch that I want (in progress), add a custom firmware (https://synthiam.com/Firmware/NewFirmware), add a new version and upload my firmware while also requesting the New Capabilities (https://synthiam.com/Firmware/NewCapability) that I'm adding.  Whew.  Will make the firmware available when (let's be honest, if) I get it finished.
PRO
USA
#42  
Did you see my Happy New Year Mr. Roman robot with Arduino uno -  make sure you click on the icon on the connection  - then go to settings, change the serial connection to 57600
PRO
Synthiam
#43   — Edited
Noggin - i can revisit the neopixel with arduino on a future live hack... I tried it last spring but man, neopixel isn't my favorite. They use A LOT of power and drain batteries super quick. Also, the whole way they work is kinda wacky... the arduino library didn’t work for me in my past live hack. Might be able to find the archived video somewhere on here and see if I made some mistakes that you could fix?

lots of people seem to like the idea of neopixels because of the convenience. Let's see what we can do...
#44  
DJ Sures - Some of your live hacks were taken down with a DCMA request, it appears, but I've watched #4 which got me started on the custom firmware.  I've baked in basic functionality to the Mega sketch, but don't know how to add the EZB Protocol commands on the software side.  I presume thats via the capabilities request, which I put one in last night, but think I did it wrong.  Essentially, if I get all the functions added to the sketch, and provide a list of the new Protocol commands that are needed to call them, can you add those to the app?  We'd need to coordinate on what bytes to send for the commands, but I modeled it after the command/sub command structure I saw.  I can send you a current copy of the firmware if you'd like to see what I was working on.

Let me know!  Feel free to pm me at my profile email address.
United Kingdom
#45  
Should I be able to control the speed at which the servos move when using an arduino? I have tried ServoSpeed and every thing I can think of and the servos still move at full speed. There doesn't appear to be any arduino code supporting CmdSetServoSpeed .

Please help.
PRO
Synthiam
#46   — Edited
Rhfinch - the Arduino ezb firmware does not support the servo speed capability. The list of capabilities for a ezb are displayed in the lower log when connected.

also, the firmware webpage where you downloaded it from has the list of capabilities. 

The work around for servo speed is to use the Auto Position control.
United Kingdom
#47  
Thanks. I'll look at that.
Unknown Country
#48   — Edited
Hello need help, i have an excavator project and i want to check with your software, how to start?.
The excavator has an arduino mega, esp2866, 2x L298N
Unknown Country
#50  
ok, I managed to master your excavator software works on the cable now it remains to buy raspberry for wfi.
will pc steering wheel work to control?
Netherlands
#53  
Has there been any updates on the tutorial on how to customize the firmware? I was really hoping I could use ARC to bridge an arduino UNO with an LCD panel and a laptop to do some more robust AI stuff
PRO
Synthiam
#54   — Edited
Hey Lipe, what specifically are you looking for to customize the firmware? You'd have to learn how to program in Arduino to customize the firmware. There's nothing specific about the firmware that requires any additional knowledge. Simply open the arduino firmware sketch into the arduino editor and modify the pieces you're interested in. 

However, if you merely want an LCD panel, then that doesn't require the firmware to be modified. You can start by getting a Serial (UART) LCD panel. Then, you can send Serial commands through the Arduino from ARC to the LCD.

Here's a link I found that will be helpful: https://synthiam.com/Community/Questions/Lcd-Display-Help-1165/comments