Ey guys, after working on this along the afternoon I have solved the issues in our case.
For the future generations that want to integrate Rodeostat in their Arduino based platforms:
The Hardware: As Will has said before, you will need to connect the Arduino to the teensy in one of the possible ways (SoftwareSerial, I2C, SPI, Hardware Serial (like Serial2...)). In our case we have connected it by Hardware Serial, with Serial2 in the pins 26 of the P14 connector (see the schematic that Will attached before, remeber that the arrow in the pcb indicate the first pin of the header) to a TX pin in the Arduino (in our case the TX2 pin in Arduino Mega) and the 31 (also in the P14 connector) to the RX pin in the Arduino. For powering the rodeostat you will also need to connect the ground from teensy (like the one in the P13 or P14 connector) to the ground in Arduino, and 5V of Arduino to the pin 5V in the teensy PCB. This last pin is located under the P13 connector, there are four pins and the sign "5V" are near the internal pin of the PCB but TAKE CARE the 5V pin is the one in front of this, the one near the border of the PCB. That letters lead to an error.
The Arduino software. You could use the one that @HoughA have post before, measuring the voltage between the "DAC BIP" hole in the pcb and a hole connected to ground. The voltage should change between 1 and 0 every second (if you polymeter don´t change this fast, just change the code and set a delay of 5 secs).
Teensy software. First of all, you will need to add this lines to the setup function in the Arduino file (these lines are specific if you are using Serial2 communication, substitutes them for your own system):
You will need also to change the functions that receive the messages from the normal usb serial port, and set them to receive by Serial2 port instead. For doing this just open the files ps_message_receiver.cpp and ps_message_sender.cpp (this one if you want to also receive the response in your arduino instead of your PC) from the potentiostat library and change every line in which you see "Serial." to "Serial2."
If you made only this changes you will have the problem that @HoughA have faced before; Your Arduino and your Teensy only communicates after you send something over the normal Serial port with a PC. This is because we don't have changed the Serial Event handler in the Arduino code. This handler triggers on with a new Serial communication and updates the message data.
This handler function is located at the bottom of your .ino file. Is called SerialEvent and you will need to change it to SerialEvent2 (To handle Serial2 events instead of Serial events).
Sorry for my poor English. Hope this comment has given you a hand.
Hi Dickson, I am also interested in the Increasing current ranges. Please tell me how to swap out R8 ? I found the R8 resistor has been fixed in the board. Would I add another external trans impedance amplifier feed back path to increase the current range ?
@Will-Dickson Thank you so much for the suggestions. I could make it work with the AVRISPMKII programmer. Also, your modified firmware, especially the makefile was very helpful and made my work absolutely easy. Thank you once again.
After buffering the data, the limitation in sampling frequency appears to come from the testTimer function. This function has a specific runtime, and runs on a timer interrupt. If the timer interrupt's period (testTimerPeriod in ps_constants.cpp) is smaller than the actual time it takes for the function to run, the function does not run correctly, yielding incorrect and strange results.
For those looking to increase their sampling frequency, this seems to be the next bottleneck after the data streaming. Perhaps some alteration/optimization of this function could increase the sampling rate slightly, perhaps not.
Ultimately, to increase the sampling frequency of the Rodeostat, you can:
Decrease MinimumSamplingPeriod within ps_constants.cpp in order to remove the software limitation on sampling frequency
Remove calls to convertMstoUs in ps_periodic test and in ps_system_state.cpp, allowing for periods to be passed directly in units of us, rather than being limited to a sampling period of an integer in ms
In serviceDataBuffer (in ps_system_state.cpp) , modify the function so that it does not transmit data until test done flag has been set (by putting an if statement around most of the function).
With this we were able to achieve higher than the stock sampling frequency for a small number of periods (this was limited by the memory, since the data buffer would get filled with too many points since we did not clear it until the end). Unfortunately, high frequencies like 10kHz or 100kHz did not seem to be reachable.
In addition, thank you @Will-Dickson for your help figuring this out.
The values returned are the raw integers read from the ADC (analog to digital converter) on the output of the transimpedance amplifier (current to voltage converter). You will need to convert these integer values to current measurements e.g. uA. While it is possible to do a first principles calculation using the values of the feedback resistor in the transimpedance amplifier it is generally better to just do a simple calibration using a dummy cell consisting of a single resistor (of known value R).
The basic idea is to connect the counter and reference electrodes to one side of the resistor and the working electrode to the other side. You then want to sweep the voltages through a range of values - e.g. via a cyclic voltammetry test. Because the resistance R is known for each output voltage v(t) in the test you can calculate the current i(t) = v(t)/R through the resistor. At the same time you have the measured ADC integer values n(t) corresponding to this current. To get the calibration you can just perform a linear fit between the ADC integers n(t) and the know current values i(t).
When performing the calibration test make sure to select an appropriate resistor. You want to generate currents which span the input range (for current), but don't go outside of it. The transimpedance amplifier can't generate voltages higher then 3.3V or lower than 0V - so if you go outside of the current range you will get clipping (or saturation) of the output which will show up as a flat spot in your calibration data.
Oh gosh, you are right! I’m sorry for the delay but I was very busy. I have never thought to rotate the LED matrix because I thought I was right with that (otherwise, if not, no LED would have turned on). Thanks very much! I also take advantage of you for another issue. I have tried to load the arena configuration on the SD card but PControl doesn’t let me do that. Have you any suggestion? It seems that the controller doesn’t communicate to the SD nevertheless at the beginning (when the controller is switch on) PControl finds and initializes the SD card. I’m sorry because of all these questions!
Thank you so much! We tried rebooting it before with the potentiostat.ino file; however, we had set CPU speed to 96 MHz and Optimize to "FASTER". It is now working with the settings you specified. Thank you again.
This is an upgrade of the software from Python2 to Python3 and from PyQt4 to PyQt5. It was a pretty big upgrade and there could still be some bugs lurking. If you run into any let me know and I will try to deal with them as quickly as possible. However, supporting the Python2/PyQt4 version of the colorimeter software was starting to get to be too difficult so I really needed to upgrade.
I bundled the python software into a single executable using pyinstaller. The final executable came out kind of large (200MB) which results in a bit of a slow application launch. I'll see if I can reduce the size in the future, but I didn't want this to stand in the way of getting you something to work with.
At this concentrations, it should not be too much of a problem to measure Pb, even though GC electrodes are not very sensitive. Is -400mV a low enough potential to accumulate Pb onto the electrode ? Have you tried at -0.8V?
Also, I don't know if there is Cu in your solution but I remember having some disappearance of the Pb signal with addition of Cu.
If it doesn't work, maybe try a gold electrode which is a bit more sensitive to Pb. Or maybe modify your GC electrode by depositing some bismuth on the surface.
@Will-Dickson, thank you! It works for me on my Windows 10 machine!
I did have some initial connectivity issues, and because my Arduino IDE was old, I uninstalled and reinstalled the latest version of the Arduino IDE to get the latest Windows drivers. The connectivity issues disappeared after that and a reboot.
I've been working on firmware examples for the new featherwing. Right now all of the examples use circuitpython. I haven't put in an online repository yet. I will do this in over the next few days. I've been pretty pleased with how well circuitpython has worked for this - very easy and quick to program.
Right now all of the firmware examples just stream the data back to the host PC over USB. I am also pretty excited about trying to make some standalone devices which use feathers such as the pygamer https://www.adafruit.com/product/4242 which have a display, battery connection/charging, SD card, etc. The rodeostat featherwing can be plugged directly into the connector on back. It seems super nice for making a battery powered portable device. The pybadge is also interesting https://www.adafruit.com/product/4200. I think both are still available from Digikey.
We should have the featherwing PCBs available in about two or three weeks. There is some uncertainty on when we will receive the PCBs ... not surprisingly.
Corrosion monitoring and analysis usually takes a large dynamic range (eg polarization curves etc.) or requires measurements with respect to open circuit (LPR, EIS , OCP-monitoring). These are not well-suited to the current version of cheapstat.