I am new with Arduino. I have a task to automate the slowcontrol process of a camera for capturing certain experimental data. The Arduino needs to be controlled through a GUI and simultaneously check for a machine trigger. It needs to provide a 'high' (i.e. '1') signal to trigger the data acquisition.
I'm trying to formulate some python code via importing Arduino-Python3 Command API (i.e instead of using Arduino IDE), but really a bit clueless at the moment. Can anyone please help with any possible solution-idea(s) on building the code?
Hello,
On Desktop and we have mac and windows both kinds.
and no, not datasheet, rather to link to the camera. So, the GUI needs to control a digital micromirror device (MEMS) and also the Arduino board while checking for the machine trigger simultaneously.
Hello,
Thanks!
would that work for our Arduino here, which needs to provide a “high” signal to trigger the acquisition? to control the Arduino through the GUI is one part and simultaneously the Arduino needs to check for the machine trigger.
okay, thanks again!
I see in that link of yours (Why do serial commands from Python don't run Arduino when sent in a for loop?) :
you suggested a method of using pyserial module. I'm not familiar with it, but will try to understand how it works.
for the second part (i.e for Arduino to provide a high signal to trigger the acquisition)- can you please explain a bit more? because that part is not suggested in that link if I understood correctly(?)
in the post the user was using serial communications hence the use of pyserial
if you are using a microcontroller with WiFi (e.g. ESP32) you could use TCP/IP - see esp32-s3-softap-connect-and-receive-data-with-python
try a web search for arduino digital input will give you some ideas about checking your machine trigger
could you upload a schematic of your circuit?
I am using Arduino leonardo with a LAN connector (ethernet).
The rough sketch of the set up is attached herewith...
(DMD is the digital micromirror device (MEMS))
So the Arduino receives via a serial interface a command that shall trigger the camera to take a picture?
The arduino-Code must observe a digital input from a machine.
This machine sends a new trigger-impuls once every 100 milliseconds that shall trigger the camera to take a picture?
How can the camera be interfaced?
simple IO-pin switching HIGH/LOW 5V/0,0V?
thanks @horace, it helps for the first part.
I will start working with this base.
But, still a bit clueless about the 2nd part i.e. Arduino checking the digital input for the machine trigger and sends high signal to the trigger the acquisition by the camera.
Hi Stefan,
yes that's correct, everything you said.. (except that- am trying to connect arduino via ethernet)
So, while I take some ideas as horace suggested about that python code for ethernet arduino connection, any help on the triggering part please (i.e. checking the digital inputs for the machine trigger and sends signal for data acquisition to the camera)?
You have to provide the specifications.
What voltage does the machine triggering signal have?
How much amperage can the machine-signal deliver?
Is it open-collector?
Hi Stefan,
sorry for my late response. So, to answer your specifications:
-regarding the voltage of the machine triggering signal: we don't have the exact numbers yet, as it is on a different experimental facility, wild guess is 5V.
-The machine-signal's amperage is quite low, I don't know it by heart. not sure what do you mean by 'open collector'.
The camera-trigger input is 3.3V
does this help?
The Arduino can be connected either by ethernet or by usb, so for the latter, I guess I can see the forum chat, suggested by @horace on serial connection (?)
As per the earlier attachment of my schematic, I need to find a way (not sure how) to define a function inside the python code to initiate automation control of the GUI to talk to the DMD device. Then the DMD should communicate to the Arduino through some volt. Any ideas or suggestion are very welcome and appreciated.
initially don't worry about a GUI
just send commands from the keyboard over serial to the arduino - possibly single characters
when it is working add a GUI