Tuesday, 3 July 2018

Salvaging electronic parts - Part 2 Spark Gaps

Summary
This blog is a continuation of a prior blog which illustrated the selection of electronic parts for salvage and basic component removal using a soldering iron.

Salvaging Designs
As used in the first part of the Salvaging Electronic blog, the same NESS security system (D8X D16X) control board will be used for the purposes of this blog. The content of this blog focuses more on salvaging, replicating or repurposing designs. When referring to designs this could be the schematic design, Printed Circuit Board (PCB) layout or both.

The section of Ness control PCB under examination in this blog was the sensor input. This area was chosen was to illustrate the schematic (resistors selection) and PCB design (on-board spark gaps).


Ness Sensor Input Section
Ness Sensor Input Section
The image above shows the passive components related to monitoring devices such as relay contacts (PIR sensors). 

A basic schematic representation of one of the input channels is shown below. Note that this hardware design operates in an analogue fashion. That is, the voltage on each sensor input is fed into an analogue switch (4051) and measured by the on-board controller. A break in the line between the externally connected sensor and the sensor input circuit changes the voltage measured.

Of interest in this design is the line facing input resistor (Rb) and the spark gaps (Ya).

Sensor Input Section
Sensor Input Section
How is this design useful? 

When designing a product, with similar specifications, then referencing existing and proven designs can serve as a valuable baseline. This is not to say that newer solutions or devices should not be investigated thoroughly. Consider a product with a similar input requirements such as an external automated gate, marine access hatch monitor or cattle feed flow controller which may require external monitoring of a sensor. A similar input circuit would seem a logical choice. Could the input resistor Rb be exchanged with a standard thick film resistor (1206 footprint)?

Looking at a standard Panasonic 1206 resistor, this part is rated at a continuous 200V for a maximum power of 250mW. For steady state conditions this voltage and power handling would be more than suitable. In some systems, inputs can be subject to transient voltages as a result of external events which may be due to indirect lightning strikes for example. Using a single standard thick film resistor may not be the ideal choice for this solution. 

Undoubtedly for transient events, additional protection such as Varistors, Transorbs or other surge protection solutions are commonly used in conjunction with suitably rated circuit components. Inputs circuits are usually bolstered using devices designed for handling transients (Pulse Withstanding) such as Metal ELectrode Face (MELF) resistors. MELF devices from Vishay are such an example. The Vishay series MMA HV MELF in an 0204 footprint (1206 compatible), operates at a continuous 300V for a maximum power of 400mW
For the same footprint and small increase in cost, an input section can be made more robust. This provides the option of switching between standard vanilla and application specific components.

Salvaging Layouts
For the sensor input section, it was mentioned earlier that for transient events other surge protection solutions could be added to the design.


Ness Sensor Input Spark Gap
Ness Sensor Input Spark Gap
The Ness board has two solutions for line facing transients. One is circuit components (Yb and Yc) and the second is exposed PCB traces (Ya). Components Yb and Yc are most likely Varistors and Ya is an array of several spark gaps made possible by sections of PCB copper with solder mask removed. It should be noted that component Yb is not fitted to the board in lieu of Ya being 'on the fibreglass'. Certainly Varistors are more accurate for a rated breakdown voltage when compared to a spark gap and add cost to the board. 
A spark gap, as the name suggests, is a gap or distance between two points across which a transient voltage (spark) can discharge. The distance the spark can breach is a function of creep distance. Technical literature on this subject can be viewed at multiple sites such as EDN Access (basic) - ESD Protection for IO Ports, read on Stack Exchange, Wiley, PTR or the distance needed for a design can be calculated on www.creepage.com. Some understanding of material and contamination of PCB's is required.

For those needing a fundamental understanding of creepage, Paschen's law is a solid starting point.

Focusing on the Ness control PCB, the gap between the two spikes is somewhere around 1mm. Using the tables on the PTR website to determine a ballpark transient overvoltage, for a standard level two PCB contamination on FR4 PCB, yields approximately 400V.

In reality 400V is an extremely low voltage for arcing and only marginally above the theoretical 327V required to arc in one atmosphere of air, see Paschen's law. Regardless of the actual breakdown voltage of this design, some level of protection will be afforded to the design with the addition of spark gaps to the PCB. In any event component, Yc will bear the brunt of any residual voltage that the spark gap does not dissipate.

Adding Spark Gaps to a PCB
Depending on your drafting software of choice, the process to add spark gaps may differ from program to program. The subsequent method described requires only changes to the PCB file however, is not the only method for implementing spark gaps in a PCB design. Some designers may prefer to create the spark gap as a schematic / PCB component library pair or modify existing library components to facilitate the additions of spark gaps. Each method has its own merits and should be reviewed carefully.

