SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By bartok
#116270
I need my Arduinos (they are Pros) to boot up at power on with known and static output pin states. I am using it to delay a high voltage power supply start while the filaments warm up in a tube amp. So I cannot have the HV supply emit a 450V pulse when the Arduino boots.

I've tried using the outputs both active low and active high for this function, but the Arduino twiddles the output states during boot either way.

My only idea I have now requires a lot of support circuitry and extra pins. It would basically decode a certain bit pattern from several pins that hopefully would not occur randomly at powerup. Or, I would use an external serial receiver that needs a certain code before switching the relay, that again would not happen randomly on boot. Either technique is a pain and consumes extra pins.

Any hope of getting stable power on pin states with my Arduinos?

John
By bartok
#116287
esklar81 wrote:bartok,

Why, may I ask, are you using an Arduino for this? If you're looking to delay the power to an HV power supply, why not switch it through a time delay relay?

Curiously,
Eric
Well, maybe I should. :(

I actually need it to delay both the turn on for about a minute, and also keep the filaments hot for about a minute *after* the amp gets turned off by the user. So there are actually *two* relays in play. On the Arduino, I catch an interrupt from the momentary power button which starts either the turn on or turn off cycle. The micro is always on, except when the whole amp is unplugged. Originally, I used a dual 555 timer circuit that actually worked, but was a pain and I did not want to build any more of those. In a cruel twist of fate, my 555 circuit could not handle the initial power on situation either. :( So I tried a microprocessor instead (the Arduino).

The microcontroller is really a better idea. With it, I can implement both delays, and deal much more elegantly with odd situations like the user hitting the power switch during a warmup/cooldown cycle. Plus, I've got it doing fancy eye candy with the power LED, because the microcontroller is a lot more flexible than the 555 or time delay relay.

Also, I've never used a time delay relay and am not all that familiar with what they can do (and at what price point).

John
By bartok
#116290
itikhonov wrote:Put a larger capacitor on the pin?
Now *this* might actually work (with a resistor). I think the relay coil will serve as a threshold, or I could speed up the edge with a schmitt trigger which I already have on there from my previous experiments.

Thanks for the idea!

John
By esklar81
#116293
John,

If you're going to use a microcontroller, then the simplest thing is probably to use Itikhonov's suggestion. More specifically: put a resistor on an output pin of the microcontroller and connect the other end of the resistor to both the control line to your HV power supply and a capacitor (the other side of which is connected to ground).When the pin turns on, it will start charging the capacitor through the resistor. The voltage on the control line will be the voltage to which the capacitor has been charged. By choosing the values of the resistor and capacitor, you can select the time at which that voltage is high enough to turn on your power supply.

Conversely, if you set the output pin to LOW, the capacitor will discharge through the resistor, delaying the turning off of the HV supply.

Note: This gets a bit more complicated (but reasonably managed through experimentation) if your HV supply does not have an infinite impedance on the control line. If you use a variable resistor, you can make the delay conveniently tunable.

You could use this approach to suppress transient (that is, substantially shorter than the delay period) states of the output. You could also use this approach to save yourself the trouble of having the microcontroller, by having the filament heater supply (or some voltage-corrected slave to it) connected to the resistor instead of the microcontroller output.

Have Fun,
Eric
By Valen
#116303
The first message mentions the output pin toggling at boot-up. Sounds like you forgot to implement a pull-down resistor. Or pull-up, whichever state is 'OFF' for the HV amplifier. Like a 10k resistor between output-pin and ground (pull-down) or Vcc (pull-up), the value depends on the impedance of the HV amplifier input.

http://www.sparkfun.com/tutorials/218

The tutorial doesn't explain the pull-down function further, but I guess it makes sense anyway.

It doesn't solve the time-delay you want to implement, but that's easy for the microcontroller to take care of.
User avatar
By itikhonov
#116340
Valen wrote:The first message mentions the output pin toggling at boot-up.
Yeah pretty strange. Capacitor on the pin will probably help if it won't do problem worse but it will not solve problem just hack around it.

On reset all io pins should go into quite known state - input state (practically it looks like if this pin is not connected to anything at all). So may be that's what your circuit don't take into account?

http://www.arduino.cc/en/Tutorial/DigitalPins

Other thing may be bad power supply and sometimes people quote erratic behavior with messed oscillator circuitry.
By Valen
#116378
During reset the pins are set to high impedance, but maybe not during the very first few microseconds. It takes a while before the reset circuitry gets into full control and reset all transistors into a define state. In the mean time, anything can happen. Infact, that is the problem. The input of the amplifier is also a high impedance. No current flows in or out of that port. Therefore, any slight leak current induced into the circuit creates large voltage swings on the input. The amplifier input is is floating. A capacitor isn't going to do much if there isn't any current to put into it. Besides it will happily conduct the high frequency signal that causes the toggling. You need to actively pull it up to Vcc or down to GND.

Either use an external resistor or figure out how use the (often built-in) internal pull-up/down resistors of the microcontroller.
By esklar81
#116394
Valen wrote: Besides it [a capacitor] will happily conduct the high frequency signal that causes the toggling.
Valen,

You seem to be considering a capacitor in series between the microcontroller output and the amplifier control input. That's most certainly not what I (or, I believe, others) had in mind. To suppress the transients, the capacitor must be in parallel with the amplifier control input. That is, one side of the capacitor is connected to the line between the microcontroller output and the amplifier control input and the other side of the capacitor is connected to ground. As you correctly stated, a capacitor will conduct high frequency signals. That's exactly what one wants it to do, as those transients will then be sent to ground, rather than the amplifier control input. Sustained outputs from the microcontroller, however, would charge or discharge the capacitor, resulting in a delayed, but less noisy, signal to the amplifier control input.
Valen wrote:You need to actively pull it up to Vcc or down to GND.
What, precisely, do you mean by "to actively pull"? IOW, what's the means by which one would to that and how does it differ from pulling "passively"?
Valen wrote:Either use an external resistor or figure out how use the (often built-in) internal pull-up/down resistors of the microcontroller.
As the OP's problem stems (at least putatively) from the startup behavior of the microcontroller, how could the microcontroller fix the problem?

Eric
By Valen
#116405
esklar81 wrote:
Valen wrote: Besides it [a capacitor] will happily conduct the high frequency signal that causes the toggling.
Valen,

You seem to be considering a capacitor in series between the microcontroller output and the amplifier control input. That's most certainly not what I (or, I believe, others) had in mind. To suppress the transients, the capacitor must be in parallel with the amplifier control input. That is, one side of the capacitor is connected to the line between the microcontroller output and the amplifier control input and the other side of the capacitor is connected to ground. As you correctly stated, a capacitor will conduct high frequency signals. That's exactly what one wants it to do, as those transients will then be sent to ground, rather than the amplifier control input. Sustained outputs from the microcontroller, however, would charge or discharge the capacitor, resulting in a delayed, but less noisy, signal to the amplifier control input.
Ok, you are right. It would dampen the toggling. But not provide a dependable bias voltage that makes the line go either low or high.
Valen wrote:You need to actively pull it up to Vcc or down to GND.
What, precisely, do you mean by "to actively pull"? IOW, what's the means by which one would to that and how does it differ from pulling "passively"?
I've provided a link to the Sparkfun Tutorial about pulling up (and down). With 'actively' I meant deliberatly changing the circuit by adding a resistor to either Vcc or Ground. I can understand you got confused since capacitors and resistors are known as passive components.
Valen wrote:Either use an external resistor or figure out how use the (often built-in) internal pull-up/down resistors of the microcontroller.
As the OP's problem stems (at least putatively) from the startup behavior of the microcontroller, how could the microcontroller fix the problem?

Eric
Since I don't know exactly which chip is in his Arduino(I know virtually nothing about the arduino), I don't know for sure. But I guess they are all of the AVR family. As far as I know they all have registers to control the general in-/output pin circuitry, to become inputs or outputs, enable the internal pull up resistor (alteast in the atmega8 there is no pull down resistor built in) and set the H/L-state of if it is an output port. How this is done with the Arduino firmware is something I don't know. You'll have to learn that or dig deeper into the datasheet of the used microcontroller.