# Prototyping of Environmental Kit for Georeferenced Transient Outdoor Comfort Assessment
## 3 Prototyping Methodology
### Prototype Development
#### 3.2.4 Breadboard Connections and Schematics  
The Arduino Mega was specifically selected because of the wide collection of pins and compatibility with most of the sensors. The selected data logger is mounted on top of the MCU. For its I\({}^{2}\)C connection, the serial data (SDA) and serial clock (SCL) pins from the MCU are connected to analog pins A4 and A5 of the data logger shield. The IDE code and SD libraries are also slightly modified. The PC connection and code modifications are specific to the project's data logger and are skipped in the latest versions of the shield. The attached RTC is powered by a CR1220 coin cell to avoid redundant programming as the RTC resets the time when power is not available. The DS18B20 temperature sensor is attached to the MCU through digital communication. A 4.7 k\(\Omega\) pull-up resistor is connected in parallel between the data and V\({}_{\text{DD}}\) lines. As a one-wire sensor, it has a unique 64-bit serial number; therefore, a vast number of one-wire sensors can share the same bus. The code includes a sensor temperature request in the loop and calls the sensor by index; 0 refers to the first sensor on the bus. The SHT20 humidity and temperature sensor is controlled by the I\({}^{2}\)C protocol. The sensor is  
Figure 2: The process of testing environmental sensors.  
initiated in the void setup, and its specific library is included at the beginning of the code. The TSL2561 luminosity digital sensor is a 3 V logic module, but due to its internal 3.6 V voltage regulator, it can be connected directly to 5 V of the Arduino board. Therefore, there is no logic level issue with I\({}^{2}\)C connections. The I\({}^{2}\)C lines SDA and SCL are joined parallel to SHT20 sensor's data and clock bus. The address change pin (ADDR) can be used to avoid I\({}^{2}\)C address conflict, but it remains idle in our circuit. Similarly, the interrupt (INT) output pin is also disconnected. This pin is used for configuration of the sensor with a change in the level of light.  
The pinouts for TCS34725 is exactly the same as that of TSL2561. The only addition to the layout is the LED pin that is connected to GND to turn off the built-in LED. This LED projects light (4150 K neutral) on an object for color sensing.  
The SEN0170 anemometer's V\({}_{\text{DD}}\) line is connected to an external 9.6 V DC supply, and the GND is connected to Arduino GND. The same battery powers the MCU when detached from the USB supply source. The data line is attached to an analog pin of the MCU to transmit sensor readings. The PMS5003 particulate matter sensor is attached to the MCU's universal asynchronous receiver/transmitter (UART); transmitter line (TX) to the receiver (RX1) of the MCU. The rest of the sensor pins are not used in our project. The sound detector (SEN-1462) is also powered from the MCU. The sensor's gate pin is attached to the MCU for a digital signal, while the envelope transmits analog data. The audio pin remains unused in our project. The GPS module is powered by the MCU's 5 V supply. The mode of communication is UART by attaching a transmitter line of the GPS to the receiver of MCU and vice versa. The ESP-0 Wi-Fi module connection includes several steps to flush the old firmware and install new firmware through an FTDI serial adaptor. In the absence of an adaptor, a voltage divider is used as the Wi-Fi module is a 3 V device. The module demands a supply current of 300 mA, while the maximum current supplied by the Arduino at 3 V rail is 200 mA. Therefore, an external supply must be used for the ESP-01 module. A voltage divider is used between the RX pin of the ESP and the TX pin of the Arduino as the 5 V logic can fry the Wi-Fi module. The connections are further explained through breadboard diagram and schematics diagram in Figure 3.  
Figure 3: Wiring and schematic diagram of the conclusive model (Fritzing).