We decided to use arduino as a controller for our high-power research laser at our uni's physics department. It acts as a middle-man between a PC with control software and the laser's electronics.
Things are progressing smoothly, but we ran into a small issue.
When the arduino is powered up and when it initializes a serial connection, we get something resembling a logic signal on pins 8-10 at least, probably on other pins too.
Now this is a problem in a sense that when these pins get rising edges, the laser fires. We'd like to keep erroneous shots to a minimum, so we've been investigating ways to get control of the output.
Can it be done in software? I was thinking that perhaps it is the bootloader that's doing this and we could disable it.
Has anyone run into something similar before?
For the record, we are using the latest arduino duemilanove with Atmega328 and a custom firmware.
Before your code has a chance to run the digital I/O pins are inputs without pullups thus can easily float to logic levels. I would recommend you add pull-up or pull-down resistors to those pins that fire lasers (to whichever logic level does NOT fire the laser, of course).
If you have access to a hardware programmer you might wish to load your application without a bootloader (erase chip first), that would quickly isolate if the bootloader is twitching the I/O bits or not.
Hmm if the only problematic pins are 8-10 and the other dosn't really matter, wouldn't it be easyer (or at least cheaper than a Hardwareprogrammer) to just add 3 Switches (or pull-down resistors like RuggedCircuits said) from some old hardware on this pins? Okay, softwareproblemsolving sounds more professional but ...finding switsches +soldering = 10 minutes, thinking about removing bootloader find and use hardwareprogrammer +install or change software >1 hour :
im as new as they come in a world of arduino and the c programming ,
but have experience in Electrical and PLC automation, when the problem you mentioned arises it could be fixed with a couple of following remedies
1 Invert your outputs anywhere along your program so the laser fires on logic 0 or low. alot of the safety oriented programs do that.
2 You can create a debounce timer of some kind to ignore that sudden "blink" in the beginning of a boot process, or even insert a hardware "on delay" timer with say 1000 milliseconds, to let the Arduino stabilize and place it in series with laser ( solenoid or transistor or relay actuator of some kind)
3 I wonder if its possible to have the laser fire only if it sees a sequence of PWM signals which in turn again will ignore any bounce as well, you could probably do that part in software , its just my 5 cents.
and off i go to learn and become smart! have a great day