User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

EEG DIY

Thu Jan 03, 2019 1:04 am

...
Summary

I have been posting in this forum for 6 months but never opened any thread. My 2019 new year resolution has 101 things ;) , including opening a new Raspberry Forum thread, and a GitHub repository, ...

So there you go [1], my new thread! :mrgreen:


Contents

00. I have a dream
...
10. FAQ
...
30. What is new

70. Foot Notes

10. FAQ

Q1. Why opening a new thread?
A1. RE: USING EEG SENSORS TO TURN AN LED STRIP ON/OFF tlfong01 2019jan02
viewtopic.php?f=37&t=229740&start=25#p1410821

Q2. Do you have any old posts on EEG?
RE: USING EEG SENSORS TO TURN AN LED STRIP ON/OFF - tlfong01 2018dec26
viewtopic.php?f=37&t=229740#p1408312

/ to continue, ...

70. Foot Notes

Meaning of “There you go" - ELL (English Language Learners) StackExchange
https://ell.stackexchange.com/questions ... ere-you-go

The most straightforward meaning of 'there you go' or 'there you are' is when you give someone something. "Can you pass me that cake, please?" "There you go!". So the reason we say "there you go" when someone says something that is a good proof or example of a situation is that they have (metaphorically) "given" themselves the proof or summary. – topo morto Feb 6 '15 at 9:06

...
Attachments
eeg_wiki_2019jan0301.jpg
eeg_wiki_2019jan0301.jpg (190.12 KiB) Viewed 965 times
Last edited by tlfong01 on Thu Jan 03, 2019 5:46 am, edited 6 times in total.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Thu Jan 03, 2019 1:13 am

...
I have a dream

When I was very small, my grandmother always reminded me, "Every thief has a reason". She actually didn't give any explanation but her 6 year old wicked grandchild already had developed vague logical ideas of induction and reduction, and would cunningly and sinfully cheat by abusing generalization with inadequate specific examples. So before leaving school, he already knew that "All statisticians are liars", ...

The child didn't have much childhood, because he got matured much quicker than average (ie, abnormal ;) ), and discovered that he enjoyed talking to weird subhumans, who everybody keeps way, namely, those schizophrenia, ADHDs, etc, to name just a few. He 'luckily' lived in the poorest district of the city Shamshuipo, where he is still living), so he had plenty of samples of drug addicts, alcoholics, again just to name a few, to observe and do research ;) in the neighbourhood (actually often next door, or staircase, rooftop of the same ugly old building he lived, in the slum streets of Hong Kong ...


Ralph McTell Streets of London - 6,814,475 views
https://www.youtube.com/watch?v=DiWomXklfv8

/ to continue, ...

Appendices

The most important lesson from 83,000 [SPECT]brain scans - Daniel Amen, TEDx 2013, 6,645,982 views
https://www.youtube.com/watch?v=esPRsT-lmw8

“A society should be judged not by how it treats its outstanding citizens but by how it treats its criminals.” - Fyodor Dostoyevsky

"How do you know unless you look?" - Daniel Amen


Sham Shui Po - Wikipedia
https://en.wikipedia.org/wiki/Main_Page
...
Attachments
nfl_player_brain_2019jan0301.jpg
nfl_player_brain_2019jan0301.jpg (148.52 KiB) Viewed 910 times
Last edited by tlfong01 on Thu Jan 03, 2019 3:08 pm, edited 9 times in total.
I am an electronics and smart home hobbyist.

User avatar
Gavinmc42
Posts: 2351
Joined: Wed Aug 28, 2013 3:31 am

Re: EEG DIY

Thu Jan 03, 2019 3:21 am

Was going to reply to your other posts but probably better to do it here ;)
One of the things you need to worry about with medical stuff is galvanic isolation.
Going battery powered wireless avoids this :D

What about using Bluetooth transmitter, say a Microbit RF data to Pi or Smart phone for display?
The problem with the nRF51822 is the ADC is only 10 bit.
Can a 16-24bit ADC be used for the EEG signals?
https://para.maximintegrated.com/en/res ... io-sensors

I have a USB Lightstone Biofeedback I got with Wild Divine games but that is not EEG.
Wonder if there is a Linux library for Pi's that can read it? That's another project ;)
Heart rate, GSR etc are simpler than detecting thoughts, good enough for biofeedback training.

Electrically for EEG, good contacts are needed but optically, fitbit sensors like those in the Apple watch are now single sensor chips.
A search found this, 4 ch 24 bit ADC, probably other suppliers like TI or Analog have something similar
https://www.maximintegrated.com/en/app- ... vp/id/4272

Just a few of many :D
http://www.ti.com/product/ADS1299-4/des ... Everything
https://www.analog.com/media/en/technic ... AD7716.pdf

Two chip solution?
An i2c optical sensor and wired contact EEG/EKG 4 ch 24bit ADC add bluetooth BLE module like Microbit.

Wonder what chip Neurosky use?
The new TGAT2 is only 16bit ADC and is smaller?
Send raw data via bluetooth, algorithms are done on the Pi?
The Neurasky headset is bargain at $100 ;) But that's not the fun of DIY.

Stick one of those optical sensors in a tiny cylinder with BT and you have the Medical Tricorder sensor.
Pi Zero W with LCD for the display part of the StarTrek Medical Tricorder, TR-580 series?
But these days Smartphone with an App is the Tricorder of the future.

Could use a Zero W as the BT transmitter as it could do serious pre-processing.
More battery power needed.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

