% !TEX root = master.tex
\subsubsection {Bluetooth Module}
% Chris

The Bluetooth module is a critical component that will enable access to the device's core features using wireless communications. With a Bluetooth module, the smart table will be compatible with a staggering number of consumer devices, and will be able to receive commands remotely from the user. The Bluetooth module will essential act as the interpreter between the microcontroller and the user.

The main goals for the Bluetooth module include:

\begin{itemize}
	\item Receive data such as NIST time, weather updates, and LED settings from an external device through a Bluetooth connection
	\item Transmit data from the external device to the microcontroller through a UART interface to trigger certain functions and power states
	\item Maintain compatibility with a wide number of devices using mature Bluetooth 2.1 
\end{itemize}

Table \ref{tab:bluespec} shows the important specifications of the Bluetooth module selected for the smart table. It is important to note that the current draw and power efficiency characteristics were not strong considerations when selecting this module, because the smart table will be plugged directly into the mains electricity and will not need the same level of power optimization that is needed for portable devices. Rather, emphasis was placed on a device that was wide compatibility with existing products, which Bluetooth 2.1 manages to do successfully. Newer standards such as Bluetooth 4.0+ only work with the latest generation of smart devices, which could negatively impact the accessibility of the smart table to its audience.

\begin{table}[H]
	\centering
	\caption[Specifications of Bluetooth Module]{Specifications of Bluetooth Module \cite{HardwareConsiderations:RN42}}
	\label{tab:bluespec}
	\begin{tabular}{|c|c|}
		\hline 
		\textbf{Specification} & \textbf{Value} \\ 
		\hline\hline
		Frequency	& 2.4 GHz \\
		\hline
		Supply Voltage	& 3.3 V \\ 
		\hline
		SPP Data Rate & 240 Kbps (slave), 300 kbps (master)\\ 
		\hline
		HCI Data Rate & 1.5 (sustained), 3 Mbps (burst)\\
		\hline
		Transmit Current Draw & 30 mA \\
		\hline
		Typical Power Output & 4 dBm \\
		\hline 
	\end{tabular}
\end{table}

The fact that the chip uses a 3.3 V supply voltage is important, since the microcontroller also uses the same voltage input. This means that an additional level converter is not needed to incorporate the module, as the two chips together can be located along the same power bus at a lower cost. A large serial bit stream will be transmitted to the table from an external device such as a smartphone to update information which is displayed on the LED matrix. It has an embedded Bluetooth stack and natively supports SPP profiles.

Table \ref{tab:bluepart} shows why the RN-42 is an extremely popular chip. The tiny module is very incredibly robust and has extensive documentation despite it deceivingly low cost. Although it is not as cheap as certain industrial components, since it is mainly targeted towards hobbyists, the  module is still incredibly economical at \$18.95. This minimizes the development budget substantially.

\begin{table}[H]
	\centering
	\caption[Parts for Bluetooth Module]{Parts for Bluetooth Module \cite{HardwareConsiderations:RN42}}
	\label{tab:bluepart}
	\begin{tabularx}{\textwidth}{|c|X|c|}
		\hline 
		\textbf{Part} & \textbf{Description} &
		\textbf{Cost} \\ 
		\hline\hline
		RN-42 Bluetooth Module	& Roving Networks Bluetooth 2.1 Class 2 surface mount module with antenna & \$18.95\\
		\hline 
	\end{tabularx}
\end{table}

As an off the shelf Bluetooth module, the RN-42 will be readily programmable and easily configurable with the chosen microcontroller over the UART interface. The simplex mode will primarily be utilized for the wireless communications, meaning that data will only be transmitted to the smart table by an external device; there are no intentions to receive data from the table. Radiofrequency serial bitstream will be transmitted to the RN-42 and received by its UART shift register, which will then be transmitted to the microcontroller. The only pins necessary to populate on the chip are the UART\_TX, UART\_RX, UART\_CTS, UART\_RTX, GND, and VDD to bias the chip.

\begin{figure}[h]
	\centering
	\includegraphics[width=0.7\linewidth]{img/rn42-pins}
	\caption[RN-42 Pinout Diagram]{Pinout Diagram of the RN42 Bluetooth Module. \textit{Permission submitted to reproduce}. \cite{HardwareConsiderations:RN42}}
	\label{fig:rn42-pins}
\end{figure}

Figure \ref{fig:rn42-dims} shows that the RN-42 has an incredibly small PCB footprint, and has a form factor that is slightly larger than a typical postage stamp. It measures 13.4 x 25.8 x 2.4 mm in its dimensions, maximizing PCB surface area. The Bluetooth module includes a PCB trace antenna that simplifies implementation. A custom antenna does not need to be designed, since the wireless capability is presumed to work out of the box. No additional components are needed to get the chip to operate wirelessly, however, care must be taken when it comes to PCB placement of the surface mounted component. 

\begin{figure}[h]
	\centering
	\includegraphics[width=0.5\linewidth]{img/rn42-dims}
	\caption[RN-42 Dimensions]{Dimensions of the RN-42 Bluetooth Module. \textit{Permission submitted to reproduce}. \cite{HardwareConsiderations:RN42}}
	\label{fig:rn42-dims}
\end{figure}

The antenna must be not be kept in close proximity to other electronic devices or component, as well as neighboring PCB traces or copper ground planes, to eliminate the potential for electromagnetic interference. The clearance for the antenna and suggested placement methods is shown in Figure \ref{fig:rn42-mount}. The suggested area of clearance is roughly 31 mm around the antenna, for optimal radio performance. The antenna should not be enshrouded in any sort of metal enclosure, which would act as a Faraday cage and effectively block any incoming or outgoing Bluetooth signals.

\begin{figure}[H]
	\centering
	\includegraphics[width=0.5\linewidth]{img/rn42-mount}
	\caption[RN-42 Antenna Clearance Diagram]{Antenna Clearance Diagram of the RN42 Bluetooth Module. \textit{Permission submitted to reproduce}. \cite{HardwareConsiderations:RN42}}
	\label{fig:rn42-mount}
\end{figure}