Help for ESP8266

Hi everybody,

I’m creating an ECG (electrocardiogram).
The purpose is to send the ECG values to my macbook using an ESP.

I can’t find any tutorial on the internet that could explain me how to connect correctly the esp to my macbook pro. The ESP must just send the values by wifi.
Could someone please help me or send me a tutorial link ?
I’ve arduino boards : uno, leo eth, nano and mini pro.

Thanks in advance

This appears to do what you want: http://www.instructables.com/id/Getting-Started-with-the-ESP8266-ESP-12/ . It basically uses a USB to serial converter on the Mac end in to a esp board to connect to the Mac. A terminal emulator program in the Mac (or presumably a program of some kind that can access the serial port) gets the data.

Peter

Hi Vanepp
thanks for you message.
I use a esp-1 (smaller)
It’s strange, this is the first tutorial I’ve seen that talk about a “CP2102”, is it a kind of FTDI ?

I’m completely confused, too much tutorial saying different methods…

I will try and help but I really don’t know what you re asking?

To connect it to your MAC you just have to power up the ESP-01 and then on your MAC look for its wifi network and connect to it. To get data from it you have to have a program on the esp-01 doing what you want. Search the web for esp8266 webserver. Once you have a server of some kind on the ESP-01 you will be able to request info from it.

You could also go Vanepps route using two ESP-01. One connected to your laptop via a serial adapter (cp2102 is a serial adapter like ft232) and the another connected to your device. This is essentially a wifi serial bridge. (google esp8266 wifi serial bridge)

I should also say that by default esp-01 has AT firmware on it and it is set in AP (access point) mode. This means you can connect to it directly and even send it data and retrieve data but not in an easy way. That is why you want a server running on it. You can change the AT firmware to STA (station) mode where it connects to an existing network and you acces it via an IP address assigned by your router. It can also be set to do both at the same time.

I think this would be a good starting point with a web server. https://learn.adafruit.com/esp8266-temperature-slash-humidity-webserver/overview It is a basic web server on an esp8266 reading a few sensors and providing the readings on easily accessible web pages.

Hi Sublimeartistry,

thanks for you help.

My principal request is how to connect and setup an ESP8266-01 to send an ECG signal to my macbook pro, as the diagram below :slight_smile:

As I’ve found so many different tutorials on the internet that my head is nearly to explode xD

I think my link to the Adafruit tutorial should get you going. If you also have an Arduino tutorial on using the heart monitor you should be able to use that code for reading the sensor from the heart rate monitor in place of the temperature sensor code in the Adafruit tutorial. As for the MAC side of things I do not think you will have to do anything special since the ESP8266 will be serving a web page that anything connected to its network can view. But I really do not know anything about MACs as I am a Linux user and stay away from Apple/Microsoft/Android.

EDIT: You should not need the Arduino at all unless your sensor has an Analog output. But if you had an ESP-12 you could use one Analog sensor on its one Analog input pin. You can program the onboard microcontroller of the ESP8266 with the Arduino IDE using the same program you would on the Arduino as long as you change the pin numbers (and have enough pins)

thanks I will follow the Adafruit tutorial.

In fact our goal is to use this project in a dance show.
The signal in the macbook pro is converted into midi signal with Max5 you have the Linux version called Pure Data :wink:

That will allow you to request information from the ESP8266 but the rate you can request said data may be limited. It almost sounds like you want to stream data using the ESP8266. If the request method does not work you can google “esp8266 stream data” and find a few existing projects doing just that.

The part I currently see that will make all of this hard is the MAC side of things. Are you writing a program for it to read and convert the data automatically? If you are writing your own software on the MAC you could use the stock AT firmware on the ESP8266 connected to the sensor without the Arduino. Then your MAC program could use the AT commands to manipulate the pins and get the data from the heartrate sensor. But at that point you would have to basically write a library for the MAC to read the Heartrate monitor.

I have only used the ESP8266 as a web server and set up the AT firmware to run it.

Registrering a proper ECG of a moving person is challenging. You mostly get motion artifact and wandering baseline https://www.aclsmedicaltraining.com/blog/guide-to-understanding-ecg-artifact/ .
Artifacts can be reduced using a proper filtration. Have a look at AD8232 datasheet https://cdn.sparkfun.com/datasheets/Sensors/Biometric/AD8232.pdf page 24 and 25. It requires a bit tinkering to change SMD-resistors and capasitors on the breadbord. The original breadboard is supposed and suitable to record a resting ECG. It means that when recording, the only moving muscle is your heart.
A heart rate can also be measured by pulse sensor or ready made heart rate monitor https://www.adafruit.com/product/1077.