Supplier eBooks

TE Connectivity - Building Intelligent Automation

Issue link: https://resources.mouser.com/i/1442385

Contents of this Issue

Navigation

Page 12 of 18

13 order of Arduino dev board, Wi-Fi shield, and then the weather shield sitting on top (Figure 4). The Huzzah has an operating voltage of 3.3V, but when powered via USB, it is possible to tap into the USB's 5V via the V_USB pin. This allows us to power the 5V servo motor without a separate supply. The Pulse Width Modulated (PWM) signal wire of the servo can remain at 3.3V. In the provided GitHub repository, we provide both a schematic and board layout that breaks out the Huzzah pins and provides some male header pins for easily connecting the servo to the Huzzah. One thing to note is that the GPIO pins of the Huzzah are not sequentially numbered; they are clearly labeled on the board itself, so be certain you are wiring to the correct pins. For this project, GPIO pin 2 is using to provide the PWM control signal to the servo. Lastly, if you intend to mount this design permanently, we have provided STL files for enclosures that can be 3D printed to keep the electronic hardware protected (Figure 5). Software The software for this project was developed using Microsoft's Visual Studio Code, an extensible code editor that supports a variety of languages including C/C++ and the derivative wiring language used in the Arduino IDE (Figure 6). Visual Studio Code offers more robust development features such as code completion and breakpoints. However, this project can be accomplished just as easily in the standard Arduino Integrated Development Environment (IDE) if so desired. Libraries First, we will grab the support libraries necessary to work with the chosen dev boards and shields. Thankfully, the hardware manufacturers for both the weather shield and the ESP8266 Wi-Fi shield provide the code on their respective GitHub repositories (Figure 7). The libraries we will be using include: • TE Connectivity Weather Shield • HTU2xD(F) (Temperature and Humidity) • MS5637 (Temperature and Pressure) • MS8607 (Temperature, Humidity and Pressure) • TSYS01 (Temperature) • TSD305 (Temperature and Contactless Temperature) • ESP8266 Wi-Fi Shield In addition to these libraries, we will also be using two standard libraries included as part of the Arduino IDE: SoftwareSerial.h and Servo.h. Figure 5: STL files for a 3D printable project enclosure is available in the project repository. Figure 6: Visual Studio Code is powerful code editor that adds professional programming features atop the standard Arduino IDE.

Articles in this issue

view archives of Supplier eBooks - TE Connectivity - Building Intelligent Automation