Hi everyone,
First time Arduino user here. Wrote the code for my project and hacked it together on a breadboard and it's working but with some inconsistencies.
General overview of the project:
Its an induction heater for small pieces of brass. The idea being that you put the brass in the induction coil and hit the "go" button. The Arduino fires a relay that starts up the induction heater. It holds for a couple of seconds, then turns the induction off while pretty much simultaneously (the next line of code) firing relay that triggers a solenoid, opening a trapdoor and drops the brass into water.
I have a pair of LEDs wired up, one that is on when the Arduino is waiting for the switch to be pressed, the other is on when the induction heater is on. During the setup(), I blink those LEDs back and forth a few times.
What I'm finding is that when it switches from the induction coil to the solenoid (switching one relay off and the other on), sometimes the Arduino "hiccups" and it goes back to the setup() line as indicated by the blinking LEDs.
So, basically the "correct" scenario is:
(wait for button to be pressed)
Run LED on
relay to turn on induction power supply
(hold for 2.5 seconds)
relay for induction supply off ****
relay for trapdoor solenoid on ****
(hold for 1 second)
relay for trapdoor solenoid off
(hold for 2 seconds
(go back to waiting for button to be pressed
The fault is happening between the lines with **** above. Sometimes the trapdoor solenoid works fine, sometimes it just twitches, and sometimes the whole thing locks up and then gets back to the setup() function.
The relay board is being driven from the Arduino (so, the coils on the relay depend on power from the Arduino board). The fault happens when the Arduino is on external power (9V walwart) and does NOT happen when it's powered through USB on the computer. So...that is making me think it's power supply related.
Any thoughts? I would like to avoid an external power supply for the relay board if I can. I was thinking of maybe adding a 50-100ms delay between the one relay turning off and the other turning on to give the power supply time to recuperate.
Thoughts?
Thanks in advance!
Dustin