The target design for adding spark gaps was the Solar MPPT Project designed in a previous blog. There are two external digital lines which provide communications between an MPPT and a Solar MPPT Controller. These TTL lines expose both the MPPT and Controller to transients and use only steering diodes for protection.


Existing Communications Port - No spark gap
Existing Communications Port - No spark gap
A spark gap separation of 0.5mm was used for the purposes of illustration. For a specific design, the necessary calculations should be made to determine the correct separation.

Fortunately there are ample 0V connections on the existing communication connector. Other designs may need to make use of vias to provide the necessary return path for the transient event.


Top Layer Spark Gap Added
Top Layer Spark Gap Added
In the above image, a polygon was added to the solder side of the component - top layer. A single pair of terminals 'points' for the spark gap is sufficient if the chance of the design experiencing a transient event is low. For higher probability of transient events, then more points should be used where practical for the design.
Top Side Solder Mask Over Spark Gap
Top Side Solder Mask Over Spark Gap
Following the addition of the copper to the board the solder mask must be excluded from the region used by the spark gaps. The capture above shows the spark gaps with the solder mask included.


Fill Added - Top Layer Solder Mask
Fill Added - Top Layer Solder Mask 
To exclude the solder mask, a fill was added to cover the area over and between the spark gap terminals.


Top Side Solder Mask Removed Over Spark Gap
Top Side Solder Mask Removed Over Spark Gap
Viewing the addition of the solder mask fill to the board shows the exclusion over the spark gap terminals. In some instances the PCB terminals are given a liberal coating of solder at the time of assembly. The main goal is to lengthen the lifespan of the terminals.

Whether components, an input design or PCB layout is recovered from the occasional tear down or salvage, the process can be well worth the exercise. 

Sunday, 3 June 2018

Rexon RDM 150D Drill Press Refurb

Summary
This blog follows the refurbishment of a twenty year old Taiwanese drill press, model RDM 150D, manufactured by RexonThe drill press manufacturer is still in business at the time of releasing this blog although Rexon only lists one model of floor standing drill press on its website, no spares.


RDM 150D Original State
RDM 150D Original State 
Below is the plate for the Rexon 3/4 HP drill press.


RDM 150D Name Plate
RDM 150D Name Plate
As the drill press was still in operating condition, there was principally cosmetic work to be performed on the drill press. 


Rust Removal
Most small metallic items were detached from the drill press to remove the surface rust. Larger items such as the drill press table were mounted in a vice and cut back to bare metal using a wire brush mounted to cordless drill. To keep the dust to a minimum during wire brushing, a light coating of motor oil was rubbed into the rusty surface.


RDM 150D Table After Cleaning
RDM 150D Table After Cleaning

Chrome surfaces were cleaned with 00 steel wool and a good helping of an aerosol lubricant WD-40.


RDM 150D Feeder Levers Before and After Cleaning
RDM 150D Feeder Levers Before and After Cleaning
Table locking bolts were clamped securely in a bench vice and cleaned with a wire brush. After cleaning a light coating of oil was applied to the surface.


RDM 150D Locking Bolt Before Cleaning
RDM 150D Locking Bolt Before Cleaning
RDM 150D Locking Bolt After Cleaning
RDM 150D Locking Bolt After Cleaning
The chuck was earmarked for replacement with a keyless variety. The arbor was still retained as it was reasonable condition.


RDM 150D Original Chuck with Arbor
RDM 150D Original Chuck with Arbor
To suit the original Rexon chuck a compatible JT-3 Taper Mount keyless chuck was installed.


Replacement Keyless Chuck
Replacement Keyless Chuck
The motor was removed and inspected for possible faults and wear and tear. An insulation tester was used to check for any breakdown in the motor windings. The motor passed a 1000V check between the 240V active and the case of the motor - earth.


Drill Press Induction Motor
Drill Press Induction Motor
During the motor removal the belts were inspected and deemed in need of replacement, no surprise after a decade of use.


Drill Press Dual Belts
Drill Press Dual Belts
The Rexon drill press employs a dual belt system with an idler pulley connecting the two belts. The ratio between the two belts and pulleys determining the speed (RPM) of the spindle pulley (chuck). On the Rexon drill press the position of the induction motor can be moved toward and away from the idler pulley to set the required belts tension.


Drill Press Replacement Belts
Drill Press Replacement Belts
Even though the drill press was relatively old, the belts were available off the shelf. The two types used were M-25 and M-26.