PhatFil
Posts: 743
Joined: Thu Apr 13, 2017 3:55 pm

Re: EEG DIY

Thu Jan 03, 2019 4:10 am

Hi

I have followed some of your posts, mainly to do with your load cell development and have found them both interesting and enlightening.

However you do have a tendency to over quote your own earlier posts imho, i offer this criticism constructively, and hope to continue to learn from your input here..

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Thu Jan 03, 2019 5:58 am

...

/ to continue, ...

Appendices
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Thu Jan 03, 2019 1:25 pm

Gavinmc42 wrote:
Thu Jan 03, 2019 3:21 am
1. Was going to reply to your other posts but probably better to do it here ;)

2. One of the things you need to worry about with medical stuff is galvanic isolation.
Going battery powered wireless avoids this :D

3. What about using Bluetooth transmitter, say a Microbit RF data to Pi or Smart phone for display?

4. The problem with the nRF51822 is the ADC is only 10 bit. Can a 16-24bit ADC be used for the EEG signals?

5. https://para.maximintegrated.com/en/res ... io-sensors

6. I have a USB Lightstone Biofeedback I got with Wild Divine games but that is not EEG.

7. Wonder if there is a Linux library for Pi's that can read it? That's another project ;)

8. Heart rate, GSR etc are simpler than detecting thoughts, good enough for biofeedback training.

9. Electrically for EEG, good contacts are needed but optically, fitbit sensors like those in the Apple watch are now single sensor chips.

10. A search found this, 4 ch 24 bit ADC, probably other suppliers like TI or Analog have something similar
https://www.maximintegrated.com/en/app- ... vp/id/4272

11. Just a few of many :D
http://www.ti.com/product/ADS1299-4/des ... Everything
https://www.analog.com/media/en/technic ... AD7716.pdf

12. Two chip solution?
An i2c optical sensor and wired contact EEG/EKG 4 ch 24bit ADC add bluetooth BLE module like Microbit.

13. Wonder what chip Neurosky use?
The new TGAT2 is only 16bit ADC and is smaller?
Send raw data via bluetooth, algorithms are done on the Pi?
The Neurasky headset is bargain at $100 ;) But that's not the fun of DIY.

14. Stick one of those optical sensors in a tiny cylinder with BT and you have the Medical Tricorder sensor.

15. Pi Zero W with LCD for the display part of the StarTrek Medical Tricorder, TR-580 series? But these days Smartphone with an App is the Tricorder of the future.

16. Could use a Zero W as the BT transmitter as it could do serious pre-processing.
More battery power needed.

13. NeuralSky

A couple of short comments first.

NeuralSky 16bit ADC at US$30+ each is too expensive, because I will be using more than 10 pairs of electrodes.

I am testing the very slow 24bit ADC HX711, only 80SPS, but fast enough for preliminary testing of sub 10Hz Alpha wave. I am only 30% sure I will have luck.


I have no experience nor equipment to handle SMD chips. So for now I can only consider assembled modules. I have just ordered the following, and hopefully start testing in the coming week.

Analog Devices AD8232 ECG Pulse Biosensor ¥40
https://detail.tmall.com/item.htm?id=57 ... 3ad4dJqlBM

Analog Devices AD8232 Single-Lead, Heart Rate Monitor Front End Datasheet
https://www.analog.com/media/en/technic ... ad8232.pdf

/ to continue, ...
Last edited by tlfong01 on Fri Jan 04, 2019 2:39 am, edited 1 time in total.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Thu Jan 03, 2019 2:01 pm

PhatFil wrote:
Thu Jan 03, 2019 4:10 am
1. Hi I have followed some of your posts, mainly to do with your load cell development and have found them both interesting and enlightening.

2. However you do have a tendency to over quote your own earlier posts imho, i offer this criticism constructively, and hope to continue to learn from your input here..

Over quoting old posts

1. Thank you for your nice words. I thought nobody is reading my ESP8266/HX711 posts, so I was wondering if I should close the thread on HX711 for weight sensor, and focus on HX711 on EEG amplification.

2. At first I did not catch your meaning of over quoting old posts. I skimmed my HX711 posts and found the following posts you might be referring to:

viewtopic.php?f=37&t=227137&start=75#p1400599
viewtopic.php?f=37&t=227137&start=75#p1401437
viewtopic.php?f=37&t=227137&start=75#p1401437

If that is the case, let me explain. As I said, they are (yes, long lists of) memory refreshing old posts. I agree they are useless for new readers who have not followed my old experiments. I must confess they are only useful for myself! :mrgreen:

You might refer to my other posts which I also include a much shorter list of old posts. Let me explain again. In my long list of HX711 posts, there are actually three or four main themes: (1) HX711, (2) ESP8266 NodeMCU Lua, (3) I2C MCP23017, (4) SPI MCP23S17). Actually most of my previous experiments failed at the end, so I needed to go back to the previous breaking/diverting point and start another path. But I usually forgot what did I do then. So I looked up the most recent post and quote it in my new experiment, (In case you have not already noticed, there is a little up arrow in the top right hand corner of the quoted posts, you click the arrow and you will be directed to the old post, ... So you just click click click and skim the old posts.)... This is of course useful for me with an unusually short memory, but I think also useful for the casual or new readers trying to follow, ...

You might like to let me know if I understand your question, before I make more excuses! :mrgreen:
Last edited by tlfong01 on Fri Jan 04, 2019 1:57 am, edited 2 times in total.
I am an electronics and smart home hobbyist.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 21130
Joined: Sat Jul 30, 2011 7:41 pm

