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.

Monday 25 March 2024

PCB Artwork - Coffee Cup Coaster

Introduction 

In a previous blog, the circuit board drafting tool Altium Designer was used to create circuit board (PCB) artwork. In this blog, a coffee cup coaster was created using the same technique.

Coffee Cup Holder Front and Back
Coffee Cup Holder Front and Back

Removing Colour and Changing the File Format

To begin, select the desired clipart image from your preferred site, such as the image used in this post - a coffee cup. All credit to the original designer and provider of the coffee cup.

Coffee Cup Clipart (Credit Clip Library)
Coffee Cup Clipart (Credit Clip Library)

Import the image into an editing tool such as GIMP, Photoshop, or a free online editor. Remove any colour from the image (black and white) to prepare it for use on the PCB. Increase the thickness of the image as needed to ensure ease of production.
After the image editing is complete, save the updated image in a PNG format. This format allows for easy copying and pasting into Altium Designer.

Creating the PCB

To begin creating the PCB artwork for our coffee cup coaster, a circular arc (mechanical layer 1) with an 80 mm diameter to the PCB. This arc defined the board shape and should be larger than the image. An 80 mm diameter suits cups, a 100 mm to 120 mm diameter would suits most mugs.

Coaster PCB Shape and Size
Coaster PCB Shape and Size

Next, the PNG file contents were copied and pasted into Altium Designer. The imported image is represented by various regions which can be moved as needed.

For the coffee cup, the top copper layer was adjusted using the Properties dialogue box.

Manual Solder Mask Expansion Setting in Altium
Manual Solder Mask Expansion Setting in Altium

To ensure a minimum distance between the solder mask and the copper layer, the solder mask expansion of the copper region was manually reduced to zero using the Properties dialog.

The steam seen above the coffee image was changed to a top-layer silk screen using the same Properties dialog in Altium.

Coffee Cup Coaster in Altium 2D
Coffee Cup Coaster in Altium 2D

PCB Export

To prepare the PCB artwork for manufacturing, the file format (Gerber) needs to meet the requirements of the selected PCB supplier. The format may vary depending on the manufacturer and is usually listed on their website. In this post, the JLCPCB supplier was utilised to manufacture the PCB.

Manufacturing

The final appearance and cost of the coaster can vary greatly based on various factors. These factors include the thickness of the circuit board material, surface finish, solder mask and silkscreen colour.
In this post, the board thickness was maintained at 1.6 mm, the surface finish was lead-free HASL (Hot Air Solder Levelled), the solder mask was changed to black on the top side only and the silk screen was kept as white.

Coffee Cup Coaster in Altium 3D
Coffee Cup Coaster in Altium 3D

Final Product

Pictured below is an image of the board as supplied by the manufacturer.

Coffee Cup Coaster on the Bench
Coffee Cup Coaster on the Bench

Due to lighting the contract between the silver surface and the white silkscreen is not captured. To increase the longevity of the coaster, a clear epoxy or a hard-wearing lacquer could be applied. This will prevent the HASL coating from becoming tarnished over time.

Coaster in Use
Coaster in Use

Saturday 24 February 2024

CTEK MXS 5.0 Pushbutton Switch Replacement

Introduction
This blog follows the process of replacing a faulty mode switch on a CTEK MXS 5.0 battery charger. The symptom of failure was no change in the mode when the mode button was pressed.

CTEK MXS 5.0 Charger
CTEK MXS 5.0 Charger
 
Repair Process

With no screws located on the charger case for servicing, YouTube was consulted on methods to open the charger.

For this charger model, the case is a two-part build. The sealing mechanism between the two cases (seam) appeared to be a glue or a plastic weld. The plastic seam was cracked by placing a flat blade (wide) screwdriver on the seam and striking the rear of the screwdriver with a mallet. The break in the plastic was, however, not entirely clean.

CTEK MXS 5.0 Open Case
CTEK MXS 5.0 Open Case

On separating the case halves, the plastic base of the charger contains what appeared to be some type of isolator.

CTEK MXS 5.0 Case Bottom
CTEK MXS 5.0 Case Bottom

CTEK MXS 5.0 Case Lid
CTEK MXS 5.0 Case Lid