Original Mains Cabling
Original Mains Cabling
Although technically speaking there were no cuts, exposed conductors or similar issues with the mains cable this was replaced regardless. The old grey cable is best replaced with a thicker insulator such as the orange circular type shown below. Additionally mains plugs have undergone changes where the active and neutral are insulated rather than having completely exposed conductors on the plug.


Replacement Mains Cabling
Replacement Mains Cabling
During the recabling additional light was provided on the work area using an LED on a flexible arm. The fitting point for the base of the light was the service entry located between the spindle and the column.


Raco AC DC Power Supply
Raco AC DC Power Supply
To power the LED a 12V DC supply was used from Digikey - RAC04-12SC/W.


Navara LED Fitted to Service Plate
Navara LED Fitted to Service Plate
The 1W LED used for the drill press is an Automotive type and usually called either a map reading or flexible gooseneck light. Shown in the image above the Navara 87684BL map reading light with a 40cm arm which retails for much less than any commercial workshop equivalent - whether it is as good only time will be the judge. Note the Navara 5 year warranty!


Old Switch Wiring
Old Switch Wiring
All original cabling was removed and discarded.


Start Stop Switch Rewiring
Start Stop Switch Rewiring
To complete the rewiring the primary of the AC to DC converter was wired to the Start Stop switch. Wiring was made so that the LED could be powered as soon as the drill press was powered.


LED to Drill Press Mounting
LED to Drill Press Mounting
Once the LED wiring was connected to the DC side of the AC to DC converter all loose cables were tied away, electrical tape fitted were required and the service plate mounted back onto the drill press.


New Cables Mounted
New Cables Mounted
All the updated orange circular cable was fixed in position with the previous cable clamps.


LED Drill Press Activated
LED Drill Press Activated
With only natural light in the garage the LED makes a significant difference to the light on the work area. The switch for the light is in the head of the light itself so turning ON and OFF is quick and means that in many instances the arm does not need to be adjusted away from the work area.


Work Area LED Lighting
Work Area LED Lighting
Lastly a short video was captured of the Rexon drill press in operation. There is final alignment and belt tensioning required to reduce some of the noise which can be heard during a drilling cycle.



Additional
Pictured below is the motor starting capacitor from the drill press, 150 uF, AC 250 V (Working).

Rexon Drill Press Motor Starting Capacitor
Rexon Drill Press Motor Starting Capacitor

Saturday, 2 June 2018

Apple M2980 Membrane Matrix Pinouts

Summary
This blog details the membrane connector pinouts for the Apple M2980 keyboard and the associated key matrix.


Apple M2980 Keyboard
Apple M2980 Keyboard
The rear nameplate of the keyboard had the details as pictured below.


M2980 Nameplate
M2980 Nameplate
Keyboard Hardware
The M2890 model keyboard lends itself to custom project projects because this model had the keyboard row and column keys available on two membrane connectors.


M2980 Keyboard Internals
M2980 Keyboard Internals
Shown above is an image of the keyboard with the back off. For those paying attention that is 'liquid' damage toward the left hand corner of the image above.

A close-up of the circuit board 'PCB' which encodes the key presses into the Apple ADB format is pictured below.


M2980 PCB
M2980 PCB
For the custom project the original PCB was removed and the keys matrix for the two membrane connections (row and column) decoded manually. 


M2980 P1 and P2 Connector Pin Numbering
M2980 P1 and P2 Connector Pin Numbering
Several directly soldered PCB connections to the back of the PCB, continuity measurements using a multimeter and a multitude of key presses later, the matrix table shown below 'represents' the state of the keyboard used for testing.

Keyboard Matrix Connections


M2980 Membrane Matrix Connections
M2980 Membrane Matrix Connections
The information listed in this blog should be used for reference only and remains the intellectual property of Apple Inc and its subsidiaries

As noted in this blog, the original keyboard did have previous 'liquid' damage and not all keys may have been mapped. 

For the above shown table the Column connections (C0 through C8) refer to the P1 connector (Pins 1 thru 9). Columns start at 0 and the connector pin numbering starts at 1. Similarly the Row connections refer to the P2 connector - same numbering concept.

It should be noted that even after twenty years since its manufacture, this 'economical' model of the Apple keyboard can still find a purpose for the home hobbyist. 

Mouse Hardware
As a side note, the Apple ADB mouse associated with the keyboard was also being literally torn apart to access the microcontroller (possibly an early PIC) when I noted something curious. 

Whether required as part of the physical design of the mouse, or a cheeky play on the die design for the ABS plastic by the Mechanical Engineer(s) in the project, it made me consider where Apple was, where it is now and when it all changed. No doubt face for thought!!


