Comments (6)
I can't really troubleshoot your code unless you provide it.
Also will need to see the humidity sensor code.
Please provide a link to git repository for your code.
from pulsesensorplayground.
Thanks a lot for a quick response. I am able to solve the issue for DHT22 sensor after using the cactus_io_DHT22. Earlier I was using the dht.h library.
https://github.com/jindalak/Monitor.git
But I am still facing the issue for Heart Beat Rate
Thanks
from pulsesensorplayground.
Ok, I think I see a couple of issues.
First, don't use the line
Serial.println(analogRead(pulseWire);
The Pulse Sensor library takes care of the analog read part. Instead, use
pulseSensor.outputSample();
That will print the latest sample.
Second, you have a lot of serialprint lines in your code. I recommend you crank up your baud rate. Use something like 250000baud.
The DHT22 library you're using turns off interrupts to do it's readings, and then turns interrupts back on. This will cause an issue with the Pulse Sensor readings, since we're using interrupts to time the analog reads that we do.
Here's a possible fix: Don't run the DHT22 functions so often. The humidity is not going to change that rapidly, and so you don't really need high resolution samples. That will just give you noise.
Instead, read the DHT22 like every minute. Then when you're not reading the DHT22, run the Pulse Sensor. Now, we don't have an end() function in our library (yet), but the Pulse Sensor only draws about 4mA, so you can power it from one of your unused GPIOs. You can then turn the Pulse Sensor 'on' and 'off' by setting that pin HIGH and LOW. Further, you will likely want to use the BPM_Alternative code that we have, since it does not rely on interrupts. Using the BPM_Alternative code, you can 'turn on' and 'turn off' the Pulse Sensor sample reading by either calling or not calling sawNewSample(). When you're reading the Pulse Sensor, be aware that you can't do much else, because we are trying to time the readings at 500Hz (2mS). So any writes to the serial port or the lcd between Pulse Sensor analog reads will need to be quick.
Anyhoo, I think what you need to do is isolate your Pulse Sensor and your DHT22 activity from eachother so they don't cause problems.
Hope that helps!
from pulsesensorplayground.
Thanks a lot for your reply. I have cleaned up the code and put all Serial print statements under the debug if condition, so it will not run by default now.
I am in a process of implementing a switch between the PulseSensor and DHT, so that just one will be on for now.
But I am having hard time understanding/getting the pulse sensor only show a reading only if there is a pulse.
I have modified some examples for only pulse sensor and have these in my git repository. I don't know what am I missing.
https://github.com/jindalak/Monitor.git
I think if I separate out these two I will not have DHT interfere the Pulse. But I need to get the Pulse started working correctly. Please let me know if I am missing anything.
from pulsesensorplayground.
same problem i can't make 0 BPM when my finger not touch sensor
from pulsesensorplayground.
@wramang
This issue is a year old. Your comment lacks enough information to even begin to troubleshoot.
Please open a new issue and use your words to clarify the problem fully.
What's your hardware? What code are you using? etc..
from pulsesensorplayground.
Related Issues (20)
- GETTING STARTED WORKING BUT NOT GETTING BPM TO MONITOR HOT 5
- Quick question, my smart meter has a pulse HOT 1
- Getting_BPM_to_monitor sketch displaying random values at 11250 baud HOT 8
- Node MCU V1 - Plotter is working but no BPM in Monitor HOT 3
- I'm getting high BPM HOT 1
- Code error for sp32 pulse sensor data to thinspeak HOT 19
- Compatibility issue Nano BLE ABX00034 HOT 6
- PulseSensr_BPM_Alternative Compilation Errors HOT 7
- turning off/on the bright light when needed HOT 2
- Can't compile even when including "USE_ARDUINO_INTERRUPTS true" HOT 14
- GETTING STARTED WORKING BUT NOT GETTING BPM TO MONITOR , ALTERNATIVE HOT 1
- No BPM readings HOT 3
- Problem about sensor when connecting with Arduino NANO 33 loT HOT 3
- Pulse sensor BPM_to_Monitor script does not work on Arduino Nano Every HOT 5
- example for esp8266 HOT 3
- sampleTimer.stop() and sampleTimer.start issues HOT 6
- `multiple definition of __vector_11` when including `<Servo.h>` HOT 14
- When using the duration parameter of tone, the sound will be distorted HOT 12
- Heart rate is abnormally high HOT 5
- Pulse Sensor cpp library obsolete with Espressif ESP32 core update from versions 2.x to 3.x HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pulsesensorplayground.