Re: EEG DIY

Thu Jan 03, 2019 2:17 pm

Mod: removed the unnecessary poll. Not a useful addendum to the thread.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Thu Jan 03, 2019 2:36 pm

jamesh wrote:
Thu Jan 03, 2019 2:17 pm
Mod: removed the unnecessary poll. Not a useful addendum to the thread.

Many thanks for your advice.

I inserted the poll for the following reasons.

1. If polls the poll says my topic is not that appropriate great, then I am interested curious to know why and see if I should change the topic, say, from EEG to ECG or heart rate monitoring. Actually my objective is problem based learning, where problem or topic is not important important at all, but learning is.

2. If polls the poll says my English is not OK, then I would pay spend more time checking my grammar, and any possible misuse of slang slangs etc.
Last edited by tlfong01 on Fri Jan 04, 2019 2:09 am, edited 2 times in total.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Thu Jan 03, 2019 2:59 pm

tlfong01 wrote:
Thu Jan 03, 2019 1:25 pm
Gavinmc42 wrote:
Thu Jan 03, 2019 3:21 am
1. Was going to reply to your other posts but probably better to do it here ;)

2. One of the things you need to worry about with medical stuff is galvanic isolation.
Going battery powered wireless avoids this :D

3. What about using Bluetooth transmitter, say a Microbit RF data to Pi or Smart phone for display?

4. The problem with the nRF51822 is the ADC is only 10 bit. Can a 16-24bit ADC be used for the EEG signals?

5. https://para.maximintegrated.com/en/res ... io-sensors

6. I have a USB Lightstone Biofeedback I got with Wild Divine games but that is not EEG.

7. Wonder if there is a Linux library for Pi's that can read it? That's another project ;)

8. Heart rate, GSR etc are simpler than detecting thoughts, good enough for biofeedback training.

9. Electrically for EEG, good contacts are needed but optically, fitbit sensors like those in the Apple watch are now single sensor chips.

10. A search found this, 4 ch 24 bit ADC, probably other suppliers like TI or Analog have something similar
https://www.maximintegrated.com/en/app- ... vp/id/4272

11. Just a few of many :D
http://www.ti.com/product/ADS1299-4/des ... Everything
https://www.analog.com/media/en/technic ... AD7716.pdf

12. Two chip solution?
An i2c optical sensor and wired contact EEG/EKG 4 ch 24bit ADC add bluetooth BLE module like Microbit.

13. ...

14. Stick one of those optical sensors in a tiny cylinder with BT and you have the Medical Tricorder sensor.

15. Pi Zero W with LCD for the display part of the StarTrek Medical Tricorder, TR-580 series? But these days Smartphone with an App is the Tricorder of the future.

16. Could use a Zero W as the BT transmitter as it could do serious pre-processing.
More battery power needed.
A couple of short comments first.

Analog Devices AD8232 ECG Pulse Biosensor ¥40
https://detail.tmall.com/item.htm?id=57 ... 3ad4dJqlBM

Analog Devices AD8232 Single-Lead, Heart Rate Monitor Front End Datasheet
https://www.analog.com/media/en/technic ... ad8232.pdf


8. Heart Rate and GSR

Yes, I very much agree that heart rate and GSR is much simpler and can begin as a warm up to EEG. I am only 30% sure that my HX711 can detect EEG. My safety net is falling back to use HX711 to resume the weight sensing project, which is long stalled anyway.

The AD8232 Module I ordered is actually designed for heart rate monitoring. I wonder if it is very ideal to do ECG, not to mention EEG.

I have a cheap Polsar heart rate watch without data logging for doing 10k/21k jogging. So perhaps I can DIY a AD8232 based heart rate monitor with my Android phone.

...
Attachments
ad8232_adc_2019jan0301.jpg
ad8232_adc_2019jan0301.jpg (177.04 KiB) Viewed 851 times
Last edited by tlfong01 on Fri Jan 04, 2019 2:11 am, edited 1 time in total.
I am an electronics and smart home hobbyist.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 21130
Joined: Sat Jul 30, 2011 7:41 pm

Re: EEG DIY

Thu Jan 03, 2019 5:37 pm

tlfong01 wrote:
Thu Jan 03, 2019 2:36 pm
jamesh wrote:
Thu Jan 03, 2019 2:17 pm
Mod: removed the unnecessary poll. Not a useful addendum to the thread.

Many thanks for your advice.

I inserted the poll for the following reasons.

1. If polls says my topic is not that appropriate, then I am interested to know why and see if I should change the topic, say, from EEG to ECG or heart rate monitoring. Actually my objective is problem based learning, where problem or topic is not important, but learning is.

2. If polls says my English is not OK, then I would pay more time checking my grammar, and any possible misuse of slang etc.
1. Can be done in the main thread
2. You (and everyone else including English speakers) should check their grammar anyway!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Fri Jan 04, 2019 7:39 am

tlfong01 wrote:
Thu Jan 03, 2019 1:04 am

I'm dancing on Rainbows. Raspberries are not Apples or Oranges

First time hearing the above, I was loving it as Apple Pie. But I am also feeling inferior, because:

1. It reminds me of the elegant Japanese two line poems, with rigorous pattern rules, like 17 rhymes and interlacing things such as season, snow, tea, sakura etc.