To allow access to the charger circuit board, the cable glands at either end had to be removed. As pictured in the image below, one of the glands has an indent for a thermistor or possibly a thermal fuse.

MXS 5.0 Device in Cable Gland
MXS 5.0 Device in Cable Gland

With the board unseated and flipped over, the logic devices, controllers, processor and switch were visible.

CTEK MXS 5.0 Circuit Board
CTEK MXS 5.0 Circuit Board

Possibly to prevent damage to the decal, the membrane switch has a plastic cap fitted.

CTEK MXS 5.0 Circuit Board Switch Cap Off
CTEK MXS 5.0 Circuit Board Switch Cap Off

As the pushbutton switch manufacturer and model were unknown, a similar surface mount switch was used. 

For readers preferring to locate an exact pushbutton replacement, the switch body is 6 x 6 mm with a height of 4 mm. The switch plunger height from the switch body is approximately 2.7 mm. The top of the tapered shaft is 3.45 mm. The top of the switch shaft is the side pressed into the button cap.

CTEK MXS 5.0 Factory and Replacement Switch
CTEK MXS 5.0 Factory and Replacement Switch

The plunger height of the replacement switch was manually reduced with a pair of side cutters.

After fitting the replacement switch to the circuit board, the charger was powered and the button operation was tested. The switch cap was then fitted.

CTEK MXS 5.0 with New Switch
CTEK MXS 5.0 with New Switch

Reassembly
The circuit board was moved into position and realigned to fit into the charger's plastic lid.

During the reassembly process, the electronic protection device was reinserted into the cable gland.

CTEK MXS 5.0 Protrusions for Cable Gland
CTEK MXS 5.0 Protrusions for Cable Gland

When the two halves of the charger case were pushed together, the two U-shaped plastic protrusions on the plastic base locked the cable glands in position.

Lastly, to permanently join the halves of the charger case, glue was applied to the seams near the cable glands. For readers using the charger in a high moisture or damp environment, fully sealing the seam of the charger is highly recommended.

CTEK MXS 5.0 Charging Battery
CTEK MXS 5.0 Charging Battery



Wednesday 3 January 2024

10Gtek Ethernet to Fibre Converter Teardown

Introduction
This post provides a teardown of the 10Gtek G0101-SFP Ethernet to Fibre Media Converter.

10Gtek Ethernet to Fibre Media Converter
10Gtek Ethernet to Fibre Media Converter

Background
To electrically isolate Ethernet test equipment on the bench, a pair of media converters were being utilised. I wanted to know what was inside the media converters since standalone boards performing the same Ethernet to Fibre conversion were available on AliExpress for less than USD 9.

10Gtek Media Converter Nameplate
10Gtek Media Converter Nameplate

Teardown
The case of the 10Gtek converter is of two-part metal construction. Both of the case parts are held together with four screws. At one end of the metal case are two media connections (Ethernet and SFP). Status LEDs are also visible on this side. On the opposite end of the case is the DC power jack.

10Gtek SFP  Module
10Gtek SFP  Module

After removing the SFP (Small Form-factor Pluggable) Transceiver and the metal screws for the case, the metal parts slide apart then the printed circuit assembly (PCA) is visible.

10Gtek Ethernet to Fibre Media Converter PCA
10Gtek Ethernet to Fibre Media Converter PCA

The PCA sold by AliExpress look very similar to the PCA used in the 10Gtek unit. On the circuit operation, Ethernet to SFP hardware conversion is performed using a Realtek device part RTL82138.

Elsewhere on the PCA is the metal-cased SFP Transceiver connector, low dropout regulator (ASM 1117 from Monolithic Power Systems), Ethernet magnetics and 25 MHz crystal for the Realtek driver.

It shall be noted that during the disassembly of two 10Gtek units, one of the 10Gtek units contained solder balls on the PCA. Post-manufacturing QA processes commonly identify and remove solder balling.

Solder Balling on PCA
Solder Balling on PCA

The unit draws approximately 300 mA at DC 5 V when powered. Heatsinking for the regulator was provided using the circuit board. Low Dropout Regulator (LDO) heat generation is a result of regulating the input supply voltage down to 3.3 V.

