Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: Bluetooth connectivity on: August 28, 2012, 03:50:43 pm
Quote
Also, one the devices are paired, you then need to read the data from the headset. Do you know what format that data is in? What do you intend to have the Arduino do with the data, if you are able to get it?

The data is supplied in asynchronous serial stream packets, according to chipset documentation. There is already an Arduino sketch available online for acquiring and parsing packets.

Once acquired, the Arduino will move a team of servos in response to the values output by the headset. I've created a full post over on the collaboration board detailing the entire plan (I never fully expected to complete it on my own, as I'm no programmer; I just wanted advice as to which would be easiest to get running here).
2  Community / Gigs and Collaborations / Wanted: programmer and build advisor on: August 28, 2012, 03:43:08 pm
I'm looking for a programmer for my project who can also give me detailed instructions on how to assemble the components (I prefer text and diagrams to video). I can follow directions well, but like a robot, if you skip a step I might not fill in the blanks properly (I once had a teacher ask us to write pseudocode for a robot to perform our morning routines before going to class. Several students ended up with busted doors, as they forgot to write "open door" before "leave/enter" or "get in car", and some soiled themselves as they forgot "remove pants" before "use toilet" - yes, I know you could specify "get in car" and "use toilet" as routines that include opening the door and removing pants, but that wasn't called, either).

Anyway, the code is probably pretty simple from what I've seen. It is simply to control servos in response to brainwaves from an XWave Sport, which uses Bluetooth to transmit its signals.

You may have seen Neurosky's Necomimi. It's a cute idea, but the movement just doesn't read properly to me (I have owned dogs and cats, and been around horses and rabbits, and not one of them rotated their ears forward to fold them down). I eventually saw the Arduino system and figured "Hey, build one!" (plus, this means the $100 headset isn't tied solely to a silly pair of ears and I can reuse it for anything else I'd like, whereas buying the Necomimi directly ties the headset and ears together).

Now, yes, I know about Josh DiMauro's version. However, his movement style is fairly similar, and it only reads the "Attention" signal from the regular Neurosky headset, ignoring "Meditation" entirely. His instructions also don't include how to connect the headset to the Arduino so it can see the output.

This is a diagram of the setup I conceived:



The tilt servos are hidden inside the ear fur fabric and attached to soft foam which can be bent and flexed easily to move the tips of the ears (I'm a crafty sort by nature, so I have no problem with creating stuff from foam and fabric; it's hardware and code that gets me). These respond to the Attention value output from the headset. At 50%, they rest in the neutral position. At 100%, they rotate "up" 50 degrees, "up" defined as counter-clockwise for the left servo and clockwise for the right when looking up the servo from base to horn (50 is the maximum rotation needed; the other 40 degrees are ignored). At 0% attention, they rotate "down" 50 degrees in the opposite direction, tilting only the ends of the ears.

