I had a problem like this before, this was my workaround:
I had more luck with cu then with stty
Start a screen session:
screen -S arduino -dmS cu -l /dev/ttyACM0 -s 9600
Now there is a screen session created called arduino
You can send commands to it from a script:
screen -S arduino -X stuff 1
This will send the 1 to the serial connection just like your example
If you want to control this with a different user make sure rights will allow this and create the screen session with the same user that will be sending commands to the screen session.
If you have more questions just ask me.