Arduino + Servo + Emotiv headset = A Bad Hair Day

I finally got a chance to sit down and play around with a servo, arduino, and an emotiv headset (www.emotiv.com). This is a proof of concept video, and the headset is currently set to read facial gestures. I haven't put in the time to train my thoughts with it yet. Hopefully more complex mechanisms will be built shortly. Enjoy.





12 comments:

  1. Hi!
    I am a graphic designer and I am having a problem controlling my servos with the Emokey application.
    I am using the Arduino to control them (with keystrokes, but I need to press Enter each time I want to send the moving order). Unfortunately, I haven’t been able to send an Enter through the Emokey application.
    Your advice is very welcomed.

    ReplyDelete
  2. I actually had the same issue when I started out. It's going to come down to how you program the arduino board, or if you have another programming language as an interface between Emokey and the arduino it will depend on how you program this interface. Currently, I'm using processing (www.processing.org) as my interface between EmoKey and the Arduino. So processing is sending serial commands to the arduino. Processing is also maintaining my servos in the position I want as it waits for keystrokes from EmoKey. You can work around the need to send "enter" by having processing, or the programming language of your choice, execute complex servo movements once it receives a certain key. Did that make sense? I'm curious how you're sending data to the arduino.

    ReplyDelete
  3. Hi Benjamin, thank you for your response.
    I am using a library (Servo.h), assigning PWM pins to the servos (myservoA.attach(3); for example) and Serial.begin(9600);
    Then in a loop: if (Serial.available()>0) a character is read: letra = Serial.read();
    If the character is the letter I am expecting, then position of the servo changes: myservoA.write(somePosition);
    It works great with the keyboard, but I need to press the Enter each time I input a character in the serial monitor.

    Ok. I will try to do that in Processing, but I am not sure how to send the serial commands between Processing and Arduino.
    I will review the examples of the Processing site to see if I can get an idea from that code. I appreciate your support.

    I am making an experiment to measure cognitive and emotional responses when the user faces a cognitive task. So I designed a Maze. It moves one grade each time (2 planes) controlled by the servos. The user has to move a ball from one place to the other and at the same time find the maze’s solution. One maze is very simple, the other is complex.

    (The idea is to detect cognitive load and its relation with attention and frustration). I finished the maze, but that Enter key …

    So any tip, advice or example is very, very welcomed.

    ReplyDelete
  4. You can download a useful example of how to control multiple servos from this site: http://letsmakerobots.com/node/22179

    And then there's a short tutorial here, for how to have processing talk to the arduino: http://everybody.is-a-cyb.org/project/21

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Thank you very much; you have been very helpful.
    Best regards. :)

    ReplyDelete
  7. It works! Yesss! :D
    Thanks a lot for all your help. I can now control my device with my Epoc.
    :)

    ReplyDelete
  8. Nice! Good job. If you ever get a chance, I'd love to see a video of your work too.

    ReplyDelete
  9. I made a video today! :D

    http://www.youtube.com/watch?v=WiAnclMaFj0

    Thanks a lot!

    ReplyDelete
  10. I saw the video. I like the clean design.

    ReplyDelete
  11. what is your source code for having Processing receive input from Emokey?

    ReplyDelete
  12. It's an ugly work around, but it works: http://www.benfarahmand.com/2011/08/tutorial-using-emotiv-headset-with.html

    ReplyDelete