Thumbnail

PWM Servo Feedback (I2c)

How To Add This Control To Your Project

  1. Make sure you have the latest version of EZ-Builder installed.
  2. Select the Install button below to download the archive file.
  3. Double click the downloaded archive file to execute installer.
  4. The installer will add this control to EZ-Builder.
  5. Load EZ-Builder and press the Project -> Add Control button from the menu.
  6. Choose the Servo category tab.
  7. Press the PWM Servo Feedback (I2c) icon to add the control to your project.

Receive servo positions in real-time over an arduino and its ADC ports. This control connects to an Arduino over I2C and receives the values of the ADC ports. The Arduino requires a firmware to be programmed, which can be downloaded below. Depending on your Arduino version, the code can be modified for the number of ports. 

The Arduino code available here is for the Arduino Nano, which is a tiny little Arduino that nicely fits next to an EZ-B or IoTiny. It connects to the EZ-B via I2C using its A4 and A5 ports. As you can see from the image below, the I2C ports of the Nano use the A4 and A5 ports. Those ports have to be connected to an EZ-B (whether another arduino, EZ-B v4, or IoTiny).

User-inserted image

The Arduino Nano, for example, has 8 ADC ports. However, 2 of them are used by the I2C connection, so that limits you to 6 ADC ports. That means you can read 6 servo positions via the Arduino Nano connecting to an EZ-B. If you put this firmware on an Arduino Mega, that gives you 16 ADC ports which means reading 16 servo positions. Remember, the I2C address can be modified as well - which means you can have 100+ of these NANOs connected to the I2C and chained together. That gives you 600 ADC ports HAHA, for what ever reason;). The Firmware I2C address can be edited and changed. The plugin also has a place to change the I2C address in configuration.

Here is the firmware for the Arduino: I2C_Analog_Read.zip

Upload that firmware and make any edits as necessary. It is documented quite well so it should be an easy modification to work with various Arduino boards, such as Mega. I believe the Uno and Nano have similar pinouts, but a different number of ADC ports. 

The servos that connect to the ADC ports of the Arduino must be modified to have a wire attached to them. That is documented in this video below..



This video has the ADC version of this plugin being demonstrated. You can see what the results would be if you wanted to read servo positions

#1   — Edited
You can also do this with a basic script, 2 JDs with just 2 ezb4 and the "Map" script command (and hacked servos of course}.... I did this with a remote controlled robotic arm like a crude version of the ones you see remote robotic arm surgeons using. I built a frame that I wore that had pots in my shoulder, elbow, wrist and hand joints that translated to movements to control a robotic arm..  Yes I realize this is a demo showcasing additional hardware aka an arduino in this case with (and make ez builder more valuable might I add) ez builder which is a bonus... So saying that when are we going to have to pay for ez builder?....:)
Synthiam
#2   — Edited
My plan is you’ll never have to pay for EZ-Builder. I don’t see a point in punishing robot builders to use EZ-Builder. Specifically with the enhancements we’re working on:)
#3  

Quote:

That gives you 600 ADC ports HAHA, for what ever reason...
...ohhh i know one....muhahahmuhaha!!!! Hope fully we can see a little set up of this on friday?
Synthiam
#4  
Sure will! Well, not 600 adc ports. But I will have 14 in total
#5  
Fantastic! Looking forward to it!