Showing posts with label esp. Show all posts
Showing posts with label esp. Show all posts

Sunday, 28 April 2024

Model Rocket Launcher WiFi ESP8266 Part 3

Introduction 
This blog continues from Part 2 of the ‘Wi-Fi-controlled rocket launcher’. In this blog, the software changes to suit the ESP8266 are mentioned. Additionally, a mechanical 'proof of concept' for the rocket launcher is shown using a 3D-printed case.

Bench Test of Rocket Launcher
Bench Test of Rocket Launcher

Code Change Summary
In the earlier version of the model rocket launcher design, a PSoC microcontroller with Bluetooth was selected for communications. When moving to the ESP8266, the Bluetooth communications interface was changed to a Wi-Fi interface. Using a Wi-Fi interface simplified the design when compared to developing in Android Studio.

To support a broader audience using the ESP8266, it was decided to perform software development using the Arduino platform.

/** *****************************************************************************
* @file   main.c
* @version 1.0b
* @date 10/02/2024
* @brief
* 01/03/2023  Moved code from original PSoC version into Arduino
* 13/01/2024  Changed code operation, updated launch state machine
* 24/01/2024  Client connection issues noted during testing
* 10/02/2024  Code cleanup. Changed deprecated server.available() to server.accept()
****************************************************************************** */

#if !defined(ESP8266)
  #error For ESP8266. Check Tools->Board setting
#endif

/*_TIMERINTERRUPT_LOGLEVEL_ from 0 to 4 */
#define TIMER_INTERRUPT_DEBUG         1
#define _TIMERINTERRUPT_LOGLEVEL_     1
#define ENABLE_DEBUG_PRINTS           true

Most parts of the original code from the PSoC, including the launcher state machine, were either updated or rewritten. Code changes were needed for the ESP and targeted toward proper encapsulation.

ITimer.attachInterruptInterval(TIMER_INTERVAL_MS * 1000,TimerHandler);  /* 10 ms system timer */
      

Snippets and libraries from the Arduino community were included in the new launcher code. Specifically, credit goes to Khoi Hoang for Timer Interrupt examples and Martyn Currey for ESP Wi-Fi implementation.

How Software Was Developed
The code was developed using the Arduino IDE. Initial testing for the ESP code was performed using a Windows laptop for the Wi-Fi connection primarily to test the webpage interface. Testing subsequently progress to  an Android phone.

Shown in the image below is the first rocket launcher web page. Additional information such as battery voltage and launch state may be included on the web page in later updates.

Rocket Launcher Webpage
Rocket Launcher Webpage
 

Launcher Case
After reviewing the previous enclosure and cost, it was decided to design a 3D-printable enclosure to house a small lead acid battery and a control board. The lead acid battery is only temporary and will be changed to an 18650-cell(s) capable of a high-discharge current.

For the 3D-printed case, two mechanical parts were drafted in Fusion 360. These parts comprised of a base and a lid as pictured below.

Rocket Launcher Case (Fusion 360)
Rocket Launcher Case (Fusion 360)
 

Launcher Hardware Assembly
With the ESP code allowing the desired launch operation, the circuit board, wiring and battery were assembled and added to the 3D-printed case.

Rocket Launcher Test Assembly
Rocket Launcher Test Assembly

During the assembly, it was noted that the pluggable circuit board headers, although simple to install and use, were expensive and consumed space. On the subsequent revision of the board, as displayed below, the pluggable headers were replaced with through-hole solder pads that suit a larger gauge wire.

Updated Launcher Board
Updated Launcher Board

Additionally, the toggle switch used for controlling the power was salvaged from another project. There are no manufacturer markings on the switch to generate a Bill of Materials. More clearance was added around the toggle switch body to suit other types of toggle switches such as the model shown below.

Standard Toggle Switch
Standard Toggle Switch

Complete Test Assembly
For a bench test, a lamp was used as the igniter as pictured below. A short video of the operational launcher is exampled in the video.


The next post will feature the updated launcher circuit board and field testing.

Saturday, 24 June 2023

Model Rocket Launcher WiFi ESP8266

Introduction
This blog follows the redesign and development of a model rocket launcher controller that features WiFi communications to control the launch process. This design uses an ESP-based microcontroller module. The Arduino platform was chosen for code development.