The M3 screws used for retaining the circuit board to the case appear to have oversized heads, or the circuit board footprints are undersized. The screw head's outer dimension measures 6.8 mm however, the circuit board footprint is 5.2 mm.

Mismatch of Sizes for Screws or Board Land Pattern
Mismatch of Sizes for Screws or Board Land Pattern

Additionally, a capacitor is connected between the converters DC 0 V and the case of the unit. If the case is considered Earth, then there is no dedicated external Earth connection provided on the case. The shell of the Ethernet connector is connected to the converter case

Summary
For those seeking just an Ethernet to Fibre converter, many online suppliers have PCAs available. The 10Gtek is useable as manufactured, although a PCA inspection is highly recommended. Also, by applying minor updates to the unit's power supply input, the electrical robustness of the 10Gtek unit could be strengthened.

Sunday 31 December 2023

Oscilloscope - Ringing on Waveform Measurements

Introduction
This post is an aide-mémoire for enthusiasts performing measurements using an oscilloscope on circuits that feature fast rise-fall times.

Oscilloscope Measurement Ringing
Oscilloscope Measurement Ringing

Background
While reviewing waveforms posted online for Time Domain Reflectometry (TDR) circuits, some waveforms appeared to have ringing that may be a result of excessive lead lengths used during oscilloscope measurements.

Measurements
In this post, the example the rising edge of waveforms were captured using test equipment consisting of a 300 MHz 2 GS digital oscilloscope, a passive probe (calibrated) and a PSoC5 LP for signal edge pulse generation. The PSoC5 output pin was clocked at 4 MHz with a rise time of over 10 ns
(Infineon-AN72382_Using_PSoC_3_and_PSoC_5LP_GPIO_Pins-ApplicationNotes-v09_00-EN.pdf, Greg Reynolds, Cypress, Rev H, 2018).

In the subsequent section, example 1 was the worst-case measurement for signal ringing and example 4 was an improved setup and measurement.

Example 1. Long Lead from Probe Tip and Long Earth Connection

Example 1 - Connections for Measurement
Example 1 - Connections for Measurement

In this example, the cable lengths connected to the oscilloscope probe contribute mostly to the signal ringing. Other factors such as impedance mismatch were not reviewed as part of this post.

Example 1 - Oscilloscope Measurement

Example 2. Long Lead from Probe Tip and Leaded Oscilloscope Earth Connection

Example 2 - Connections for Measurement
Example 2 - Connections for Measurement

Shorter cable lengths reduced the ringing however ringing was still prevalent.

Example 2 - Oscilloscope Measurement
Example 2 - Oscilloscope Measurement

Example 3. Direct Connection to Probe Tip and Leaded Oscilloscope Earth Connection

Example 3 - Connections for Measurement
Example 3 - Connections for Measurement

This change to the connections was the largest improvement compared to examples 1 and 2. Ringing was improved with a direct probe connection and a shorter Earth lead although the return path through Earth lead could be reduced further.

Example 3 - Oscilloscope Measurement
Example 3 - Oscilloscope Measurement

Example 4. Direct Probe Tip and Ground Spring Connection

Example 4 - Connections for Measurement
Example 4 - Connections for Measurement
 
A further improvement compared to example 3 with minimal lead lengths.

Example 4 - Oscilloscope Measurement
Example 4 - Oscilloscope Measurement

Example 5. Long Measurement Trace and Oscilloscope Earth Connection (Slow Edge Rate)

The capture below was made from the same hardware setup as example 1 and the PSoC was programmed for a slow instead of a fast edge rate.

Example 5 - Oscilloscope Measurement
Example 5 - Oscilloscope Measurement

Direct Connections
If a direct connection to a circuit board is possible, a board-mounted fixture in an option. These fixtures allow the oscilloscope probe tip to be inserted directly into the fixture. Some examples of fixtures for probing can be sourced from suppliers such as Teledyne, Cinch and Tektronix.

Example of Circuit Board Fixture (Courtesy Digikey)
Example of Circuit Board Fixture (Courtesy DigiKey)

Summary
Attention to measurement techniques can improve oscilloscope measurements however these are not always practical. While this post touches on one possible change that can be made to measurements, other factors should also be researched and considered depending on the type of signal. Further literature and content including passive probe compensation is available from manufacturers such as Teledyne. Detailed content for oscilloscope measurements can be found from Analog.

