
\documentclass[11pt]{article}
%Gummi|065|=)
\usepackage{graphicx}
\usepackage{caption}
\title{\textbf{Flammable Gas Sensor}}
\author{Steak Electronics}
\date{}
\begin{document}

\maketitle

\tableofcontents

\section{Overview}
Shop needs a flammable gas sensor, for safety.
\section{Chip Hunting}
I'm looking at the following:

\begin{itemize}
\item SGAS711
\item 200K fixed resistor
\item 1M potentiometer
\item Arduino Nano (for speed)
\item Ample Power Supply  They are recommending 7 Volts for the heater. So, one rated for 1A.
\item led notifiers
  \item Long cables to separate sensor from device. (optional)
  
\end{itemize}


\subsection{Gas Sensor Tuning}
The flammable gas sensor has different sensitivities for different gases (see data sheet, Figure 8). I'm going to need to test for something specific, i.e. if the shop needs to watch out for acetone, I should test acetone. Of course, if enough of a flammable gas is in the air, it will set it off no matter what, but I should focus on what the danger is for calibrating.

Based on the resistance chart, I'm going to use a fixed 200K and a 1M pot. Pots are to be avoided, but here we need to calibrate over time. For the response of the v divider, the sensor is not linear, but closer (though not quite) logarithmic. So what I will do, is have to use some math on the micro, and use the formula they give in the Datasheet, to get a logarithmic output that appears linear (figure 5). For my needs, it is good enough.

\includegraphics[scale=0.8]{../pics/resistances.png}
\captionof{figure}{Application Note resistance table}

\subsubsection{Fixed resistors}
If these sensors are consistent enough, possibly I could use fixed resistors later.
\subsubsection{Gas Sensor Power Usage}
Rated at 900mW for 7V, so about 150mA (128mA). I know from prior experience these things heat up, so we need plenty of power.

\subsubsection{PCB Layout}
The gas sensor must be sideways, as there is excessive dust in the shop so, the holes will be on the side. I will do a 90 degree edge mount pcb.

\subsection{Switcher}
STS1024S6V5 Seems like a fair option for now. Output is 6.5 volts which is enough. Will use a module. Need to make a footprint.

\subsection{Enclosure}
We need a box that is tall enough to be a cube. Also want square, not rectangular. I plan to have the leds light from the back of the pcb. The pcb will be the top cover / front. The top cover / front will be the box, put on its side, so dust doesn't collect on the leds. Need a cube.

\section{CAD Layout}
I found that Kicad step up in Freecad is helpful for making sure your board will fit the enclosure. A very helpful addition to an arsenal. Although I didn't test it until after rev 1. 
\begin{center}
\includegraphics[scale=0.5]{../pics/kicadstepup1.jpg}
\captionof{figure}{Freecad has the ability to pull in boards from Kicad. Even without step file dependencies you can see how the PCB will fit a case}
\end{center}


\section{PCB Assembly}
Most of the board came out ok. Power section is routed right. I need to move the barrel plug further out of the board, so it fits with the case better. The one issue I overlooked
was the A6, and A7 pins, which have no digital circuitry behind them. So I have some pins that can't light up. I'll have to bodge wires in, or respin the board. Simple fix. Oversight on my part, that's all. I assumed GPIO on all pins, but here are two analog pins that can't function as GPIO.

\vspace{0.2in}

I'll use D7, and D8. Looks like I also missed the wire from VSenseOut of the Gas sensor to the board. So that will go to A6. Technically, I missed a net on the schematic. 

\vspace{0.2in}

One other fail of the enclosure, is that the Arduino nano won't fit with female pin headers holding it in. This means, instead of easily being socketable, I'll have to solder the board in. Not a deal-breaker, but I would prefer the nano to be easily removable. I don't like soldering it on the board. In the future, I need to find a taller enclosure.

\subsection{Place Sensors on the Floor}
Being that at least some flammable gases are heavier than air\footnote{Reference: Plumbing, Rex Cauldwell, 2006, page 137 - Gas Heater Awareness - Great book.}(in our case, they are, your situation may vary) it is logical for us to put them on the floor. There are no rules, though so why not both? It would be interesting to see the LEDs responding differently at say waist height, and at your feet. That would indicate different gas in the air.

