Retrofitting an Autofire Function: Project Description
Description, schematic and downloads
Technical project documentation for Retrofitting an Autofire Function: Project Description, revised for clearer language, consistent structure and easier reference.
There are already several circuits on the internalt that add an "autofire" function to a push button. Unfortunately, most are based on the analog NE555 IC, which requires several additional components such as capacitors and a potentiometer. This usually makes the circuit comparatively large and unsuitable for installation in confined spaces. Such a circuit also normally provides only continuous-fire operation, and the rate depends on the supply voltage (the firing rate changes with battery voltage).
For one of my projects I needed this kind of circuit but could not find a suitable design, so I developed a new one. To make it as flexible as possible while keeping the dimensions small, I chose a digital circuit based on Microchip's PIC12F683 microcontroller. This small microcontroller already integrates all the required hardware and therefore needs no additional external components. In this application the microcontroller runs from its internal 2 MHz clock, reducing the propagation time of the push-button signals (trigger events) to less than 100µs. In practice, there is therefore almost no signal delay of the kind seen in analog circuits. The firmware was designed to operate as quickly and reliably as possible. To achieve this, almost all interrupts provided by the microcontroller are used. Timer interrupts are used both to implement a low-pass filter that digitally debounces the button input (not a simple delay loop!) and to generate the continuous-fire rate. Even the trigger input is evaluated by an interrupt rather than polling, which is one of the main reasons why trigger-event propagation remains below 100 µs.
This chip can add an adjustable autofire function to a normal push button (using H.S.L.M. technology*;-)). The firing rate can be configured from 7 to 20 shots per second. It is also possible to configure how many shots are fired automatically for each button press -> Burst mode (2–10 shots). The settings are stored in the microcontroller's internal EEPROM and are therefore retained even when power is removed.
One of the most important functions of this chip is limiting the firing rate to a defined maximum. This prevents a mechanism or electronic circuit connected to the button from being triggered too rapidly and potentially jamming. -> ROF = rate of fire (7–20 BPS). If two trigger events occur too close together, the second event is not discarded; instead, it is delayed until the configured ROF timing has been satisfied and is then triggered. This ensures that no trigger events are lost while the maximum ROF is still respected.
Connections/jumpers
Jumper
- [ Chip_Enable]:
- closed = special functions enabled
- open = all chip functions are disabled; the button inputs are passed directly to the output (the chip therefore behaves as if it were not present)
- [ Half/Full-automatic]:
- closed = while the button input is active, the output is continuously switched on and off (fully automatic mode -> continuous fire)
- open = each button press causes the output x times (semi-automatic mode -> burst mode)
- [ Stealth Function]:
- closed = stealth function enabled -> in automatic mode, the firing rate is varied slightly all the time (shots are fired with minor timing variations), making the chip harder to identify acoustically;-)
- open = stealth function disabled
- [ setup Mode]:
- closed = the chip enters Setup mode; here the general firing rate (4–20 shots/second) and the number of shots (2–10 shots) for semi-automatic mode can be programmed
- open = Setup mode inactive
Connections
- [ Switch_in ]: button input ( fire button )
- [ Switch_out ]: The output actively switches to GND and is pulled to 5 V through an internal 18 kOhm resistor.
- [ Power-Supply ]: Power supply for the chip
Schematic
Component List
| Component | Value | Description | Quantity | Reichelt order number |
|---|---|---|---|---|
| IC1 | PIC 12F683 | PIC-Controller DIP-8 | 1 | PIC 12F683-I/P |
| IC socket | 8pol | IC socket, 8-pin, low-profile | 1 | GS 8P |
| R1 | 18k | Metal-film resistor 18, 0 K-Ohm | 1 | METALL 18, 0K |
| C1 | 1µF | Multilayer ceramic capacitor | 1 | Z5U-5 1, 0µ |
| Pin header | 36-pin Pin header, straight, 2.54 mm pitch | 1 | SL 1X36G 2, 54 | |
| Perfboard | 16 * 18 mm | |||
| Reichelt shopping cart: "Trigger Chip" | ||||
Oscilloscope traces at the inputs and outputs
- blue line = trigger input; active low -> pressed trigger = 0 V!
- red line = trigger output; active low -> active output = 0 V!
Contact bounce of a push button (active low) -> depending on the age and construction of the switch, up to 10ms unwanted time delays are possible
Propagation delay of the trigger signals of less than 100 µs; 82.4 µs in this example
Continuous-fire function configured for 10 shots per second (10 BPS), stealth function disabled
Continuous-fire function @ 10 BPS with enabled Stealth function – > firing rate varies slightly ( high level = pause interval )
Burst mode with ratio 1: 3, @10 BPS, Stealth function disabled
Downloads
KeiAng
Published on: Thursday, 12. November 2015 (12381 reads)
Copyright © by Keiang Electronics & Measurement
[ Go back ]