Jump to content

Recommended Posts

Posted (edited)

Lego doesn't support a message protocol that is interchangeable between the NXT and EV3 brick. To overcome that problem, I have written a small program in C# to make the translation between the two different bricks. It works fine, but you always need a PC in between.

At our blog (see https://siouxnetontr...pc-application/), I have written an article with a completely different solution, namely a 'motor communication protocol'.

motorprotocol.png

Enjoy.

/Hans

Edited by Hanso
Posted (edited)

That looks very interesting.

You say:

"The basis of this communication protocol is that the large motors (both at the NXT and the EV3) can either be used as activator (motor movement) and as sensor (rotation)."

Can you post a very small program exemple of how to use the EV3 motor as a sensor.

Thank you in advance.

Edited by oracid
Posted

That's a nice solution.

I remember someone doing something similar with two color/light sensors. Since these can both sense light and transmit light. He had a whole communication protocol running I think. Can't find it now though.

Posted

That looks very interesting.

You say:

"The basis of this communication protocol is that the large motors (both at the NXT and the EV3) can either be used as activator (motor movement) and as sensor (rotation)."

Can you post a very small program exemple of how to use the EV3 motor as a sensor.

Thank you in advance.

You need the MotorRotation programming block, see example below. More information can be found at the help pages of the EV3, search for Motor Rotation.

17854661894_c39bb23daa_o.png

The difference with the color sensor solution:

* The NXT color sensor can both send and receive light, the EV3 color sensor is only able to receive light. So you can only have two way communication between two NXT bricks.

* You need a sensor port for the color sensor, and in my situation all sensor ports were occupied.

/Hans

Posted

The difference with the color sensor solution:

* The NXT color sensor can both send and receive light, the EV3 color sensor is only able to receive light. So you can only have two way communication between two NXT bricks.

* You need a sensor port for the color sensor, and in my situation all sensor ports were occupied.

Two good points. I did not know that about the EV3 color sensor. How about if you use a NXT color sensor with the EV3 brick?

Posted

I have not tried that, but I think that it should work with the NXT color sensor at the EV3 brick.

/Hans

Posted

At my Youtube channel, you find a video with a demo of this 'motor protocol'.

This is just a simple demo, I am working on a version with two buttons at the NXT brick and two different actions at the EV3 brick.

/Hans

Posted (edited)

Update that demo with two buttons:

Pressing the first button on the NXT, the EV3 display starts to flashing red.

Pressing the second button on the NXT, the EV3 starts spinning the 24-tooth gear.

When the action is done at the EV3 side, a "done" message is send back and the NXT sounds a 'beep'.

Let me know what you think.

/Hans

Edited by Hanso
Posted

And the final version: the color selector.

On the NXT, a color sensor reads the chosen color. This information is passed with the use of two motors to the EV3, that displays the chosen color and plays the corresponding sound file.

When done, this is passed back to the NXT (and you hear 'yes').

Enjoy.

/Hans

Posted

I do not understand why you use two motors to transfer a data.

But I must say that my knowledges are very small.

I find this very interesting but not understand the goal.

Moreover, with the code, it would be even more interesting.

Posted (edited)

I guess ev3 color sensors could be used in light strength measurement mode for binary protocol, dunno if nxt sensor can do that though

The difference with the color sensor solution:

* The NXT color sensor can both send and receive light, the EV3 color sensor is only able to receive light. So you can only have two way communication between two NXT bricks.

* You need a sensor port for the color sensor, and in my situation all sensor ports were occupied.

/Hans

ok nevermind then

Edited by laggyluk
Posted

I do not understand why you use two motors to transfer a data.

But I must say that my knowledges are very small.

I find this very interesting but not understand the goal.

Moreover, with the code, it would be even more interesting.

You don't need to use two motors, it can also be done with one motor and the number of degrees. But I assume that this is less accurate after some time.

The goal is to connect two bricks without Bluetooth or WiFi and how easy it is to create your own protocol.

/Hans

Posted (edited)
You don't need to use two motors, it can also be done with one motor and the number of degrees. But I assume that this is less accurate after some time.

The goal is to connect two bricks without Bluetooth or WiFi and how easy it is to create your own protocol.

Ok, I see what is the goal now, but why don’t you use the sensors plugs instead of the motors.

Edited by oracid
Posted

In the final layout, the brick that is used to 'send' the messages to the other brick, has no free sensor ports. That is the reason. And using the light sensor has always the risk of wrong interpretation of the color.

/Hans

Posted

Ok, I understand.

And what about using a motor in the nxt and a push button on the ev3 ?

And more, I don't understand how the nxt motors transfers the value to the ev3 motors.

I believe the answer is in the code.

Posted (edited)

Ok, I understand.

And what about using a motor in the nxt and a push button on the ev3 ?

And more, I don't understand how the nxt motors transfers the value to the ev3 motors.

I believe the answer is in the code.

The answer is (partly) in de code. The answer is mostly in the fact that ...

  1. ... the motors are physically connected (so if the EV3 motor rotates, the NXT rotates as well and vice versa).
  2. ... the motors can be use as actuator (= motor) and sensor (measure the number of degrees)

18711358941_85bf22a7b1.jpg

So, if I want to pass a message from the NXT to the EV3, I let the NXT motor rotate (e.g. 90 degrees). The EV3 motor 'notices' the number of degrees and can act upon it, for example +90 degrees is action#1 and -90 degrees is action#2.

Hope this makes sense ;-) If not, please let me know or send me an email if you want the NXT/EV3 source code.

/Hans

Edited by Hanso
Posted

The EV3 motor 'notices' the number of degrees and can act upon it, for example +90 degrees is action#1 and -90 degrees is action#2.

This is very great Hans.

I understand now.

Thank you very much.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...