AD8232/promini238 and Raspberry Pi

I think your note about the newer 328 3.3V Arduino version may be the clincher for success since that’s the only real change I made in the sketch–on the Raspberry Pi Zero, which solved the problem! Many thanks for your patience here.

Now for writing the graph to a video output file! I may have to return here again . . .

Hello again–long time since last time!

I would like to capture the Arduino numerical output going to the Raspberry Pi into a file on the Rpi. Which is easier, to split the IDE print line into the display as well as into a file, or to read the Rpi input from some program which captures the numbers coming into a port and passed to the display? (Am I asking reasonable questions?)

Thanks!

Stefan

Hi Stefan.

Either would work, but sometimes the simplest solutions work the best. You might try looking for a terminal program that has an option to log serial data to a file. I’m not aware of anything right off hand for the Pi that does that, but there’s a lot of programs for PC/Mac that have a logging option. I seem to remember the terminal program ‘Minicom’ having the ability to log to a text file, you might look into that.

Thanks Chris,

I’ll let you know what I find about Minicom et al.

Stefan

Tried to write serial to a file on the Rpi while ad8232 was running, and was told the port is busy. It looks like it can’t interrupt/split what’s coming into the Rpi display. But then after looking at an Arduino cook book at an O’Reilly library, there is a “Processing” recipe that looks like it will do that. My question now is, how is that recipe loaded, and to which, the Arduino, or the Rpi? I don’t see any Processing program in the IDE file, though it is mentioned in a comment in the IDE file I loaded to the Rpi. Is Processing prgrm already resident on the Arduino?

Stefanolof:
Tried to write serial to a file on the Rpi while ad8232 was running, and was told the port is busy. It looks like it can’t interrupt/split what’s coming into the Rpi display. But then after looking at an Arduino cook book at an O’Reilly library, there is a “Processing” recipe that looks like it will do that. My question now is, how is that recipe loaded, and to which, the Arduino, or the Rpi? I don’t see any Processing program in the IDE file, though it is mentioned in a comment in the IDE file I loaded to the Rpi. Is Processing prgrm already resident on the Arduino?

from O’Reilly: The Arduino team is planning to provide NewSoftSerial with future Arduino downloads. Check the release notes for your Arduino version to see if this software is already included.

Processing is a different piece of software by another company separate from Arduino. Unfortunately we can not provide support for Processing. It’s not something that resides inside your Arduino.

You need some sort of terminal software that allows you to capture data from a serial port and save it to a file. I don’t have any suggestions other than what I’ve already mentioned for that on a Pi.

Hello again! Back at it, only this time with a Rpi 3B+,

I’ve loaded the Arduino sketch and the Processing sketch from the

https://learn.sparkfun.com/tutorials/ad … okup-guide

Comparing the to Rpi’s:

Rpi0 // Rpi3B+

====================== =======================

OS //stretch 9.11 // Debian buster 10

Arduino //1.8.9 // 2:1.0.5+dfsg2-4.1

Ser.Mon // Y // Y

Ser.Plot // Y // N

Can I keep buster on the Rpi3 and still get a Serial Plotter option?

How does the Arduino 1.8.9 sketch incorporate that option,

but the 2:1.0.5 version does not?

Many thanks for any and all help!

Stefan

Stefanolof:
Hello again! Back at it, only this time with a Rpi 3B+,

I’ve loaded the Arduino sketch and the Processing sketch from the

https://learn.sparkfun.com/tutorials/ad … okup-guide

Comparing the to Rpi’s:

Rpi0 // Rpi3B+

====================== =======================

OS //stretch 9.11 // Debian buster 10

Arduino //1.8.9 // 2:1.0.5+dfsg2-4.1

Ser.Mon // Y // Y

Ser.Plot // Y // N

Can I keep buster on the Rpi3 and still get a Serial Plotter option?

How does the Arduino 1.8.9 sketch incorporate that option,

but the 2:1.0.5 version does not?

Many thanks for any and all help!

Stefan

Another comparison note re the Arduino scripts, or rather their locations: in the 1.8.9 version, on the Rpi zero, both the ino and pde files reside in the /home/pi directory and are available when running the .ino script; whereas in the newer version on the Rpi 3B+, they are required to be run from their respective "home" folders, AD8232ArduinoSketch, and Heart_Rate_Display. So my question remains, can the Rpi3B+ using Debian Buster OS provide both the "Monitor" and the "Plotter" outputs?

So my question remains, can the Rpi3B+ using Debian Buster OS provide both the “Monitor” and the “Plotter” outputs?

No, the Arduino IDE is not setup to do that. It’s a limitation of the IDE and has nothing to do with your computer or operating system.

Hi Chris,

So the 2.1.0.5 .ino file is not as capable as the 1.8.9 version? What kind of progress is that? I’ll see what the Arduino folks say.

And, minicom, grabs the serial output, leaving nothing for the monitor.

More to come…

Thanks, Stefan

Back again! That is, trying to capture the AD8232/promini328 output to a file.

  1. the sketch has a Serial Monitor which outputs lots of numbers. This monitor window also has a SEND button, but nothing happens when I fill in a file destination and press it.

  2. I’ve tried to modify the sketch program, but it still gets sync errors, and sends nothing to the file, only to the Serial Monitor. Here’s the program I’m using. Note String… lines

void setup() {

// initialize the serial communication:

Serial.begin(9600);

pinMode(10, INPUT); // Setup for leads off detection LO +

pinMode(11, INPUT); // Setup for leads off detection LO -

String filePath=“/home/pi/Documents/HMoutput/HM1”;

}

void loop() {

if((digitalRead(10) == 1)||(digitalRead(11) == 1)){

Serial.println(‘!’);

}

else{

// send the value of analog input 0:

Serial.println(analogRead(A0));

Serial.println(String(A0));

}

//Wait for a bit to keep serial data from saturating

delay(1);

}

Can my goal be accomplished from within the sketch? And if so how?

Thanks,

Stefan

An arduino can’t send data to a file on your pi, they are two separate systems even if they are connected via a USB cable. You can send data serially to a serial port but you need software running on your pi to write that out too a file.

If you’re talking about the send button in the arduino ide’s serial terminal, that’s for sending data back to your arduino, not the pi.