
\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 
  
\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}. 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}.






\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.
  
  \end{thebibliography}




\end{document}