Apple ADB Mouse Torn Down
Apple ADB Mouse Torn Down

Tuesday, 22 May 2018

Delta (AFB1212SHE) Fan Testing

Summary
This blog covers some basic measurements of the Delta (AFB1212SHE) DC brushless fan with a possible use of the fan for computer cooling.


Delta AF1212SHE DC Brushless Fan
Delta AF1212SHE DC Brushless Fan
Hardware Setup
To perform measurements of the current drawn by the fan across and a range of input voltages, the displayed values on from a Rigol DP832 power supply were utilised. For the tacho measurements a Cypress CY8CKIT-049 development board was employed to convert the tacho output from the Delta fan into a corresponding RPM value.


CY8CKIT-049 - Courtesy Cypress Semiconductor
CY8CKIT-049 - Courtesy Cypress Semiconductor


For the PSoC input a pullup resistor (4k7) was connected between the 5V DC supply and the input pin.


PSoC - Delta AFB1212SHE Test Bed
PSoC - Delta AFB1212SHE Test Bed
PSoC Tacho Measurement
The tacho measurement solution utilised a one second sampling window to count the number of pulses. While the measurement solution does have some level of jitter, this was unimportant as the measurement was for indicative purposes.


PSoC Tacho Measurement
PSoC Tacho Measurement

The website documentation for the Delta brushless fan, AFB1212SHE-F00 shows that the fan has 4 poles and two pulses are seen for each complete rotation of the fan. The image below is taken from the fan datasheet.


Delta AFB1212SHE Tacho Output
Delta AFB1212SHE Tacho Output

The Cypress Timer_3 component performs all the counting and is configured to count on rising edges. A copy of the project is available at the end of the blog for anyone wanting to review and improve the design.


PSoC tacho Timer Component Configuration
PSoC tacho Timer Component Configuration

Measurement results of the fan speed were made available on the Kitprog serial connection. 

Measurement Results

While varying the input voltage across the operating range listed on the Delta website, the fan speed was calculated and output to a serial monitor. The DC power consumption was calculated and plotted against the fan speed. 

Shown in the graph below is the almost linear relationship between input voltage and fan speed.


Delta AFB1212SHE Input Voltage vs Fan Speed and Power Consumption
Delta AFB1212SHE Input Voltage vs Fan Speed and Power Consumption

The data listed below represents the points in the graph above. There is also one addition to the table which is Measured RPM. This value was derived using the period of the Tacho waveform to verify the error in the PSoC software measurement.


Measurements with Delta AFB1212SHE
Measurements with Delta AFB1212SHE

Tuesday, 1 May 2018

PSoC 5 Bootloader USB vs UART I2C Speeds

Summary
This purpose of this blog was to test the download speeds of a PSoC 5 development kit using the KitProg I2C, UART and compare the results against the on-board USB to PSoC interface. 

Test Hardware
A Cypress PSoC development kit CY8CKIT-059 was used with a PSoC Creator project that was configured to test the KitProg SCB I2C and UART components, then secondly a SCB UART connected to an external adaptor and lastly USB interfaced directly to the PSoC 5 with the relevant USB component.


CY8CKIT-059 with External UART Header
CY8CKIT-059 with External UART Header
For UART testing which did not use the Kitprog interface a separate USB to Serial converter from Prolific was utilised. The adaptor was the same type, USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi from Adafruit as used in a previous blog for similar PSoC 4 tests. The TTL connections to the Prolific adaptor, Black wire was connected to 0V, White to pin P1.6 and Green to pin P1.7 of the Cypress Kit.


Prolific USB to TLL Converter
Prolific USB to TLL Converter
For the Kitprog UART connections in PSoC Creator, P12.7 was used for Tx and P12.6 for Rx. Kitprog I2C connections in Creator used P12.1 for SDA and P12.0 for SCL. 

Test Software
As used in a previous blog, a Creator project related to the DS18B20 was used as the bootloadable component for testing. There were some changes moving between the original PSoC 4 based project to the PSoC 5. These changes resulted in a file size change from 20kb to 28kb.

Where possible, the PSoC Creator PSoC 5 example USBFS project had only minimal changes applied. The PLL Clock was adjusted to achieve the best results for the UART clock when PSoC Creator displayed tolerance warnings. 

Reference Download USB
There were no misgivings that a direct USB interface into the PSoC 5 would result in a fast bootloader time - in fact, the result was almost immediate - for such a small bootloadable file!

UART Download
There is a technical document from Cypress regarding the Kitprog hardware bridge communications speeds for the PSoC5 Development Kit. On page 6 of the Kitprog document is a table showing the programming speed limits for the various interfaces, as shown below.