\section{In Consideration of ``Hazardous Locations''}
Up to this point, I have not paid any attention to official rules or standards regarding safety\footnote{Our environment is only dangerous when there is a gas leak (extremely rarely), so we are the least strict of the hazardous location types. In the US, this is Class 1, Division 2. Gas (class 1) can be present, but is not normally (division 2). We regularly have dust in our air, however it is silica and therefore inert / not explosive.}. The search term for a device like this that may be in an environment that can dangerous is \textbf{hazardous locations}. There are a few books on the subject I found (specifically for electronics in hazardous locations). I downloaded the PDF of a few online, but was not impressed with the writing quality enough to buy them with the exception of \emph{Electrical Installations in Hazardous Locations} by Peter Schram \cite{Schram}. There is also a succint Application note which covers a general overview in Linear Technology Magazine September 2009, also accessible online \cite{Pickard}. As a launchoff point, some discussion can also be found online in various forums \cite{EEVBlog}.
\subsection{What Class is my Company?}
Based on \cite{Fuchs}, we are a Class 1, Division 2. With the Class 1, being Group D, as we would have leaks of those gases. It's possible that certain areas (inside the reactors for example) may be a higher class.

\subsubsection{Encapsulated Fuses}
Encapsulated fuses are also referred to as UL913 online (e.g. in stores). UL913 is UL's \emph{Standard for Intrinsically Safe Apparatus and Associated Apparatus for Use in Class I, II, III, Division 1, Hazardous (Classified) Locations}. Another term to search for is \emph{intrinsically safe} on the parametric search for fuses. The cheapest intrinsically safe fuse in 1 quantity on Digikey is currently \$4.50. Ouch. Safety requirements sure help some people, just not the buyers. I see a market, for a blobbed fuse at \$1.
\section{Existing Gas Detectors}
We have already purchased a commercial gas detector. This particular model is designed so that the control box is kept separated from the sensor. The sensor has a 30 foot cable. The control box is installed in the ceiling. \footnote{See in the git: teardowns 2019, the RKI instruments combustible gas sensor.}

\section{Switching Power Supply}
In search of a low part count, simple to deploy switcher I came across this in my rss (https://hackaday.com/2019/08/11/switching-over-to-smps-for-efficiency/). The LM2576 is easy enough to use instead of a lm317, and requires only a diode and inductor more. Here I need more power efficiency from the 12V input so that should work. A simple go-to switcher.

\begin{center}
\includegraphics[scale=0.3]{../pics/DSCN2209.JPG}
\captionof{figure}{Prototype}
\end{center}

\section{Connecting the Sensor by a Wire}
Upon showing this to my family co. who wanted it, they mentioned they wanted a cable going to the sensor. I looked at the RKI Instruments flammable gas sensor, which we have a few of, and these used a 22 Gauge 4 conductor cable. That is \$50 for 100' of cable. A more DIY solution is to grab some 4 pair CAT5E or CAT6 and connect two wires to each screw terminal on the board. That is what I will do. Saves money, and should work no issue, up to the 30 feet max that I need. Any small box can be used for the sensors. I might build a pcb mount for those, or perhaps just some hot glue. Depends on what works the best, while being efficient.

\section{Calibration}
This is the real task of this project. Making a gas sensor is easy, calibrating it, is another step. Thankfully, some companies sell calibration tanks. For calibration you might calibrate on the LEL or the lowest acceptable level before an alarm should be fired off for a given chemical.









\section{References}
\begin{thebibliography}{99}
\bibitem{Schram}
  Peter Schram,
  \emph{Electrical Installations in Hazardous Locations}, first edition - 1991, National Fire Protection Association (NFPA), ISBN-13: 9780877653561.

\bibitem{Pickard}
  Murphy Pickard,
  \emph{Surge Stopper IC Simplifies Design of Intrinsic Safety Barrier for Electronics Destined for Hazardous Environments}, Linear Technology Magazine September 2009, https://www.analog.com/en/technical-articles/surge-stopper-ic-simplifies-design-of-intrinsic-safety-barrier-for-electronics.html .

\bibitem{EEVBlog}
  Various,
  \emph{Electronics Design for Explosive Envirionment}, EEVBlog Forums, https://www.eevblog.com/forum/chat/electronics-design-for-explosive-environment/?all, http://web.archive.org/web/20190410172437/http://www.eevblog.com/forum/chat/electronics-design-for-explosive-environment/?all.

\bibitem{Fuchs}
  Various,
  \emph{Explosion Protection and Intrinsic Safety 101}, Pepperl Fuchs, https://www.pepperl-fuchs.com/usa/downloads\_USA/explosion-protection-and-intrinsic-safety-101.pdf, http://web.archive.org/web/20190721221654/https://www.pepperl-fuchs.com/usa/downloads\_USA/explosion-protection-and-intrinsic-safety-101.pdf.

  \bibitem{}
  
  \end{thebibliography}




\end{document}

