Firstly - if this is in the wrong place, please move it to where it should be.
This is the first time I've dabbled in arduino, even C for that matter. All my previous experience with microcontrollers has involved BASIC.
I have no idea if the issue is hardware or software. Looking through it a million times, it should work- but it doesnt. This is doing my head in - I absolutely totally NEED this to work properly in the next few days or something will the fan.
What it should do:
This program is used to control a big LCD countdown clock by switching its buttons with relay contacts. The clock is part of a prop bomb made from an old radio for an interactive puzzle game. Setting the countdown of the display is independent to the arduino. The arduino will switch a relay closed for 10 seconds to start/stop the clock and listen for the rising edge of a 5V, ~1hz square wave from the clock, should the game run out of time (I tapped into the buzzer circuit for this signal, hence it being 1hz square)
The idea: It's a bomb, there's 6 wires to choose from - they need to pull out the correct wire to defuse the bomb, which will unlock a door.
When the game starts, d2-d8 are tied via jumper wires to the 5V rail of a breadboard.
If they pull d2 from the breadboard, the game should stop the clock and latch the winOut relay.
If they pull any other wire, the alarmRelay will latch for 10 seconds.
What really happens:
Each of these situations from a fully reset state:
- Pull d2 - nothing happens
- pull any other wire - nothing happens
- Pull d2 followed by pulling d3-d8 - the lose sequence is activated
- Pull all wires but D2 - nothing happens for each individual wire, when d2 plus one more input are the only ones left high, the lose sequence is activated
Using logic probes confirm that D10-12 aren't going high at all so the issue is not the transistor switches. I'm guessing either in the code or the pulldown resistors
So far the alarmSense part of the code is commented out as I want the guts of the circuit to work first. Priority is getting these relays switching correctly.
The only thing I can think that could be the issue is that 100k is too big a value to use as a pulldown resistor for d2-d8. 100k worked fine on the breadboard and the protoshield is currently tidy as hell, soldered up and checked a thousand times over for shorts - none. If someone can confirm that swapping the resistors would help, I'll swap them out for 22k or something round that.
Otherwise, please see the attached code and diagram
ABSOLUTELY ANY INPUT IS APPRECIATED =)
Thanks!
-Eiac
bomb.ino (1.74 KB)
