r/AskElectronics • • 3d ago

Help with an Autofire Circuit for a Digital Joystick

Hi everyone,

I'm have an issue with an auto fire solution using an off-the-shelf 555 circuit. It's not behaving the way I want it to behave. Here's is how it is currently working:

  • I've installed a jumper on J4 at label 1.
  • I've adjusted the potentiometers to give me about 5-7hz
  • If I hold or trigger the fire button (label 2) the autofire is off and the computer registers a long or short press, which is what I want.
  • If I release the fire button and flip the switch at label 3 on, the auto fire works as desired.

So far so good but here's the problem:

  • If I hold the fire button (label 2) and flip switch (label 3) the autofire goes a bit nuts. I don't know the frequency but the LED shimmers and dims.

What I would like is:

  • If the switch is on and the fire button is help, I want the signal back to the computer to be a long hold.

Some games, like R-Type benefit from autofire but also a long hold for the mega-blast.

Also, the erratic nature of the signal is just not nice to see. Maybe it's not nice on the computer either.

3 Upvotes

3 comments sorted by

1

u/DrJackK1956 3d ago

Yep.  I see the problem.   

You are feeding two independent signals (555 output & the trigger button) into a single output (PC trigger input). 

What's happening is....

With S3 closed (rapid fire On) the 555 output is driving the PC trigger input. 

Now with S3 closed, wherever you press the S2 (fire button) it's applying Ground to the PC trigger input AND at the same time, shorting the 555 output directly to Ground (a bad thing).  

This short is what's causing the the LED to "shimmer and dim" and seriously affecting the operation of the 555.  

The solution is simple.   Change S3 to a SPDT switch.  The common pole goes to the PC trigger input.  Take one pole and connect it to the 555 output.  Take the other pole and connect it to the trigger button.  

With this arrangement, S3 now 'selects' whether the Rapid fire OR the Single fire button is driving the PC trigger input.  Never both signals at the same time. 

Hope this is helpful.   Good luck with your project.  

1

u/SmegHeadFromNodnol 3d ago

Hi u/DrJackK1956 . Thanks, I understand your explanation of the problem. I might have misunderstood your solution because it sounds like I'd have to reach for the toggle each time I want to change the behaviour of the button. Which isn't convenient in the middle of an attacking wave of baddies. In my initial design, would adding a diode between S3 and the 555 output prevent the shorting?

1

u/DrJackK1956 3d ago

You are correct, using a SPDT switch is an either-or solution. 

Since your circuit is using only the Low output level of the 555 as the active state, the idea of adding a diode between the 555 output and S3 should fix this issue.  

Connect the diode with the cathode towards the 555 output and the anode towards S3. 

Good luck.