<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Horn Gun Notes</title>
    <description>The latest articles on DEV Community by Horn Gun Notes (@horngunnotes).</description>
    <link>https://dev.to/horngunnotes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4240714%2Fa57f02e2-ea8c-45aa-a442-7adf1d82faeb.png</url>
      <title>DEV Community: Horn Gun Notes</title>
      <link>https://dev.to/horngunnotes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/horngunnotes"/>
    <language>en</language>
    <item>
      <title>How a cordless train horn works: compressor, battery and valve explained</title>
      <dc:creator>Horn Gun Notes</dc:creator>
      <pubDate>Thu, 12 Nov 2026 09:42:21 +0000</pubDate>
      <link>https://dev.to/horngunnotes/how-a-cordless-train-horn-works-compressor-battery-and-valve-explained-1hjg</link>
      <guid>https://dev.to/horngunnotes/how-a-cordless-train-horn-works-compressor-battery-and-valve-explained-1hjg</guid>
      <description>&lt;p&gt;Pick up a cordless train horn and the first impression is that it should not work. There is a drill-like grip, a few metal trumpets screwed onto the front, and no hose in sight. Yet it produces a note you would normally associate with a locomotive.&lt;/p&gt;

&lt;p&gt;Underneath, the design is a neat piece of small-scale systems engineering. This article walks through the signal chain from battery to ear, shows where the energy goes, and includes a short script for estimating run time and sound level at distance. Nothing here is a teardown of a specific product; it is the general architecture that devices of this kind share. People sometimes call them "horn guns" because of the pistol-grip shape, though that is a nickname, not a standard term.&lt;/p&gt;

&lt;h2&gt;
  
  
  The chain in one picture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; +---------+    +-----------+    +-----------+    +---------+    +--------+
 | battery | -&amp;gt; | control   | -&amp;gt; | motor +   | -&amp;gt; | valve   | -&amp;gt; | bells  |
 | pack    |    | board     |    | pump      |    | (gate)  |    | (horn) |
 +---------+    +-----------+    +-----------+    +---------+    +--------+
                      ^                                ^
                  remote RX                         trigger
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Five jobs, five blocks. We will go through them in order, from the energy source to the radiating element.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The battery: borrowing from the tool shed
&lt;/h2&gt;

&lt;p&gt;Most cordless horns avoid a proprietary pack and instead accept the removable batteries from common power-tool platforms. That makes sense: those packs already have a robust connector, a protection circuit, and a charger the owner may already have.&lt;/p&gt;

&lt;p&gt;One retailer of such horns, for example, offers versions for the Milwaukee, DeWalt, Ryobi and Makita systems. The packs from different families do not interchange, so a horn is built for one platform. The takeaway for a designer is that the power rail is the pack voltage, a nominal 18 to 20 V, and everything downstream must cope with its sag under load.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The control board: more than a switch
&lt;/h2&gt;

&lt;p&gt;Between battery and motor sits a small circuit board. In the simplest design this is just a MOSFET driven by the trigger. In more careful designs it also does the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Measures pack voltage&lt;/strong&gt; and stops the motor before the cells are over-discharged.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limits motor run time&lt;/strong&gt; so the windings do not overheat, sometimes enforcing a cooling pause.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selects power stages&lt;/strong&gt;, such as a lower and a higher volume setting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Listens for a radio remote&lt;/strong&gt; with a low-power receiver that sips current while idle.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have written firmware for a battery-powered gadget, none of this is surprising. The challenge is that the load is a brushed or brushless motor with a hefty inrush, driven from a pack that sags, and the board has to stay alive and responsive in a hot, vibrating enclosure.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The compressor: the heart of it
&lt;/h2&gt;

&lt;p&gt;A horn needs compressed air, and the cordless design makes its own. A DC motor turns a small piston or diaphragm pump. Air is drawn from the atmosphere, compressed in the pump chamber and pushed through a one-way check valve into the airway.&lt;/p&gt;

&lt;p&gt;For a sense of scale, the retailer mentioned above states a 450 W compressor across its current cordless models. That is the vendor's rating, and it tells you the electrical input power, not the air power. Small pumps are inefficient; much of the electrical energy leaves as heat, which is the reason thermal limits matter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does it need a tank?
&lt;/h3&gt;

&lt;p&gt;Not necessarily. A horn is a flow-hungry device: a diaphragm vibrates only while air is passing through it. A tank can supply a high flow for a short blast, while a direct feed is limited to what the pump can deliver in real time. Some designs use a small buffer volume, and others lean on pump output alone. Which is better depends on whether you value maximum burst or compact size and weight. Neither choice changes the principle of the next two stages.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The valve: a gate for air
&lt;/h2&gt;

&lt;p&gt;The valve lets air through only when you ask. Two common forms:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mechanical trigger valve.&lt;/strong&gt; The trigger physically moves a plunger or spool. Simple, no electrical dependency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Solenoid valve.&lt;/strong&gt; An electromagnet moves the plunger. This is what makes a radio remote possible, since the receiver only has to energise a coil.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What matters is speed. A fast-opening valve gives a crisp start to the note, while a slow one yields a soft onset that sounds weak. Consistent operation also depends on a good seal: any leak while the horn is idle will bleed the buffer and waste pump effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The bells: where physics gets pretty
&lt;/h2&gt;

