SEN0213 and ADS1115 not working on Raspberry Pi 4

userHead FridgeMagnetPoet 2022-09-06 05:22:54 1541 Views1 Replies

I am currently working on a project which includes reading data from an ECG (electrocardiogram) sensor onto a Raspberry Pi 4 Model B. The ECG Sensor I am using is the Heart Rate Monitor Sensor (SEN0213), and the ADC Module is the Gravity I2C ADS1115 16-bit ADC Module. To quickly give some background on the ECG Sensor:


There are three LEDs; "Heart", "L" and "R". When working correctly, "Heart" is supposed to imitate the heartbeat it is measuring, and therefore should be pulsing. "L" and "R", however, are leads-off LEDs and should not be on during operation. According to the datasheet: "In dc leads off detection mode, LOD− is high when the electrode to −IN is disconnected, and it is low when connected."


To summarise my attempts thus far:


1. I set up the ADC Module according to the tutorial and connected the ECG Sensor to the A0 row of the ADC Module. Note that the only difference in setup was that I used a 3.3V input to power the ADC Module instead of the tutorial's 5V, but since the Wiki states that the ADC Module can have an input voltage of 3.3V-5V, I don't believe this is the problem.
2. I ran a simple Python script that reads from the I2C pin every 5ms, and plots the data afterwards.
 3. All three of the ECG Sensor's LEDs were lit during the measuring phase, and the resulting graph showed that 3.24V (~3.3V) was the only value measured over the period. This is clearly not correct.
4. I then took the ECG Sensor and attached it to one of Sparkfun's RedBoards (similar to an Arduino). Here, the ECG Sensor was directly attached to an Analogue Pin and also received a 3.3V input. This setup is similar to the one provided in the ECG Sensor's tutorial.
5. I ran another simple Arduino code example provided by the Sensor's tutorial, which also reads from the pin and plots the data over time.
6. While running the code, the "L" and "R" LEDs were off and the "Heart" LED pulsed as expected. The output plot also displayed varying voltages in the shape of a standard ECG graph. 


My question is: 


What am I missing? Why would it work for the RedBoard, but not the Raspberry Pi? The only difference I could see between the ADC of the RedBoard and the ADC Module is that the ADC Module is 16-bit while the RedBoard's is 10-bit. However, I do not think this would cause a problem like the one I am experiencing. I am unsure where even to start looking for the solution to my problem, and thus any advice and help would be immensely appreciated!

2022-09-23 17:58:51


What raspberry pi system are you using? Are you using the ADS1115 example code? Can it be used normally with other analog sensors?

userHeadPic jenna