2. My wicked character is every time I see good things, I would first criticize, and then try to make it better (that is why I don't like NeuroSky). My first attempt was to transpose 'apples' and 'oranges', but that makes things worse, though perhaps rhyme better. Or change to 'dancing in the sky', but of course ugly. So I gave up. :mrgreen:

/ to continue, ... if my new toy AD8232 ECG amp not arriving this afternoon.



Sakura - 4,306,490 views
https://www.youtube.com/watch?v=AK51LblcEOw
Last edited by tlfong01 on Fri Jan 04, 2019 8:07 am, edited 1 time in total.
I am an electronics and smart home hobbyist.

User avatar
Gavinmc42
Posts: 2351
Joined: Wed Aug 28, 2013 3:31 am

Re: EEG DIY

Fri Jan 04, 2019 8:03 am

https://www.youtube.com/watch?v=a-xWhG4UU_Y

It came from posts about the wish lists for the next Pi.
Pink Unicorns was a code word for the moderator to lock the post about fantasy Pi versions :D
There is one other old timer with a pink unicorn avatar ;)

The second line is referencing Apple computers and another fruity Pi clone.
Japanese Haiku? Hmm is it 17 syllables?

Re EEG chips they are very sensitive, did stuff decades ago, muscle movement of eyebrow could trigger them.
But they are probably better these days?
Still waiting for some nice low cost SQUIDS.

Some research into visible light lasers can measure/fix brain activity etc.
Might need them if I keep forgetting Pi stuff.
Not sure if it is because there is so much to learn or age related :D
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Sat Jan 05, 2019 3:17 am

tlfong01 wrote:
Fri Jan 04, 2019 7:39 am
/ to continue, ... if my new toy AD8232 ECG amp not arriving this afternoon.[/i][/color]

Analog Devices AD8232 Heart Rate Monitor Front End Module Arrives

The datasheet is 28 pages long, so should keep me busy for the whole weekend!

Analog Devices AD8232 Single-Lead, Heart Rate Monitor Front End (28 pages)
https://www.analog.com/media/en/technic ... AD8232.pdf

AD8232-EVALZ User Guide UG-514 (8 pages)
https://www.analog.com/media/en/technic ... UG-514.pdf