&lt;p&gt;Air that reaches a bell first passes a &lt;strong&gt;diaphragm&lt;/strong&gt;, a thin disc held at its edge. Flow lifts the disc, air escapes, and the disc springs back. The motion repeats hundreds of times per second, giving a raw buzzing source. The &lt;strong&gt;bell&lt;/strong&gt; then does two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It acts as a resonator, so its length largely sets the pitch it favours.&lt;/li&gt;
&lt;li&gt;Its flare matches the small throat to the open air, so the sound radiates efficiently.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fit several bells of different length and you get several notes at once. That is the chord you hear in a locomotive horn, and a reason multi-bell units sound fuller than a single-note truck horn.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example: run time and sound at distance
&lt;/h2&gt;

&lt;p&gt;Here is a small script to turn the numbers above into estimates. It uses textbook formulas only. The input values are placeholders; replace them with figures from your own device's documentation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;pack_energy_wh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;volts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amp_hours&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s2"&gt;"""Nominal battery energy."""&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;volts&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;amp_hours&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;runtime_minutes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;energy_wh&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;load_w&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s2"&gt;"""Idealised continuous run time, ignoring sag and thermal limits."""&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;energy_wh&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;load_w&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;spl_at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;distance_m&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ref_level_db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ref_distance_m&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s2"&gt;"""Free-field level change: -6 dB per doubling of distance."""&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ref_level_db&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;distance_m&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;ref_distance_m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;niosh_minutes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;level_dba&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s2"&gt;"""Allowed daily minutes at a level (NIOSH REL: 85 dBA for 8 h, 3 dB exchange)."""&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;480&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;level_dba&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;85&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Placeholders, not product specifications&lt;/span&gt;
&lt;span class="n"&gt;energy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;pack_energy_wh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;           &lt;span class="c1"&gt;# 90 Wh&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"pack energy: {energy:.0f} Wh"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"ideal run time at 450 W: {runtime_minutes(energy, 450):.0f} min"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{d:&amp;gt;4} m -&amp;gt; {spl_at(d, 120, 1):.0f} dB (if 120 dB at 1 m)"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;lvl&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;85&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;110&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{lvl} dBA -&amp;gt; {niosh_minutes(lvl):.1f} min/day"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running it gives about 12 minutes of idealised continuous operation from a 90 Wh pack at 450 W, a loss of roughly 40 dB between 1 m and 100 m for the hypothetical 120 dB source, and an allowable daily dose of under two minutes at 110 dBA by the NIOSH formula.&lt;/p&gt;

&lt;p&gt;Two caveats are worth stating. The free-field formula assumes no reflections, no wind and no air absorption, which is generous. And the NIOSH formula is an occupational guideline for continuous exposure; a horn burst is a different pattern. Both are useful as order-of-magnitude checks, but neither replaces measurement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why heat is the real limit
&lt;/h2&gt;

&lt;p&gt;A 450 W-class motor running from a pack for a minute generates a lot of heat in a small enclosure. Much of the engineering effort in a compact horn is not the sound, it is controlling temperature. That is why boards limit run time and why some horns insist on a cooling lockout. One manufacturer's documentation notes that the battery should remain connected while the cooling timer runs, because the board itself tracks the timer. It is a nice example of a software behaviour leaking into the user manual.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes to expect
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Likely area&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Motor runs, thin or weak note&lt;/td&gt;
&lt;td&gt;Air leak at a bell thread, or low pack voltage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hissing when idle&lt;/td&gt;
&lt;td&gt;Valve seat leak&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stops after a short burst&lt;/td&gt;
&lt;td&gt;Thermal protection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote does not respond&lt;/td&gt;
&lt;td&gt;Remote cell, pairing, or receiver&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Using one responsibly
&lt;/h2&gt;

&lt;p&gt;Whatever the design, the output is high enough to damage hearing at short range. Wear earplugs or muffs, point the bells away from people, and check your local noise rules before using one outdoors. Do not use a train-style horn near rail crossings. Real locomotive horns are regulated safety equipment; in the United States the sound level rule is 49 CFR 229.129, which sets a window of 96 to 110 dB(A) at 100 feet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to look at a real one
&lt;/h2&gt;

&lt;p&gt;If you want to see how a complete product is documented, the specification pages of the &lt;a href="https://hornguns.com/" rel="noopener noreferrer"&gt;battery powered train horns&lt;/a&gt; sold by Horn Guns, a US shop run by Liberty Horns LLC, show what a commercial cordless horn bundles together: the grip, pump and electronics as one base, trumpets that screw on by hand, and a wireless remote.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;p&gt;A cordless train horn is an exercise in compromise: borrow a power-tool battery, add a small compressor that must be both light and tolerant of heat, gate the air with a fast valve, and let a diaphragm and a few well-chosen bells do the acoustics. If you like hardware design, it is a surprisingly compact case study in power, pneumatics and firmware working together.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Corrections and additions are welcome in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>hardware</category>
      <category>diy</category>
      <category>electron</category>
      <category>software</category>
    </item>
  </channel>
</rss>
