What Adurino do I need for Meccanoid?

DuaneDegn:
You should be able to use the Meccanoid hardware like other robot hardware. You use your sensors to detect obstacles and control the motors to move where you want to go. In some ways the Meccanoid hardware should make many tasks easier. The main trick will be learning to use the protocol but the library should make this easier than trying to figure it out on your own.

Well thanks, DuaneDegn. I'll look into buying a Adruino Uno or a Mega and some sensors and get Meccanoid going. Before I get started, is there any tutorials on how to program on Adruino? I'm fairly new, and from this information you guys gave me, I'm ready to start programming Meccanoid on the PC. If you could give me link, that will be fine. Thanks everyone for your help! :slight_smile:

Check the "Learning" tab above.

cr0sh:
Whoa!

Check this:

Toysrus.com, The Official Toys”R”Us Site - Toys, Games, & More

For $20.00 USD you can get one of these servos! Now - read that PDF I posted. You'll find that these motors can both be controlled via a daisy-chained serial connection - AND they can relay back position information!!!

$20.00 gets you a low-cost version of Robotis or Herculux "smart" digital servo! I was just lamenting the other day on that I wished a servo manufacturer would do something like this - I never expected Meccano would do it! They should sell these in multi-packs!

That robot of theirs is pretty expensive - about $190.00! But $160.00 of that is in the 8 servos. If you bought two of these robots (16 servos) - plus a couple of expansion packs (a total of about $400.00) - you could build yourself a very low-cost humanoid bipedal robot. You might have to 3D print some parts (plus you'd have to add a controller, and sensors, and such) - but for around $500.00 you could have a very cheap humanoid robot to play with - and smart servos.

You can only approach this price currently using standard servos and bracket kits from Chinese suppliers. I'm not sure what the bearings or gearing is in those smart servos - likely plastic bushings and gears - but they are so darn cheap!

I just wish I didn't have a ton of other backburner projects on my list - or I would tackle this in a heartbeat!

Edit: I just realized I made a mistake - the 8 servo robot isn't $190.00, but rather closer to $500.00 retail! Darn! Still - 18 of those servos alone would only cost $360.00, which is still very low cost. You would probably have to 3D print certain brackets (though they do come with some brackets that might work ok for part of the project)...

My wife just gave me the Meccano G15 robot (2' tall, 4 servos) for Christmas. It was $99 at ToysRUs. They dropped the price from $150 just before Christmas.

Hi guys,

I succesfully connected the Meccanoid servos to Arduino. It appeared to be not hard at all. I used Arduino Mega and Sensor Shield.

The only problem is to find appropriate connectors. Meccanoids battery has Mini-Tamiya female connector. So you need to buy one Mini-Tamiya male at a hobby RC cars store, it is quite common.

Motors are plugged differently, so you need to buy at a local electronics store 2 different male connectors: one is CWF-2 (it is called so in Russia, a small white one), and another one I cannot figure out, so I used simply PLS-2, it fits. Tomorrow I am going to try try my good old Motor Shield to drive his DC motors, and after that I write a complete tutorial.

What I liked that fully charged Meccanoid battery gives you about 7V, so I didn't use any voltage converter, I simply plugged it into Arduino's VIN.

I think that for simplicity, to control Meccanoid via Arduino you need to choose a one-board like DFRduino Romeo, which already has servo pins and motor driver. I am going to give it a try. But if you don't have any, you can simply use Arduino + motor shield.

Here is my test code, it works with 4 servos plugged into each other. I tried it on Arduino Mega, but you may use Uno and any other Arduino which has PWM ports:

#include <MeccaBrain.h>

//for Uno and like
/*
const int pwmPin1=9;
const int pwmPin2=10;
const int pwmPin3=11;
*/
//for Mega and like
const int pwmPin1=44;
const int pwmPin2=45;
const int pwmPin3=46;

MeccaBrain chain1(pwmPin1); //each chain allows to plug up to 4 smart modules
MeccaBrain chain2(pwmPin2);
MeccaBrain chain3(pwmPin3);
 
void setup() {

}

void loop() {
 chain1.setServoPosition(0, 0);
 chain1.communicate();
 delay(1000);
 chain1.setServoPosition(0, 255);
 chain1.communicate();
 delay(1000);

 chain1.setServoPosition(1, 0);
 chain1.communicate();
 delay(1000);
 chain1.setServoPosition(1, 255);
 chain1.communicate();
 delay(1000);

 chain1.setServoPosition(2, 0);
 chain1.communicate();
 delay(1000);
 chain1.setServoPosition(2, 255);
 chain1.communicate();
 delay(1000);

 chain1.setServoPosition(3, 0);
 chain1.communicate();
 delay(1000);
 chain1.setServoPosition(3, 255);
 chain1.communicate();
 delay(1000);
}

Here's the image attached to the volkovo_ta's reply.

How to insert uploaded images.

Thanks for the information about the servos.

Hello,

I have a question. Will female jumper wires fit into the Smart Servo ports in the MeccaBrain? I plan on connecting some of my own sensors to the MeccaBrain to expand the functionality.

volkova_ta:
Hi guys,

I succesfully connected the Meccanoid servos to Arduino. It appeared to be not hard at all. I used Arduino Mega and Sensor Shield.

The only problem is to find appropriate connectors. Meccanoids battery has Mini-Tamiya female connector. So you need to buy one Mini-Tamiya male at a hobby RC cars store, it is quite common.

Motors are plugged differently, so you need to buy at a local electronics store 2 different male connectors: one is CWF-2 (it is called so in Russia, a small white one), and another one I cannot figure out, so I used simply PLS-2, it fits. Tomorrow I am going to try try my good old Motor Shield to drive his DC motors, and after that I write a complete tutorial.

#include <MeccaBrain.h>

//for Uno and like
/*
const int pwmPin1=9;
const int pwmPin2=10;
const int pwmPin3=11;
*/
//for Mega and like
const int pwmPin1=44;
const int pwmPin2=45;
const int pwmPin3=46;

MeccaBrain chain1(pwmPin1); //each chain allows to plug up to 4 smart modules
MeccaBrain chain2(pwmPin2);
MeccaBrain chain3(pwmPin3);

void setup() {

}

void loop() {
chain1.setServoPosition(0, 0);
chain1.communicate();
delay(1000);
chain1.setServoPosition(0, 255);
chain1.communicate();
delay(1000);

chain1.setServoPosition(1, 0);
chain1.communicate();
delay(1000);
chain1.setServoPosition(1, 255);
chain1.communicate();
delay(1000);

chain1.setServoPosition(2, 0);
chain1.communicate();
delay(1000);
chain1.setServoPosition(2, 255);
chain1.communicate();
delay(1000);

chain1.setServoPosition(3, 0);
chain1.communicate();
delay(1000);
chain1.setServoPosition(3, 255);
chain1.communicate();
delay(1000);
}

That's great! One question however, does this code work with Meccanoid's motors? I want to focus on the arms and controlling the LED eyes first. Thanks for the info on connecting the servos.

I thought the motors work like normal DC motors?

I noticed volkova_ta's code give the strong impression PWM pins are required to use with the servos.

//for Uno and like
/*
const int pwmPin1=9;
const int pwmPin2=10;
const int pwmPin3=11;
*/
//for Mega and like
const int pwmPin1=44;
const int pwmPin2=45;
const int pwmPin3=46;

The Meccanoid library calls the I/O pins "_pmwPin" which may be a typo for "_pwmPin" but I'm not sure.

The thing is, the library doesn't use "analogWrite". Only "digitalWrite" is used. You should be able to use any I/O pins with the Meccanoid servos.

The "sendByte" function gives us a clue why the baud is so low. They're bit banging the serial output with digitalWrite.

This is basically a very slow software serial. It blocks the code while the data is being transmitted. It would be interesting to see if the Meccanoid servos would respond to the Arduino's serial output.

void MeccaBrain :: sendByte(byte servoData){
  pinMode(_pmwPin, OUTPUT);                                     
  digitalWrite(_pmwPin,LOW);
  delayMicroseconds(bitDelay);                  // start bit - 417us LOW

  for (byte mask = 00000001; mask>0; mask <<= 1) {   // iterate through bit mask
    if (servoData & mask){                           // if bitwise AND resolves to true
      
      digitalWrite(_pmwPin,HIGH);              // send 1
      
    }else{                                      // if bitwise and resolves to false
      
      digitalWrite(_pmwPin,LOW);               // send 0
    }
    delayMicroseconds(bitDelay);                //delay
  }
  
  digitalWrite(_pmwPin,HIGH);
  delayMicroseconds(bitDelay);         // stop bit - 417us HIGH
  
  digitalWrite(_pmwPin,HIGH);
  delayMicroseconds(bitDelay);         // stop bit - 417us HIGH
  
}

This sure seems like a backwards way of using "smart servos".

Sorry if I'm not paying attention, but there is also cords that plug up the servos (head, arms) to the MeccaBrain. Is there a place to put it on the Adruino? The holes inside of the cord piece may indicate it would plug up to the MeccaBrain by its pins. Once I make sure this can happen, I'll have to make sure the servos are daisy chained while in its humanoid form.

I'm not sure if there's an easy way for the MeccaBrain to work with the Arduino.

I was under the impression the Arduino code was there to use if you wanted to use an Arduino instead of the MeccaBrain.

I'm not sure if I have this straight or not.

I wasn't saying like the MeccaBrain working on the Adruino. Adruino is like another brain for it. I was wondering if the servo wires would hook up to the Adruino.

Darwin7:
I was wondering if the servo wires would hook up to the Adruino.

Based on the photo volkova_ta posted, it looks like they hook up like normal servos.

goodinventor:
Will female jumper wires fit into the Smart Servo ports in the MeccaBrain?

A lot of servo connectors have a tapered corner or two. You might have to shave a corner off the female connector to get it to fit in the MeccaBrain's sockets. This is just a guess based on other servo connectors I've used.

No. The MeccaBrain is Arduino-compatible and has a library for it. The only problem is that Meccano does not give instructions for those who want to custom program using the Arduino IDE. I however will use the MeccaBrain. I do not intend to replace it with Arduino for my project, rather, I would like to connect a non-Meccano sensor (Parallax PIR) to the MeccaBrain's port. Looking at the socket, I think that a female 3-pin jumper wire connector may work (although I cannot be certain). Can anyone help?

goodinventor:
No.

What was the question?

goodinventor:
I do not intend to replace it with Arduino for my project, rather, I would like to connect a non-Meccano sensor (Parallax PIR) to the MeccaBrain's port.

Based on the videos on this page, it doesn't look like it's possible to add extra sensors to the MeccaBrain.

The "programming" looks like it's limited to motion playback and and motion capture using a smartphone app.

I didn't see any features which would allow actions to take place based on sensor input (other than voice commands).

goodinventor:
Looking at the socket, I think that a female 3-pin jumper wire connector may work (although I cannot be certain).

This video gives a good look at the connectors of the MeccaBrain.

The connectors look like "Futaba-J" connectors. The connectors have an orientation tab but the tab should only be a problem if your trying to connect them with male servo connector with the extra housing around the connector. If you're just using female 0.1" connectors, I don't think you'll have a problem.

Hmmm...it looks like the best option would be to use a 3-pin female to female jumper wire. To answer your comment about limitations for programming, there is an Arduino library for it. I also read the documentation they provide about the MeccaBrain and the smart modules. There is enough information that I can add a custom sensor to the MeccaBrain, provided that I have the proper connector to hook it up. The only problem would be that there are no functions dealing with the speech recognition or synthesis. Also, as of yet there is no documentation on how to interface with the speech recognition. The below link has both the library and the (limited) documentation.

goodinventor:
Hmmm...it looks like the best option would be to use a 3-pin female to female jumper wire.

I agree. It looks like a 3-pin female jumper should work. You'll just want to make sure you have the polarity correct since your jumpers won't have the orientation tabs on them.

goodinventor:
To answer your comment about limitations for programming, there is an Arduino library for it.

Yes there's an Arduino library for it. I don't see how this will help you connect sensors to the MeccaBrain.

goodinventor:
I also read the documentation they provide about the MeccaBrain and the smart modules. There is enough information that I can add a custom sensor to the MeccaBrain, provided that I have the proper connector to hook it up.

I don't see any information about connecting custom sensors. The only "sensors" it has are the position sensors in the servos. The MeccaBrain doesn't appear to do more than playback recorded sounds and motions. There isn't a way for the MeccaBrain to take actions based on any sort of sensor input.

I meant detailed information about signals for connecting to sensors. I can use it for my custom add-on.

Wait, but aren't there some sensors you can buy that are compatible with Adruino? You should be able to have a senor that can be used to make Meccanoid move. By the way, does Adruino need a power source and will the rechargeable battery wire plug into Adruino?

You are somewhat confused. I am not trying to use an Arduino board to connect the Meccanoid sensors and motors. Rather, I am trying to connect a non-Meccanoid sensor to the Meccanoid controller.

Darwin7:
Wait, but aren't there some sensors you can buy that are compatible with Adruino?

There are LOTS of sensors which are compatible with the Arduino.

Darwin7:
You should be able to have a senor that can be used to make Meccanoid move.

It depends how the sensor is connected. I don't think there's a way to use a sensor with the MeccaBrain in a way to trigger actions on the robot.

Darwin7:
By the way, does Adruino need a power source

Yes, the Arduino needs a power source.

Darwin7:
will the rechargeable battery wire plug into Adruino?

It doesn't look like the battery can directly connect to the Arduino. You'd need some sort of adapter.

Please check your spelling of Arduino. (At least you've been consistent (lately). :slight_smile: )