I am working on an electrochemical step-scan experiment with a 3-electrode cell setup (working, reference, and counter electrodes) and a spectrometer. The spectrometer sends a 5V TTL trigger signal via a BNC cable when it collects data. My goal is to generate a precise pulse square wave in response to this TTL trigger, with specific voltage levels and timing, to control the electrochemical cell using a potentiostat.
Requirements:
Voltage Levels: for example: The square wave should transition from 0.05V to 0.35V when triggered and stay at 0.35V for 0.1 seconds before returning to 0.05V.
Timing Precision: Precision in timing (+/- 0.1ms) is crucial for my experiment. I need accurate control over the duration of the pulse (0.1second) and the pre delay (1ms) between the TTL trigger and the square wave response.
Ease of Use: While precision is vital, I also need a user-friendly solution, as this setup will be used for ongoing research, and it should be manageable by researchers with varying levels of technical expertise.
Hardware Options: I am considering using either an Arduino or a Raspberry Pi for this project, but I need guidance on which platform would be better suited to achieve the desired precision and ease of use.
Arduino Option: I have found an example on the GitHub website (Arduino-TTL-Trigger) that seems similar to what I need, but I'm unsure if it can provide the required timing precision. Should I pursue this Arduino-based solution, and if so, are there any modifications or additional components I should consider for improved precision?
Raspberry Pi Option: Alternatively, I am open to using a Raspberry Pi if it offers better timing precision and user interface. However, I am less familiar with Raspberry Pi projects.
Additional Information:
The spectrometer TTL trigger is received through a BNC cable.
I have basic experience with both Arduino and Raspberry Pi but am willing to learn and follow guidance.
Safety and precision are critical in this experiment.
I would greatly appreciate any advice, suggestions, or project guidance from the community on whether Arduino or Raspberry Pi is the better choice for this application and how to achieve the required precision in timing.
Voltage levels are set by the external electronics, not the Arduino (or other MCU).
Pulse timing and length precision and accuracy need to be specified (they are not the same). The MCU clock frequency can be defined as accurately as desired, simple by buying and installing an accurate crystal.
Thanks for pointing it out. I made the changes accordingly.
Timing Precision: Precision in timing (+/- 0.1ms) is crucial for my experiment. I need accurate control over the duration of the pulse (0.1 second) and the pre delay (1ms) between the TTL trigger and the square wave response.
Where in this
is your Arduino going to sit? Is it the "Function Generator"? So it also triggers the ATR, or is that arrow on the wrong end of the line?
Given your requirements stated, and presuming nothing else will be attached to the Arduino, then yes, this can be done with a Nano/Uno. Could even be a Teensy, if you're leaning to small.
B U T - will you want to be able to change any settings on the device?
How big a pulse overshoot are you prepared to accept?
Note that the MCU output pins deliver a TTL level signal (not always 5V). If you need a fixed 350mV output voltage you may have to use a temperature-compensated Zener diode and a voltage divider. A DAC may be a better fit if the required output voltage will vary.
A good point. Again, a better specification would help. 0.35V, with what tolerance? Is there a specification for the receiving device that defines this? What does the Potentiostat do with this signal?
Also, the potentiostat will be able to control constant current to the 3 electrode cell and control the voltage with better stability and measurement the voltage across the reference electrode and working electrode. If it was a two electrode system, I could directly use the pulse to control it but I also want constant current and extra electrode, so potentiostat can take the output from the Arduino function generator and supply stable voltage and current according to the square wave.
You go to great lengths to emphasize the square wave you need to generate, yet you say nothing about how you are going to control the capacitive and inductive reactance of your electronics so you can maintain the square wave you will be creating.
The impedance of all your components and wiring will greatly effect your square wave. That includes the layout of all interconnecting wiring.