Main siteMain site  ForumForum  ForumSearch  Private messageEmail contact  RegisterRegister  Log inLog in 
Topic: Arduino EEG compatibility
Reply to topic
Author Message
Matthew.



Joined: Feb 10, 2014
Posts: 2

PostPosted: Feb 10, 2014 11:09 PM    Post subject: Arduino EEG compatibility

Hi there, i'm new on this forum! :)
In my project i've to use an EEG to get some datas, but my \"hardware\" is an \"hacked\" toy with arduino, so I'm asking if BioEra works correctly with my \"device\" or not.
If not someone could show me a way to make it compatible with the device or at least show me some programs that are similiar to BioEra which works with Arduino.
Thanks :)
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Feb 10, 2014 11:59 PM    Post subject:

BioEra does work with Arduino. Several people use it that way. I use it with Arduino Uno.

But you need to develop the communication over the serial port with the code on Arduino. And that may not be trivial, unless you can edit/upload your Arduino code so that it sends data format compatible with what BioEra can understand.
Matthew.



Joined: Feb 10, 2014
Posts: 2

PostPosted: Feb 11, 2014 8:51 PM    Post subject:

Mhm, thanks very much ^^\"
But, i'm a beginner in arduinio envroinment (I've begun ONLY for this project), so i'm really a dumb in this argument, so... can you explain in simplier words what you mean? And if there's a simple way to do it?
Thanks c:
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Feb 20, 2014 10:44 PM    Post subject:

Communication is the key. So it can be either Arduino code which sends data in a format which BioEra understands, or it is BioEra code which understands what is sent from Arduino.

The latter requires usually a custom BioEra driver for that specific data format. That is a lot of work so we won't discuss it here.

The former requires that you can edit/modify your Arduino code. If that is not true, then you are probably out of luck and can't communicate with BioEra.

If you can modify your Arduino code, then you can format the output data to something that BioEra understands. For example using this element:

http://www.bioera.net/manual.html#_TextStreamToScalars

All you need to do in Arduino code is send it in that format. And send it over serial port (if your Arduino has USB).
spektrolyte



Joined: Jan 16, 2016
Posts: 23

PostPosted: Jan 16, 2016 10:39 AM    Post subject:

I too am interested in receiving biofeedback data from an Arduino, to complement the EEG.

The link above just goes to the contents page of the manual so I am not sure which element is being referred to.

Where can I find information on the code formatting, and which driver would be used to receive that data in BioEra?

Thanks
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Jan 16, 2016 10:47 AM    Post subject:

I updated the link to TextStreamToScalars element, please try it again.

You should find there the answer to your question. If not, feel free to ask here for more clarification.

I have used BioEra with Arduino in many small projects.
spektrolyte



Joined: Jan 16, 2016
Posts: 23

PostPosted: Jan 16, 2016 10:55 AM    Post subject:

Thanks Jarek,

I would like to include breath, GSR and HRV data collected by an Arduino, to augment the EEG data coming from my OpenBCI board.

If you have any code for collecting data such as this I would be interested to see it.

The text to scaler element looks quite simple to implement.
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Jan 16, 2016 12:43 PM    Post subject:

This is all too simple to have any kind of special code or library.

You will need something like this in your Arduino code:

int breath = 123; // Your value
int gsr = 345; // Your value
String datarecord = "" + breath + " " + gsr + "\n"; // I did not test this concatenation but it should work

Print(datarecord); // This should be executed at constant rate, for example 100 times per second

Then in BioEra design set the TextStreamToScalars to read 2 columns, fields separated by a SPACE and ended by LF (line feed).

Something like in this design:
http://proatech.com/design/textstreamtoscalars.bpd
spektrolyte



Joined: Jan 16, 2016
Posts: 23

PostPosted: Jan 16, 2016 2:38 PM    Post subject:

Excellent, thanks. Will give it a try soon.
spektrolyte



Joined: Jan 16, 2016
Posts: 23

PostPosted: Jan 16, 2016 2:38 PM    Post subject:

Excellent, thanks. Will give it a try soon.
spektrolyte



Joined: Jan 16, 2016
Posts: 23

PostPosted: Feb 22, 2016 9:36 AM    Post subject:

There is now an Arduino sending temperature data into BioEra as a single numeric value (xx.xx)

Occasionally it makes a bar display flicker but mostly no data is displayed.

Does the signal rate need to be declared somewhere in order for it to read the incoming data at the correct interval?
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Feb 22, 2016 10:18 AM    Post subject:

If TextStreamToScalars is connected directly to BarDisplay, then no, nothing more is needed and the value should be displayed there correctly.

I suspect that maybe your Arduino code sends something more than that value, maybe an empty line?

You may want to try to connect ObjectDebugger to the output of TextStreamToScalars and see exactly what is sends out.

Also see if there are any errors or warnings on Console (start BioEra with Console).
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Feb 22, 2016 10:26 AM    Post subject:

Another thing to check is the SerialPort baud (speed). It must be the same as initialized on Arduino side.
spektrolyte



Joined: Jan 16, 2016
Posts: 23

PostPosted: Feb 22, 2016 10:38 AM    Post subject:

Yes this is where I got stuck.

The serial port seems to output scalar, so ObjectDebugger and TextToScalar don't connect to the serial output.

There are no spaces in the incoming data, just a steady stream of xx.xx numbers 20 times per second. I thought I would make it simple to begin with.
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Feb 22, 2016 10:40 AM    Post subject:

This is an example design which simulates Arduino output (the top elements) and sends the text stream to TextStreamToScalars when you press the button.

You need to make sure, that your Arduino (output from SerialPort) sends something similar to the byte values printed on BioEra console.

http://proatech.com/design/arduino_simulation.bpd
spektrolyte



Joined: Jan 16, 2016
Posts: 23

PostPosted: Feb 22, 2016 2:49 PM    Post subject:

OK. The port and baud are set correctly, the device connects and starts transmitting but I don't get anything in the console other than information about the TextToScalar configuration.

At the moment the output of the arduino looks like this in another serial monitor. There are no spaces after the numbers.

22.21
22.23
22.31
22.28
22.23
22.19
22.21

Is it not posible to use those values directly without converting into bytes? This is the data I wish to display in a trend graph.
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Feb 22, 2016 3:14 PM    Post subject:

Looks to me, like you have problem receiving anything from your Arduino. You need to make sure, that SerialPort receives data from Arduino (its serial port).

If you connect ScalarDebugger to the output of SerialPort element, you should see some numbers printed on console (similar to what is printed in the simulation example). If you don't, then this must be fixed first.

I can't really advice more how to do this - checking the port and baud (which must be the same as set in your arduino code) should be all you need (also make sure your serial port is not already connected to another program like your other monitor).
spektrolyte



Joined: Jan 16, 2016
Posts: 23

PostPosted: Feb 22, 2016 4:17 PM    Post subject:

Yes I see those numbers in the console if I connect the serial port in place of the toggle button in your example.
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Feb 22, 2016 4:25 PM    Post subject:

No, do not connect SerialPort "in place" of the ToggleButton.

Create a completely new design, where you have ONLY 2 elements:
1. SerialPort
2. Debugger (connected to its output)

And check if you see any numbers printed on Console now.
spektrolyte



Joined: Jan 16, 2016
Posts: 23

PostPosted: Feb 22, 2016 4:27 PM    Post subject:

I meant toggle example. I am seeing the data, trust me. Without much documentation learning this is difficult. I appreciate your help.
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Feb 22, 2016 4:32 PM    Post subject:

Can you copy your console text and paste it here when running this design:

http://proatech.com/design/arduino_serial_console.bpd
spektrolyte



Joined: Jan 16, 2016
Posts: 23

PostPosted: Feb 22, 2016 4:35 PM    Post subject:

Arduino debugger(7): 50, 48, 46, 51, 48, 13, 10
Arduino debugger(7): 50, 48, 46, 50, 54, 13, 10
Arduino debugger(7): 50, 48, 46, 51, 48, 13, 10
Arduino debugger(7): 50, 48, 46, 51, 48, 13, 10
Arduino debugger(3): 50, 48, 46
Arduino debugger(4): 51, 50, 13, 10
Arduino debugger(7): 50, 48, 46, 51, 48, 13, 10
Arduino debugger(7): 50, 48, 46, 51, 50, 13, 10
Arduino debugger(7): 50, 48, 46, 51, 50, 13, 10
Arduino debugger(7): 50, 48, 46, 50, 50, 13, 10
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Feb 22, 2016 4:35 PM    Post subject:

OK, your console looks good.

All you need to do now is make sure you do NOT see the 13 in that listing (replace Println with Print in your arduino code).

See the last note in the manual:
http://www.bioera.net/manual.html#_TextStreamToScalars
Reply to topic