Tuesday 5 December 2023

Salvaging from a WAG120N Router

Introduction
This blog looks at salvaging parts and designs from a Linksys ADSL router model WAG120N.

WAG120N
WAG120N (Courtesy Google Images)

Parts Salvaging
Firstly flipping the router over to reveal the base of the unit, there are four plastic screws retaining the lid. After removing the screws, the lid can be detached from the base (two plastic shells) with a small flat-blade screwdriver or plastic prying tool.

Bottom View of WAG120N Router
Bottom View of WAG120N Router

Removing the lid shows the internals of the router; a circuit board and a dedicated antenna.

Internal View of WAG120N Router
Internal View of WAG120N Router

Circuit Board - Top Side
The DC-DC Stepdown converter from ITE Tech part CAT7105CA (purple box in image below) is not listed as a part online; the status of the part is unknown. Not worth salvaging unless for a repair to a similar router.

Identified Parts of WAG120N Router Circuit Board - Top Side
Identified Parts of WAG120N Router Circuit Board - Top Side

The serial flash from Taiwanese manufacturer
Macronix International, part MX25L3206EMZI-12G (red box), is not large in capacity but could be salvaged. As with other parts, this part appears to be obsolete.

Capacitor manufacturers are Leylon and Luxon. These parts appear to be in good condition although for the age of the router, these may not be worth salvaging.

There are two through-hole crystals on the board, 25 MHz and 36 MHz (black box). Depending on needs, either crystal could be useful for small or hobby projects.

Under the small aluminium heatsink is the part responsible for the 802.11 communications, Ralink RT3050F (yellow box).

Other parts such as the memory (green box), ADSL controller (blue box) and the enclosed metal can device were not reviewed. The remaining items such as the LEDs could be easily salvaged.

Salvaging the mechanical items such as the switch, power jack, push button and connectors could be possible with the appropriate equipment.

Circuit Board - Bottom Side
The linear regulator used on the board appear to be manufactured by General Semiconductor which was acquired by Vishay Semiconductor some years ago. The part on the circuit board GS117A (red box in image below) appears to be obsolete although this is a jelly bean regulator.

Identified Parts of WAG120N Router Circuit Board - Bottom Side
Identified Parts of WAG120N Router Circuit Board - Bottom Side

Some parts with markings, NF B1386L, are possibly a Unisonic transistor 2SB1386L (blue box), not worth salvaging.

External and Circuit Board WiFi Antennas
The external antenna pictured below from Galtronics could not be located as a product on the Galtronics website. The antenna may have been a custom design for the Linksys router.

Galtronics Router Antenna
Galtronics External Router Antenna

The mechanical antenna may be an interesting part to experiment with. For the second WiFi antenna, this is designed into the circuit board as pictured below.

Circuit Board Antenna for Router
Circuit Board Antenna for Router

Both antennas could serve as reference design in the WiFi domain by providing dimensions or a circuit board layout.

Summary
In general, the physical parts from the Linksys router were not worth salvaging. However, the dedicated external WiFi antenna from Galtronics was an interesting hardware design.


Sunday 12 November 2023

Voltage Interruption Tester for EN 61000-4-29 Code Update

Introduction
This blog provides a software update to the Voltage Interruption Tester discussed in previous posts

Code Changes
A simple software watchdog was added to the code. The watchdog duration was determined by measuring the maximum cycle time of the main loop with some additional time to account for jitter.

Decrementing counter was placed in the system timer.

/*******************************************************************************
* @brief System Timer
* @note  1 ms
*******************************************************************************/
CY_ISR(Timer_System_isr)
{         
    ...
    if (WD_Ctr != 0)
    {
        WD_Ctr--;
        if (WD_Ctr == 0)
        {          CySoftwareReset();      /* Should never get here */
        }
     }
    ...
}

Time timer was refreshed in main.

/*******************************************************************************
* @brief    Main
* @return   The point of no main *******************************************************************************/
int main()
{
    ...
while(1u)
    {
...
      WD_Ctr = WD_TIMEOUT;
    }
}

Downloads

Interruption Tester 0.1d PSoC Project