pulse sensor reading (sen-11574)
pulse sensor reading (sen-11574)
Hello, I'm trying to read the sensor data from pulse sensor (https://www.sparkfun.com/products/11574). Can someone help me? I know that I cannot connect the sensor directly to ESP8266 otherwise, could damage the ADC port. Is it true (according to http://www.instructables.com/id/Online- ... nd-Cayenn/)?
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: pulse sensor reading (sen-11574)
pluse sensor use 5V or 3.3V, but esp8266's ADC range is 0-1V, so you need bleeder resistor to reduce voltage.
Re: pulse sensor reading (sen-11574)
Thank you, shaoziyang. I can read the value now, from 0 to 1024. I need to treat this value. Do you have a started point?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: pulse sensor reading (sen-11574)
@vitor The webref you provided gives a pointer to a solution. See the code in https://github.com/WorldFamousElectroni ... rduino.ino.
Writing a Python equivalent should be an easy exercise.
Writing a Python equivalent should be an easy exercise.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: pulse sensor reading (sen-11574)
How did you transform 0-3.3V sensor output to 0-1V input for the ESP's ADC input? Simply cutting off 2.3V by adding a single resistor can't do the trick, so what did you do?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: pulse sensor reading (sen-11574)
You need two resistors in series. I suggest 2.2KΩ connected between analog I/P and 0V. Then use a 4.7KΩ resistor between analog I/P and the pulse sensor output. A voltage of 3.3V on the pulse sensor will produce
3.3 * 2.2 / (4.7 + 2.2) = 1.05V on the analog input.
3.3 * 2.2 / (4.7 + 2.2) = 1.05V on the analog input.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: pulse sensor reading (sen-11574)
Thanks pythoncoder! I used your formula with higher resistors (because I did not have the ones you suggested) and it works perfectly (R1: 410 kOhm, R2: 181 kOhm)!