Recommended Posts

Hi again.

Another project I showed live last weekend at PLUG Braga BRInCKa 2016 - a LEGO Laser Harp:

Harpa Laser

It uses a Mindstorms EV3 to read the light intensity on 8 color sensors.

Each color sensor has a 1mW red laser pointing to it so my instrument has 8 "strings" or "chords" (I use two 3-to-1 input multiplexers in order to achieve 8 sensors).

All 8 lasers are controled from one EV3 output. I started with 8 LEGO Power Function LEDs and it worked fine... at dark. But at a live show room I knew it would be impossible to use the LEDs (unless for very very short distances) so I opted for lasers.

The EV3 runs ev3dev, a linux distro for the EV3. A python script controls the lasers and reads the sensors, sending their state to a linux laptop where another python script plays the notes on a software MIDI synth (EV3 with ev3dev can play MIDI but has not enough power to polyphonic sound so I had to use this client-server configuration). This allows the "instrument" to scale out so I can had more EV3 and more "strings".

I don't know now how to play so during the exhibition my wife, when present, played some 8-note children tunes for the public. I have no live video but I have this one at home, still with LEDs and just 7-chords:

Sound still needs some improvements (I'm not controlling note length) and hopefully in a later version I will read hands distance to control note amplitude. I will also use some kind of Human Interface Device to change the MIDI soundfont intrument "on the fly" so the artist can change from an harp to a piano or a drum whenever he/she wants (I'm planning to use LEGO Dimensions ToyPad since I can already read NFC tags with it on the EV3).

Some technical details (and code) at my blog.

Share this post


Link to post
Share on other sites
Hi Jorge. this is great ! So great !
Can you tell us more about multiplexer sensors .
Thank's

Share this post


Link to post
Share on other sites
45 minutes ago, oracid said:
Hi Jorge. this is great ! So great !
Can you tell us more about multiplexer sensors .

Hi oracid. Thanks!

I'm using Mindsensors' EV3 Sensor Multiplexer for EV3 or NXT. It is a 3-to-1 input multiplexer that works with most (if not all) EV3 sensors.

I've never used with native EV3-G language but I believe it is just a question of installing a driver from Mindsensors to get a new kind of EV3-G block.

I'm using ev3dev (Debian linux for EV3) and it's just "Plug and Play" since by default ev3dev initializes each new input port to work with Color Sensors. For each MUX I get 3 input ports so as I'm using 2 MUX I get 6 ports (and loose 2 so I really gain only 4 ports).

I'm not sure but I don't think it is possible to "daisy chain" to get extra ports, so the limit for one EV3 is (probably) 4 MUX which gives a total of 12 sensors. Not bad and less expensive than using 3 EV3 together :)

Mindsensors has european distributors. The french one was very fast and has also many other robot-related products.

Edited by MajorAlvega

Share this post


Link to post
Share on other sites
2 hours ago, MajorAlvega said:

Mindsensors has european distributors. The french one was very fast and has also many other robot-related products.

Thank you Jorge. I would like to know to be sure it was this one.
Do you know if the motors multiplexer goes in the same way ? May be you have got one too. http://www.mindsensors.com/ev3-and-nxt/21-multiplexer-for-nxtev3-motors
EV3Dev looks very good. I am very interested.

Share this post


Link to post
Share on other sites
1 hour ago, oracid said:
Do you know if the motors multiplexer goes in the same way ? May be you have got one too. http://www.mindsensors.com/ev3-and-nxt/21-multiplexer-for-nxtev3-motors
EV3Dev looks very good. I am very interested.

Yes, the Motors multiplexer work in a similar way. But I have none, somehow I never got interested on it, I think mostly because it requires an external power supply - for some purposes that might actually be a big advantage. The few times I needed more than 4 motors I opted for a different approach (a WeDo USB Hub gives me two more weak PF motors with no extra battery, SBrick gives me up to four strong PF motors with extra battery, IR Link is also an option for PF motors and for non-LEGO motors a USB relay card or a USB servo controller can give me almost an unlimited number of motors).

There's also a small limitation, at least with ev3dev: "it does not support all of the possible functions of the tacho-motor class (...) The NxtMMX does not have a way to monitor the duty cycle of the motor." It isn't a big limitation and honestly I don't know if in EV3-G it makes any difference at all (I must be the only EV3 owner in the world that doesn't use EV3-G).

ev3dev is very powerful environment but it can also be a shock for the beginner since it lacks organized documentation and it requires some previous command line experience. You need to dig a lot at before gaining some confidence but a patient man like you, who cuts hundreds of rubber pads for your own custom tank tracks, seems a proper candidate to master it ;)

Share this post


Link to post
Share on other sites

Thank you so much.
Yes, you are right. I am the good candidate. But I don't yet understand the benefit. But I have still a few videos to look at :
'https://www.youtube.com/playlist?list=PL7hndBcWv-umf5tdIp0lJfPuU0X9LE97a'
'https://www.youtube.com/playlist?list=PL7hndBcWv-unrU0zYHl5JYWRBinNMPrSM'
 

Share this post


Link to post
Share on other sites

For small or conventional projects I think there is no benefit at all - the learning curve is to expensive.

The real benefit is when you need to do something that is not possible with EV3-G or it might become to complex to handle (like when you find you have to much blocks in your EV3-G code). Image recognition (like OpenCV) and other AI use cases are possible in ev3dev because most (Debian linux) libraries are already available for the language you like (C, Java, Python, R, javascript...). And extended hardware support is also nice - you want to interface with your Domotics system, with your old plotter, with your GPS... you probably can.

Of course, it's very nerd/geek. But hey... we are adults working with LEGO, how more nerd/geek can it be?

Share this post


Link to post
Share on other sites

Thank you for this truthful answer.

My programs are not so big.
Thanks to you, I have ordered a motors multiplexer right now.

Share this post


Link to post
Share on other sites

This is a very nice project!

Off topic: you mention reading NFC tags on the EV3. Care to elaborate? (or create a new topic)
I know there used to be a HiTechnic or Mindsensors or even an official NFC sensor.

Share this post


Link to post
Share on other sites

There are two LEGO NFC/RFID devices (that I know of):
- the Codatex RFID reader that was in fact sold as LEGO. It works with NXT but doesn't work with EV3 native firmware (EV3-G), you need LeJOS or RobotC or ev3dev linux (I wrote an ugly python script for ev3dev, https://github.com/JorgePe/CodatexRFID-ev3dev)

- the LEGO DIMENSIONS Toy Pad, it has 3 NFC readers inside and can be used with ev3dev through USB, you can see a silly demo I wrote here: https://ofalcao.pt/blog/2017/ev3-minifig-inventory

Non-LEGO devices can also be used but you then your only option is ev3dev. I used the Innovations ID-20 with a USB reader on my automatic turntable, it accepts the same 125 kHz cards/tags used by Codatex/LEGO RFID sensor. I'm not sure but I think I added a link to the code on the notes of the video I published here on the forum, it's very simple (most devices available for Raspberry Pi or Arduino are very easy to use in ev3dev). Also used a NFC device compatible with Mifare NFC tags (like the DIMENSIONS tags) but don't remember which, perhaps the PN532 for Arduino, with a USB FTDI cable to connect to the EV3 USB port.

Edited by MajorAlvega

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.