Rocket Launcher 3D Model
Rocket Launcher 3D Model

Redesign
To control the launch in the previous model rocket launcher design, Bluetooth communications were used between a PSoC microcontroller and an Android phone. The interface was changed to WiFi to remove the need for developing a phone application. Controlling a rocket launch through WiFi would be independent of a phone or computer operating system.

WiFi Module
For the launcher redesign, an off-the-shelf ESP module capable of WiFi was chosen from Adafruit. The ESP module was chosen for a few reasons. Firstly, the module’s price was relatively low (USD 10). The module was readily available compared to other dedicated microcontrollers. Lastly, using an ESP module meant that the rocket launcher design could be migrated more easily to other ESP devices.

Adafruit Huzzah ID 2471 (Courtesy Adafruit)
Adafruit Huzzah ID 2471 (Courtesy Adafruit)

Reused Design
The same section of circuit responsible for driving the rocket engine igniter was taken from the previous design. This section consisted of high (VN7040) and low-side (VNL5030) switching drivers (ST Microelectronics).

Rocket Launcher Igniter Drive Circuit
Rocket Launcher Igniter Drive Circuit

Circuit Updates
To begin the schematic update process, the ESP module was created in the schematic libraries. The new part replaced the previous PSoC microcontroller and associated circuitry.

The Altium PCB model was downloaded from the website SnapEDA.

Capture of Adafruit Huzzah PCB Footprint from SnapEDA
Capture of Adafruit Huzzah PCB Footprint from SnapEDA

Schematic Updates
On the ESP module schematic page, the power supply connections and ST driver control signals were mapped to the ESP.

Rocket Launcher - Huzzah Circuit Connections
Rocket Launcher - Huzzah Circuit Connections

Audible notification of an impending launch was retained using the buzzer. Connections were mapped to the ESP.

Rocket Launcher - Buzzer
Rocket Launcher - Buzzer


The display (LCD) was infrequently used in the previous design so it was removed and replaced with an LED.

The launch button input to the ESP module was retained for testing purposes.

Rocket Launcher - Optional Launch Button
Rocket Launcher - Optional Launch Button

Connections were made to ESP module pins that had no special functions.
 
Output Drivers

Schematic changes were made to the ST output driver’s power supply. This was required to match the ESP module’s DC 3.3 V supply voltage. The feedback monitoring from the ST drivers was removed from the design because of the reliable performance of the ST drivers.

Power Supply
A DC-DC step-down converter was retained for the power supply. Texas Instruments part LMR50410 featuring an integrated diode was selected to replace the previous DC-DC converter.

Another benefit of the DC-DC converter is its operating voltage which is wider than the ESP modules linear regulator (LDO). The LDO has a maximum rated input voltage of DC 6 V. This voltage does not suit all battery chemistry types.

Rocket Launcher - Power Supply
Rocket Launcher - Power Supply

Battery voltage monitoring using the ADC on the ESP through a resistor divider was kept for experimentation and possible future use.

Circuit Board
There were no caveats defined for the shape of the circuit board (PCB). The placement of components drove the PCB shape. Minimal design constraints for the PCB meant that the PCB was set up for components on both sides.

The capture below shows the PCB top layer with the ESP module, power supply underneath the ESP module, buzzer and optional screw terminals. To fit the power supply beneath the ESP module, pluggable headers were utilised to space the ESP module off the board.

Rocket Launcher PCB - Top Layer
Rocket Launcher PCB - Top Layer

The next capture below shows the PCB bottom layer containing the output switching drivers and related components.

Rocket Launcher PCB - Bottom Layer
Rocket Launcher PCB - Bottom Layer

Four PCB layers were used for the launcher board stack-up. Captures of the two internal power planes have not been shown.

After component placement and routing, the board size reached a comfortable size of 62 x 44 mm. On the longest PCB axis, a set of 3 mm strips were added to suit mounting in an enclosure. Pictured below is a 3D side and rear view of the board.

Rocket Launcher - 3D Side View
Rocket Launcher - 3D Side View
Rocket Launcher - 3D Rear View
Rocket Launcher - 3D Rear View

In part 2 of the launcher blog, the PCB construction and initial testing will be performed.