Kitprog User Guide Table 2-3
Kitprog User Guide Table 2-3
Of interest are the maximum speeds for the I2C and UART facilitated by the USB bridge. In the Cypress community forum there is a thread stating that faster communications speeds are possible, however this is not covered by this blog.

It should be noted that the external Prolfic USB to TTL adaptor hardware is capable of data rates far in excess of the 921600 maximum listed in the Cypress Bootloader Host.

Cypress Windows Bootloader Host
For all the download test performed, the Cypress Bootloader Host was used from within PSoC Creator. The other standalone Windows application known as Cypress UART Bootloader application supports baud rates to 115200 only.


Cypress Bootloader Host
Cypress Bootloader Host
Baud Rate Clocks (SCB)
The change to the PLL clock in the Creator project, as shown below, was required for baud rates above 230400 baud. This clock change was implemented due to the warning raised by PSoC Creator relating to clock accuracy.


PSoC Creator Clock Tolerance Warning
PSoC Creator Clock Tolerance Warning

An change to the clock was instigated under the Clock tab in Creator's Design Wide Resources. The PLL Out Clock was reduced from 48Mhz to 44.3MHz when using the UART with the external Prolific adaptor.


PSoC Creator Change to PLL Out Clock
PSoC Creator Change to PLL Out Clock

I2C Configuration
For the Slave I2C, the data rates were changed from 50 to 1000kbps in the PSoC Creator component.


PSoC Creator I2C Component Configuration
PSoC Creator I2C Component Configuration

A corresponding change was made to the Bootloader Host application to match the data rate.


UART Configuration

The UART was configured in the same manner for tests using Kitprog and the Prolific adaptor.


UART SCB Component Configuration
UART SCB Component Configuration
For the Bootloader component the Tx and Rx buffer were configured for 64 bytes as required.

Test Results
Listed below are the test results for the USB, UART and I2C communications.


Cypress Bootloader Download Times for PSoC5
Cypress Bootloader Download Times for PSoC5
A few items should be noted in the above table. Firstly the USB speed is 'constant'. Appropriately the Cypress Bootloader Host application does not display a baud rate option when the PSoC5 USB port is selected. Secondly the Kitprog UART and I2C interfaces operate to 115200 baud and 100,000 khz as detailed by Cypress.

Graphing the results provides a pertinent visual of how much faster the USB interface, shown in blue, is over Kitprog or a standard UART interfaces. The Kitprog I2C interface does deserves an honourable mention as it closer in download times to the USB compared to UART.


Graphed Cypress Bootloader Download Times for USB, I2C and UART
Graphed Cypress Bootloader Download Times for USB, I2C and UART



Code and Project
The code snippet for the Bootloader application as taken from the Cypress USB PSoC 5 example is listed below.

/*******************************************************************************
* File Name: main.c
*
* Version: 3.0
*
* Description:
*  This example project demonstrates the basic operation of the Bootloader and 
*  Bootloadable components when the communication interface is a USB.
*
********************************************************************************
* Copyright 2015, Cypress Semiconductor Corporation. All rights reserved.
* This software is owned by Cypress Semiconductor Corporation and is protected
* by and subject to worldwide patent and copyright laws and treaties.
* Therefore, you may use this software only as provided in the license agreement
* accompanying the software package from which you obtained this software.
* CYPRESS AND ITS SUPPLIERS MAKE NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* WITH REGARD TO THIS SOFTWARE, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT,
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*******************************************************************************/

#include <main.h>


/*******************************************************************************
* Function Name: main
********************************************************************************
*
* Summary:
*  The main function performs the following actions:
*   1. Indicates that the bootloader project is running by turning on the LED.
*   2. Starts the bootloader component and it waits for the application update. 
*      After 10 seconds, the code jumps to the application if it is available. 
*      Otherwise waits forever for application upload.
*
* Parameters:
*  None.
*
* Return:
*  None.
*
*******************************************************************************/
int main()
{
    /* Indicates that the bootloader is running. */
#if (CY_PSOC4)
    RGB_LED_ON_RED;
#else
    TURN_ON_LED4;
#endif /* (CY_PSOC4) */

    /* Enters the bootloader to wait for the application update. */
    Bootloader_Start();

    /* Bootloader_Start() never returns. */
    for (;;)
    {
    }
}


/* [] END OF FILE */
 

Lastly the PSoC 5 project which contains the Bootloader and Bootloadable applications.


Bootloader - Bootloadable Test Application
Bootloader - Bootloadable Test Application