The rotate servos are attached to a headband (simple craft headband; this headband is in turn held firmly in place by the XWave's elastic sweatband being wrapped over it) and support the tilt servos on their horns. These servos face out from the head and up at about a 45 degree angle to position the ears properly relative to the face. The neutral unrotated servo position actually corresponds to 90% Meditation; at 100%, they rotate ten degrees "up" (again, counter-clockwise for left and clockwise for right), and at 0%, they rotate a full 90 degrees "down". This rotation moves the entire ear from base to tip. I've played with 3D Max mockups I created and this scheme suits me more than the Neurowear system.

I also have designs for an accompanying tail system, which Neurowear has yet to create. Servos one and three move in tandem opposite each other, rotating between 20 degrees "down" at 100 Attention and 70 degrees "down" at 0 Attention (this means the servos are moving one degree for every two units of Attention, rather than one for one). These control the general angle of the tail, if it is up (attentive) or hanging (chill). Servo two responds to Meditation, being completely still at 0 and making a left-right sweep of 100 degrees (50 in each direction) at 100 Meditation. This controls the wag of the tail, wagging more when relaxed and less when stressed. The rest of the tail is made of simple joints and foam and just carries the motion of the servos at the base (like wiggling the end of a piece of string and seeing the movement roll down the string in waves).

If at all possible, I would prefer to have the Arduino check XWave values four times per second (evenly spaced, of course). The ears and outer tail servos move in time with this check, jumping to their proper corresponding values (there is no "this makes ears stand up still, this makes ears hang limp, this makes ears twitch"; they simply move exactly to the value of Attention or Meditation specified. Yes, they will be constantly moving; most animals' ears do, even if it's just small adjustments). It is best if they all move in time with one another, but it is IMPERATIVE that the two tail servos move together, as they're both supporting the third servo between them (using only one could cause twisting and lopsidedness), and it would look best if the two tilt servos and two pan servos could also move as a pair if full synchronization is impossible.

The central wagging tail servo is only updated twice a second: at time 0.00, it begins its wag to the left; at time 0.25, it reaches the extent of its left wag and begins its return to center; at time 0.50, it reaches center and the Arduino sends a new Meditation value to determine how far to the right it wags; at time 0.75, it reaches the extent of its right wag and begins its return to center; at time 1.00, it reaches center again and the Arduino sends a new Meditation value to determine how far to the left it wags for the next cycle.

If the headset only updates once per second (I haven't been able to find a definitive listing of how often it reads and outputs), that is fine as well: just use the Meditation value for the full wag cycle, symmetrically left and right, and have the ears and tail tilt only move once per second with each update.

The servos I'll be working with are the small TowerPro 9G micro servos. I am unsure if it would be best to buy a regular Arduino and BT dongle, or to buy the BT Arduino system; please advise, either on what you think is best or what you're most comfortable working with in programming. Since I want to run seven servos simultaneously, whatever I get needs to be able to handle this. Also, the XWave Sport preorders don't begin shipping until September, so working with the actual device isn't possible at present (will need to use a potentiometer or similar program as a stand-in to create fake Attention and Meditation values for testing anyway, as I don't think I know how to produce specific EEG patterns on command).

For your part, aside from creating the program to control this symphony of servo madness, you'll also need to be able to talk me through wiring, such as connecting the servos to the breadboard and the breadboard to the Arduino ("connect power to ground" means little to me; I work better with "take the black wire from the battery box and connect it to this place on the Arduino next to this highly-visible label"), and then walk me through pairing the XWave BT to the Arduino setup. I'll build it all myself, so we won't need to ship materials back and forth, but I need a guide who's patient and can respond within at least 24 hours or so to utter n00b nonsense questions (there is no final delivery date specified; it's just "when it gets done", so if you're busy I can understand). In return, you will receive a small amount of compensation upon successful completion of the project (with a little bonus if you are extremely helpful and patient, or if I royally screw something up and you save my bacon). I don't anticipate the code being extremely difficult after the BT pairing and data acquisition portions (moving servos is moving servos, after all), but I have dug up some resources.

Things which may be helpful to you:

XWave Logger software - This is the actual app used to communicate between the XWave headband and the PC.
MindSet Communications Protocol - While this is a different headset, it is based on the same Neurosky chips outputting the same EEG bands and eSense values (Attention and Meditation).
Mindwave & Arduino tutorial from Neurosky - Neurosky's instructions on how to deal with their data set, grabbing the Attention and Meditation values, etc.
kitschpatrol's Arduino brain library - Arduino code for dealing with Neurosky data as an ASCII string.
DiMauro's Arduino sketch - This is what Josh DiMauro used for his ears.

Your help is greatly appreciated!
3  Using Arduino / Project Guidance / Re: Bluetooth connectivity on: August 25, 2012, 11:38:29 am
Quote
Total novice and bluetooth do not belong in the same sentence. Or even the same paragraph.
And why is that? I presume it is to do with the programming, but what part? Device pairing? Noise handling? Error exceptions?

I had assumed that using BT would be easier, since the XWave comes with BT functionality and it means no digging around looking for which wire to pull out and splice (which would also tie the headset to this project alone, and also likely void the warranty, which I'm not interested in doing - for the price, I'd like to be able to reuse the headset for other things).
4  Using Arduino / Project Guidance / Bluetooth connectivity on: August 25, 2012, 03:24:43 am
I want my project to be able to receive Bluetooth signals from the upcoming XWave Sport headset (I prefer its appearance to the current Neurosky headset, and also think it's less likely to fall off during normal activities; headsets seem to have a habit of sitting too loose on me, and I don't want to drop a $100 device on the ground). Sending signals to other devices is unnecessary, as the Arduino will be wired to its outputs. Would it be better to purchase the BT Arduino or go for a regular Arduino and attach a BT dongle via USB? Range is not an issue as the BT device and Arduino will be used within 3-5' (1-2m) of each other. Which is cheaper, and which is easier for a total novice to set up?
5  Using Arduino / Project Guidance / Small, quiet servo recommendations on: August 06, 2012, 01:00:14 am
I could use some recommendations for small, quiet servos, as well as a question about mounting them.

Is it okay to mount one servo directly on top of the horns of another? If so, can I use the same size servos or should the top one be smaller, and by how much? Should I reinforce the horn with a small piece of metal to provide added stiffness, or is the plastic usually sturdy enough to support the weight?

At the moment, I am looking at the following two servos in consideration:

http://www.hobbypartz.com/33p-solarservo-a107.html
http://www.hobbypartz.com/88e-micro-2-5-g-servo.html

Has anyone ever worked with HobbyPartz.com or those particular servos? Do you have other recommendations you'd make? This is my first project of this type, so I don't have loyalties to any past company or brand. I'm looking for very tiny servos (less than 2.5cm/1" for the top one, and less than 4cm/1.5" for the bottom one if it needs to be bigger), and preferably fairly cheap as well (less than $10 per servo is good, less than $5 per servo is great - I need four, and another part of the project is a real moneysink, so I'm trying to save where I can). I know most every servo makes noise of a sort, but some are louder or higher than others (I've heard digitals can whine, and high squeals bother me more than low hums - the "mosquito tone" is a valid weapon here).

Torque and speed are low on my priority list. The absolute most I would ever need the servo to manage is 100° in 1/4 second, and that is a very extreme case - most turns will likely be 10° or less in the same amount of time, and I'm sure almost any servo could manage it. The whole weight on the bottom servo will likely be about 15g/0.5oz (dependent on the weight of the top servo), while the top servo only has 10g/0.3oz, so the load being moved is quite small. My primary concerns are size, noise, and cost - smaller and lower all around. What are your favorites to work with, and what would you recommend to me?
Pages: [1]