[/AD8232 AD8232ACPZ LFCSP-20 Analog Front End Chip - ¥9
https://detail.tmall.com/item.htm?spm=a ... abbucket=6

...
Attachments
ad8232_module_2019jan0401.jpg
ad8232_module_2019jan0401.jpg (160.07 KiB) Viewed 725 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Sat Jan 05, 2019 4:03 am


AD8232 EEG/ECG/EMG/HRM Poorman's DIY Evaluation Board Design Notes

Now I am studying the AD8232-EVALZ user guide, hoping to copycat a quick and dirty eval board for weekend fun!

Study Notes

AD8232-EVALZ Evaluation Board

Features

- operates in two electrode or three electrode configurations
- directly interfaces to data acquisition and ADCs
- for initial evaluation in fitness applications.
- switches/jumpers setting input bias voltage, shutdown (SDN), fast restore (FR), and ac/dc, leads off detection mode
- default configuration of a three electrode system that connects to the hands of the subject

Setup
- connect left arm (LA) terminal and the right arm (RA) terminal to signal source
- connect the right leg (RL) terminal to the source reference.
- right leg drive is available via the RL terminal.
- output signal is available on the OUT terminal.

Important Notice

- for safety reasons, evaluate with ECG signal source instead of a live subject
- electrode terminals are equipped with current-limiting resistors
- not comprehensive patient protection
- resistors may not protect against supply line transients or leakage currents

Amplifier and filters

- in-amp fixed gain of 100, op amp set for a gain of 11.
- overall gain is 1100 V/V, which limits the maximum differential input signal
to approximately 2.7 mV p-p.
- Exceeding this amplitude does not damage the AD8232; however, the
signal at the output appears distorted.
- Due to the high-Q of the filter, additional peaking sets the maximum observed gain more
than 1100 V/V at approximately 15 Hz.
- total gain can be changed by adjusting the R16 and R17 resistors, but doing so
has a direct impact on the Q of the low-pass filter.
- in-amp has a fixed gain of 100.
- single-supply configuration is used to implement the entire signal chain.
- two-pole high-pass filter for eliminating motion artifacts and the electrode half-cell
potential. Additionally,
- integrated op amp creates a two-pole low-pass filter to remove line noise and other
interference signals.
- frequency cutoff of all filters can be adjusted by changing component values

High Pass and Low Pass Filters

- high pass filter to amplify a small ECG signal by 100 while rejecting electrode offsets as
large as ±300 mV
- Low pass filter cutoff frequency at approximately 25 Hz and the gain to 11.

Leads off mode

- dc leads off AD8232 checks each input individually
- indicates which electrode is disconnected by setting corresponding LOD–/LOD+ pin high.

- AC leads off detection usually for 2 electrode when there is no separate driven electrode
- detects when an electrode is disconnected by sourcing a small 100 kHz current into the electrodes.

Fast Restore

- FR reduces the duration of otherwise long settling tails of the high-pass filters.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Sat Jan 05, 2019 4:27 am

tlfong01 wrote:
Sat Jan 05, 2019 4:03 am
AD8232 EEG/ECG/EMG/HRM Poorman's DIY Evaluation Board Design Notes

MAX30102 Integrated Pulse Oximetry and Heart-rate Monitor Biosensor Module

Just now I surprising found that the AD8232-EVALZ board is not at all for heart-rate monitoring, but for ECG. I vaguely remember the TaoBao shop sells another moudle solely for heart rate monitor. So I think using AD8232 to monitor is an over kill. I should forget about HRM and focus to EMG, ECG or EEG.

I think I would also include MAX30102 module in my shopping list.

Anyway, that is all for HRM. Next thing is coming back the AD8232 DIY evaluation board.


MAX30102 Blood Oxygen Wrist Heart Rate Pulse Sensor Module STM32 - ¥20
https://detail.tmall.com/item.htm?spm=a ... abbucket=2

High-Sensitivity Pulse Oximeter and Heart-Rate Biosensor for Fitness & Healthcare
https://www.maximintegrated.com/en/prod ... 30102.html

Description

The MAX30102 is an integrated pulse oximetry and heart-rate monitor biosensor module. It includes internal LEDs, photodetectors, optical elements, and low-noise electronics with ambient light rejection. The MAX30102 provides a complete system solution to ease the design-in process for mobile and wearable devices.

The MAX30102 operates on a single 1.8V power supply and a separate 3.3V power supply for the internal LEDs. Communication is through a standard I2C-compatible interface. The module can be shut down through software with zero standby current, allowing the power rails to remain powered at all times.

Key Features

Heart-Rate Monitor and Pulse Oximeter Biosensor in LED Reflective Solution

Tiny 5.6mm x 3.3mm x 1.55mm 14-Pin Optical Module

Integrated Cover Glass for Optimal, Robust Performance

Ultra-Low Power Operation for Mobile Devices

Programmable Sample Rate and LED Current for Power Savings

Low-Power Heart-Rate Monitor (< 1mW)

Ultra-Low Shutdown Current (0.7µA, typ)

Fast Data Output Capability

High Sample Rates

Robust Motion Artifact Resilience

High SNR

-40°C to +85°C Operating Temperature Range

...
Attachments
max30102_2019jan00502.jpg
max30102_2019jan00502.jpg (154.75 KiB) Viewed 706 times
I am an electronics and smart home hobbyist.

User avatar
Gavinmc42
Posts: 2351
Joined: Wed Aug 28, 2013 3:31 am

Re: EEG DIY

Sat Jan 05, 2019 5:17 am

For the SPI I use isolated power + comms, about to use this one next week.
http://www.ti.com/lit/ds/symlink/iso7840.pdf

Similar stuff available for i2c, been using this for years.
https://www.analog.com/en/products/adum1250.html
I have power on the sensor side so I only needed isolated comms.

Let me know how the MAX30102 goes, I have some MAX30105 dust/smoke sensors but I have to do a PCB for them.
Wish I had time to play with all those biosensors, new ones seem to come out every month.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Thu Jan 10, 2019 1:02 pm

jamesh wrote:
Thu Jan 03, 2019 5:37 pm
tlfong01 wrote:
Thu Jan 03, 2019 2:36 pm
jamesh wrote:
Thu Jan 03, 2019 2:17 pm
Mod: removed the unnecessary poll. Not a useful addendum to the thread.

Many thanks for your advice.
I inserted the poll for the following reasons.
1. If polls says my topic is not that appropriate, then I am interested to know why and see if I should change the topic, say, from EEG to ECG or heart rate monitoring. Actually my objective is problem based learning, where problem or topic is not important, but learning is.
2. If polls says my English is not OK, then I would pay more time checking my grammar, and any possible misuse of slang etc.

1. Can be done in the main thread
2. You (and everyone else including English speakers) should check their grammar anyway!


Trying new things in my own post

1. Thanks a lot for your advice. So I might add the poll in my main post later, but for sure not now, because I have not collected enough regular readers to make us a good sample. I once read that I need at least 40 samples to make a reliable survey.

2. I agree that everybody should check their grammar. Actually everybody asking or replying questions should do many more things, as listed below.


Appendices - Asking and Answering Questions

StackOverow - Can I answer my own question?
https://stackoverflow.com/help/self-answer

StackFlow - Writing the prefect question - jonskeet 2010aug29
https://codeblog.jonskeet.uk/2010/08/29 ... -question/

StackOverflow - How do I ask a good question?
https://stackoverflow.com/help/how-to-ask

How To Ask Questions The Smart Way - Eric Steven Raymond 2001
http://catb.org/esr/faqs/smart-questions.html
https://github.com/ryanhanwu/How-To-Ask ... Smart-Way (Chinese)

Rpi StackExchange - Code of Conduct
https://raspberrypi.stackexchange.com/conduct

---

Warning: My very long summary

StackOverow - Can I answer my own question?
https://stackoverflow.com/help/self-answer

Yes! Stack Exchange has always explicitly encouraged users to answer their own questions. If you have a question that you already know the answer to, and you would like to document that knowledge in public so that others (including yourself) can find it later, it's perfectly okay to ask and answer your own question on a Stack Exchange site. ...

---

Rpi StackExchange - Code of Conduct
https://raspberrypi.stackexchange.com/conduct

Our Expectations
If you’re here to get help, make it as easy as possible for others to help you.
Follow our guidelines and remember that our community is made possible by volunteers.

If you’re here to help others, be patient and welcoming.

Learning how to participate in our community can be hard. Offer support if you see someone struggling or otherwise in need of help.

Be clear and constructive when giving feedback, and be open when receiving it.
Edits, comments, and suggestions are healthy parts of our community.

Be kind and friendly.
Avoid sarcasm and be careful with jokes — tone is hard to decipher online. If a situation makes it hard to be friendly, stop participating and move on.

Unacceptable Behavior
No subtle put-downs or unfriendly language.
Even if you don’t intend it, this can have a negative impact on others.

---

StackOverflow - How do I ask a good question?
https://stackoverflow.com/help/how-to-ask

We’d love to help you. To improve your chances of getting an answer, here are some tips:

Search, and research
... and keep track of what you find. Even if you don't find a useful answer elsewhere on the site, including links to related questions that haven't helped can help others in understanding how your question is different from the rest.

Write a title that summarizes the specific problem
The title is the first thing potential answerers will see, and if your title isn't interesting, they won't read the rest. So make it count:

Pretend you're talking to a busy colleague and have to sum up your entire question in one sentence: what details can you include that will help someone identify and solve your problem? Include any error messages, key APIs, or unusual circumstances that make your question different from similar questions already on the site.

Spelling, grammar and punctuation are important! Remember, this is the first part of your question others will see - you want to make a good impression. If you're not comfortable writing in English, ask a friend to proof-read it for you.

If you're having trouble summarizing the problem, write the title last - sometimes writing the rest of the question first can make it easier to describe the problem.

In the body of your question, start by expanding on the summary you put in the title. Explain how you encountered the problem you're trying to solve, and any difficulties that have prevented you from solving it yourself. The first paragraph in your question is the second thing most readers will see, so make it as engaging and informative as possible.

Help others reproduce the problem
Not all questions benefit from including code. But if your problem is with code you've written, you should include some. But don't just copy in your entire program! Not only is this likely to get you in trouble if you're posting your employer's code, it likely includes a lot of irrelevant details that readers will need to ignore when trying to reproduce the problem. Here are some guidelines:

Include just enough code to allow others to reproduce the problem. For help with this, read How to create a Minimal, Complete, and Verifiable example.

If it is possible to create a live example of the problem that you can link to (for example, on http://sqlfiddle.com/ or http://jsbin.com/) then do so - but also include the code in your question itself. Not everyone can access external sites, and the links may break over time.

Include all relevant tags
Try to include a tag for the language, library, and specific API your question relates to. If you start typing in the tags field, the system will suggest tags that match what you've typed - be sure and read the descriptions given for them to make sure they're relevant to the question you're asking! See also: What are tags, and how should I use them?

Proof-read before posting!
Now that you're ready to ask your question, take a deep breath and read through it from start to finish. Pretend you're seeing it for the first time: does it make sense? Try reproducing the problem yourself, in a fresh environment and make sure you can do so using only the information included in your question. Add any details you missed and read through it again. Now is a good time to make sure that your title still describes the problem!

Post the question and respond to feedback
After you post, leave the question open in your browser for a bit, and see if anyone comments. If you missed an obvious piece of information, be ready to respond by editing your question to include it. If someone posts an answer, be ready to try it out and provide feedback!

Look for help asking for help
In spite of all your efforts, you may find your questions poorly-received. Don't despair! Learning to ask a good question is a worthy pursuit, and not one you'll master overnight.

.END
I am an electronics and smart home hobbyist.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 21130
Joined: Sat Jul 30, 2011 7:41 pm

Re: EEG DIY

Thu Jan 10, 2019 1:38 pm

Hi tlfong01

Looks like you are using the forum to blog about your experience, which is not really what the forum is for. I don't want to put you off, you are doing a great job, but can I suggest you find a dedicated blogging site to record everything you do, and just link to it from here? You can keep asking questions on here, and this will make them more obvious, as they won't be buried in a blog like post.

Thanks, and great work and enthusiasm!!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Fri Jan 11, 2019 7:40 am

jamesh wrote:
Thu Jan 10, 2019 1:38 pm
Hi tlfong01
Looks like you are using the forum to blog about your experience, which is not really what the forum is for. I don't want to put you off, you are doing a great job, but can I suggest you find a dedicated blogging site to record everything you do, and just link to it from here? You can keep asking questions on here, and this will make them more obvious, as they won't be buried in a blog like post.
Thanks, and great work and enthusiasm!!

Dedicated Blogging Site Combined with Short Q&A

Ah, your suggestion sounds good. So I have decided to open a blog site, perhaps 2 or 3 weeks from now. In the mean time, I will ask here questions for short answers and discussions. Below is an example.

CAT FOOD DISPENSER - HOW TO OPEN THE BOX TO LET THE FOOD FALL Postby tlfong01 » 2019-Jan-11 Fri 3:31 pm
viewtopic.php?f=37&t=230984#p1414845
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Sat Jan 12, 2019 8:49 am

tlfong01 wrote:
Fri Jan 11, 2019 7:40 am
Dedicated Blogging Site Combined with Short Q&A
Ah, your suggestion sounds good. So I have decided to open a blog site, perhaps 2 or 3 weeks from now.

Good Example of Short Q&A Posts + BlogSite

I found the following example good. I am thinking of doing something like it.

A Guide to FFT - by PeterO 2014jun28]
viewtopic.php?t=80525

A Practical Guide To Using Fast Fourier Transforms - PeterO 2014jun28
http://www.peteronion.org.uk/FFT/FastFourier.html
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Sun Jan 13, 2019 12:01 pm

Gavinmc42 wrote:
Sat Jan 05, 2019 5:17 am
1. For the SPI I use isolated power + comms, about to use this one next week.
http://www.ti.com/lit/ds/symlink/iso7840.pdf
2. Similar stuff available for i2c, been using this for years.
https://www.analog.com/en/products/adum1250.html
I have power on the sensor side so I only needed isolated comms.
3. Let me know how the MAX30102 goes, I have some MAX30105 dust/smoke sensors but I have to do a PCB for them.
4. Wish I had time to play with all those biosensors, new ones seem to come out every month.

BioSensors 2019

1, 2. Never heard of TI digital isolator or similar. I only know differential input to keep away noise, optical isolator thing to keep 3V Rpi GPIO from 5V relay, etc, and that is almost all.

3. MAX30102 is very low in my play list, may drop out of the list any time. The main reason is that it is too simple.

4. I don't worry I have too many bio sensors to play. My playlist never gets longer and longer, because those at the bottom of list get replaced by more new ones.

Just now I read about the startups in CES2019. I need to check them out.


The Most Interesting (and Bizarre) Startups at CES 2019 - By Rob Marvin January 11, 2019 4:30PM EST
https://www.pcmag.com/feature/365926/th ... t-ces-2019

From humanoid robots and wearable biotechnology to 4D holograms, autonomous undersea drones, and retro arcade games, check out the most outside-the-box tech startups we discovered at CES.

BrainTap

One of my most interesting moments at CES was walking past a few attendees laying in deep relaxation on the busy show floor with headsets covering their eyes and ears. It turns out the startup was offering a service called "Braintapping," which uses what BrainTap Technologies calls a "neuro algorithm" to sync a user's brainwaves to a specialized sound. The combination of binaural (dual-toned) beats through the headphones and gentle light pulses through the eye mask is designed to induce relaxation and "ensure maximum neuroplasticity" in about 20 minutes, controlled via app.

Amo Lab

Another South Korean startup called Amo Lab is using bioelectric medicine in a wearable sleep device called the Amo+ that looks almost like an amulet or necklace. Electromagnetic signals from the device stimulate nerves in the chest to reduce stress and stabilize your heart rate. The company started development in 2012, was officially founded in 2016, and plans to launch the Amo+ in the US and Europe this spring for under $200. Amo Labs is also developing another device that helps with blood circulation, respiration, and more. The science behind the device's cVES (cervicothoracic vagus electromagnetic stimulation) therapy is to stimulate the vagus nerve with mild electromagnetic signals to balance the parasympathetic nervous system.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Sun Jan 13, 2019 1:30 pm

tlfong01 wrote:
Sun Jan 13, 2019 12:01 pm
Gavinmc42 wrote:
Sat Jan 05, 2019 5:17 am
1. For the SPI I use isolated power + comms, about to use this one next week.
http://www.ti.com/lit/ds/symlink/iso7840.pdf
2. Similar stuff available for i2c, been using this for years.
https://www.analog.com/en/products/adum1250.html
I have power on the sensor side so I only needed isolated comms.

1, 2. Never heard of TI digital isolator or similar. I only know differential input to keep away noise, optical isolator thing to keep 3V Rpi GPIO from 5V relay, etc, and that is almost all.

Total optical isolation between Rpi GPIO and Relay Input

I skimmed the TI digital isolator datasheet and surprised to find that the isolation is done by a capacitor, nothing optical. The signal rate is up to 100Mbps, unthinkable for hobbyists like me.

The last time I thought about total isolation is between Rpi and relay, each with its independent power supplies of ground. Now I am using the relay to switch a solenoid, I need to check if more isolation is necessary.


RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jun-21 Thu 4:34 pm
viewtopic.php?t=77158&start=75#p1331076
...
Attachments
psu_scheme_2019jan1401.jpg
psu_scheme_2019jan1401.jpg (191.19 KiB) Viewed 415 times
Last edited by tlfong01 on Mon Jan 14, 2019 12:19 pm, edited 1 time in total.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Mon Jan 14, 2019 1:33 am

tlfong01 wrote:
Sun Jan 13, 2019 12:01 pm
Gavinmc42 wrote:
Sat Jan 05, 2019 5:17 am
Wish I had time to play with all those biosensors, new ones seem to come out every month.

Smart Cat Toilet

My wish project list never gets too long, because every month I see what I wish to do already done by someone else. This morning my wish project list does get one item longer - an auto cat toilet!

The First Full Automated Dog Toilet
https://www.inubox.net/

Forget about cleaning messy situations every single day. Inubox is designed for small and medium dogs, taking humans into consideration.

How it works

INUBOX knows when your dog steps on the platform and detects any waste left behind. Once your dog is away, our station closes the platform and starts the cleaning cycle in less than one minute, opening again to be used if needed.

All solid and liquid materials are passed through a solidifying process and contained in a closed bag. Once full, it delivers a sealed bag for disposal.

Features

Odorless
Seals away waste so that your home will always smell fresh.

Automatic
Detects your dogs activity and removes waste in seconds.

Smart
Remote configurable process, so its active when you are not there.

Friendly Design
Premium design makes it perfect for any home.

Clean and Eco-friendly
Stop pouring harmful chemiclas in your home.

Heavy Duty
We use premium materials for tough use.

...
Attachments
inubox_auto_dog_toilet_2019jan1401.jpg
inubox_auto_dog_toilet_2019jan1401.jpg (108.81 KiB) Viewed 434 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1000
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: EEG DIY

Tue Jan 15, 2019 2:00 am

Duplicated post to delete later

I seemed to have duplicated this post because I hit the reply button instead of the edit button. I would delete either post later. My apologies for any confusion caused.
tlfong01 wrote:
Thu Jan 10, 2019 1:02 pm
jamesh wrote:
Thu Jan 03, 2019 5:37 pm
tlfong01 wrote:
Thu Jan 03, 2019 2:36 pm

Many thanks for your advice.
I inserted the poll for the following reasons.
1. If polls says my topic is not that appropriate, then I am interested to know why and see if I should change the topic, say, from EEG to ECG or heart rate monitoring. Actually my objective is problem based learning, where problem or topic is not important, but learning is.
2. If polls says my English is not OK, then I would pay more time checking my grammar, and any possible misuse of slang etc.

1. Can be done in the main thread
2. You (and everyone else including English speakers) should check their grammar anyway!


Trying new things in my own post

1. Thanks a lot for your advice. So I might add the poll in my main post later, but for sure not now, because I have not collected enough regular readers to make us a good sample. I once read that I need at least 40 samples to make a reliable survey.

2. I agree that everybody should check their grammar. Actually everybody asking or replying questions should do many more things, as listed below.


Appendices - Asking and Answering Questions

StackOverow - Can I answer my own question?
https://stackoverflow.com/help/self-answer

StackFlow - Writing the prefect question - jonskeet 2010aug29
https://codeblog.jonskeet.uk/2010/08/29 ... -question/

StackOverflow - How do I ask a good question?
https://stackoverflow.com/help/how-to-ask

How To Ask Questions The Smart Way - Eric Steven Raymond 2001
http://catb.org/esr/faqs/smart-questions.html
https://github.com/ryanhanwu/How-To-Ask ... Smart-Way (Chinese)

Rpi StackExchange - Code of Conduct
https://raspberrypi.stackexchange.com/conduct

How to ask a question in the Arduino Forum - Nick Gammon 2013feb14
http://forum.arduino.cc/index.php?topic ... msg1118324

---

Warning: My very long summary

StackOverow - Can I answer my own question?
https://stackoverflow.com/help/self-answer

Yes! Stack Exchange has always explicitly encouraged users to answer their own questions. If you have a question that you already know the answer to, and you would like to document that knowledge in public so that others (including yourself) can find it later, it's perfectly okay to ask and answer your own question on a Stack Exchange site. ...

---

Rpi StackExchange - Code of Conduct
https://raspberrypi.stackexchange.com/conduct

Our Expectations
If you’re here to get help, make it as easy as possible for others to help you.
Follow our guidelines and remember that our community is made possible by volunteers.

If you’re here to help others, be patient and welcoming.

Learning how to participate in our community can be hard. Offer support if you see someone struggling or otherwise in need of help.

Be clear and constructive when giving feedback, and be open when receiving it.
Edits, comments, and suggestions are healthy parts of our community.

Be kind and friendly.
Avoid sarcasm and be careful with jokes — tone is hard to decipher online. If a situation makes it hard to be friendly, stop participating and move on.

Unacceptable Behavior
No subtle put-downs or unfriendly language.
Even if you don’t intend it, this can have a negative impact on others.

---

StackOverflow - How do I ask a good question?
https://stackoverflow.com/help/how-to-ask

We’d love to help you. To improve your chances of getting an answer, here are some tips:

Search, and research
... and keep track of what you find. Even if you don't find a useful answer elsewhere on the site, including links to related questions that haven't helped can help others in understanding how your question is different from the rest.

Write a title that summarizes the specific problem
The title is the first thing potential answerers will see, and if your title isn't interesting, they won't read the rest. So make it count:

Pretend you're talking to a busy colleague and have to sum up your entire question in one sentence: what details can you include that will help someone identify and solve your problem? Include any error messages, key APIs, or unusual circumstances that make your question different from similar questions already on the site.

Spelling, grammar and punctuation are important! Remember, this is the first part of your question others will see - you want to make a good impression. If you're not comfortable writing in English, ask a friend to proof-read it for you.

If you're having trouble summarizing the problem, write the title last - sometimes writing the rest of the question first can make it easier to describe the problem.

In the body of your question, start by expanding on the summary you put in the title. Explain how you encountered the problem you're trying to solve, and any difficulties that have prevented you from solving it yourself. The first paragraph in your question is the second thing most readers will see, so make it as engaging and informative as possible.

Help others reproduce the problem
Not all questions benefit from including code. But if your problem is with code you've written, you should include some. But don't just copy in your entire program! Not only is this likely to get you in trouble if you're posting your employer's code, it likely includes a lot of irrelevant details that readers will need to ignore when trying to reproduce the problem. Here are some guidelines:

Include just enough code to allow others to reproduce the problem. For help with this, read How to create a Minimal, Complete, and Verifiable example.

If it is possible to create a live example of the problem that you can link to (for example, on http://sqlfiddle.com/ or http://jsbin.com/) then do so - but also include the code in your question itself. Not everyone can access external sites, and the links may break over time.

Include all relevant tags
Try to include a tag for the language, library, and specific API your question relates to. If you start typing in the tags field, the system will suggest tags that match what you've typed - be sure and read the descriptions given for them to make sure they're relevant to the question you're asking! See also: What are tags, and how should I use them?

Proof-read before posting!
Now that you're ready to ask your question, take a deep breath and read through it from start to finish. Pretend you're seeing it for the first time: does it make sense? Try reproducing the problem yourself, in a fresh environment and make sure you can do so using only the information included in your question. Add any details you missed and read through it again. Now is a good time to make sure that your title still describes the problem!

Post the question and respond to feedback
After you post, leave the question open in your browser for a bit, and see if anyone comments. If you missed an obvious piece of information, be ready to respond by editing your question to include it. If someone posts an answer, be ready to try it out and provide feedback!

Look for help asking for help
In spite of all your efforts, you may find your questions poorly-received. Don't despair! Learning to ask a good question is a worthy pursuit, and not one you'll master overnight.

.END
I am an electronics and smart home hobbyist.

Return to “Automation, sensing and robotics”