Sunday, 18 October 2015

Beta Layout Reflow Controller with Sunbeam BT2600 Mini Bake and Grill for Reflow Soldering

Summary
While designing a prototype circuit for an LED torch it became apparent that many of the white LED controllers were surface mount leadless devices. Many of these devices have exposed pads meaning that standard soldering with an iron can be difficult.

It is possible to solder smaller devices with exposed pads by directly applying the heat beneath the device through thermal vias in the PCB, or use the oven in the household kitchen to reflow, however neither of these are ideal solutions.

Reflow Controller
Beta Layout have for some time sold a Reflow Controller. This controller (Version2) has been reviewed with the Severin oven which Beta Layout provides however there are no reviews for ovens available locally in Australia. 


Beta Layout V2 Reflow Controller
Beta Layout V2 Reflow Controller

At the time of writing the Beta Layout controller sold for €119 plus shipping. There are a number of kits and Arduino style solutions on the web although for an off the shelf solution this was worth trying the controller with a locally available oven to determine suitability for home reflow soldering.


Reflow Oven
The only factor determining the oven to choose was the maximum load of the reflow controller which, for the version two model, is 1500W.

Searching the local market results in a grill from Sunbeam BT2600 with elements top and bottom. The oven retails from the GoodGuys for just under $60 AUD.


Sunbeam BT2600 Oven
Sunbeam BT2600 Oven

Noteworthy Items
It should be noted that as the controller is European made the associated mains plug and socket suit the European market. No option to order an Australian plug to female IEC plug or male IEC to Australian socket.

Oven and Reflow Controller Learn Cycle
Beta Layout's controller is for the most part plug and go. On the hardware side there is the main AC power, oven AC power and the thermocouple. 

A learning cycle must be completed before the controller can be used. The thermocouple can readily be lashed to a dummy PCB (spare leaded components or enamelled copper wire) and placed in the most central position inside the oven.


Sunbeam BT2600 Oven Inside
Sunbeam BT2600 Oven Inside

With the door down the upper and lower heating elements are easily visible. On the front control panel the oven is switched to 240C and the timer set to OFF.

The dummy PCB is placed in the middle of the oven, door closed, power ON and the learning process is ready to start.

Test PCB for Learning Cycle
Test PCB for Learning Cycle

Once the learning button is pressed the oven comes to the required temperature and then the oven switches off. Subsequently it should be noted that the oven was left running standalone, in the garage, for an additional 10 min to reduce some of the VOCs. Time for a test board.

Test Board and Oven Temperature Profile
For the reflow tests the same PCB is used. A few resistor pad pairs are cleaned with flux, solder paste added and surface mount resistors applied. To apply the solder paste without a stencil, a syringe with a 0.5mm needle allows a relatively clean and controlled application of the paste.

With the PCB placed in the middle of the oven, the door is closed and the solder button is pressed on the controller. The thermocouple was left attached to the test PCB.

Beta Layout Controller - Preheat Stage
Beta Layout Controller - Preheat Stage

Several minutes later the reflow process has completed and the oven has cooled down sufficiently that the PCB can be checked.

Test PCB after Reflow
Test PCB after Reflow

Inspecting the PCB, all joints to the resistors are clean and the component alignment is good - not faultless. Changes to the profile may help eliminate some bubbling on the joints.

Before operating the oven again the RS232 port on the controller is connected to a laptop and a standard terminal program, TeraTerm. Using the controllers interface the automatic temperature measurements were configured to be output at 5 second intervals. A number of cycles were run across the day as the ambient temperature increased.

Below are the graphed profiles of the oven with some minor variation in the starting ambient temperature.

Reflow Oven Temperature Profile
Reflow Oven Temperature Profile

Several subsequent tests using the oven yielded repeatable reflow results with similar sized PCB's. Reducing the oven thermostat from 240C to 210C made little difference to the results however reducing the thermostat to 190C caused issues with proper wetting and should be avoided.

Shortly after the reflow cycle was complete the door of the oven was opened and a thermal image taken. Some of the heat has already escaped from the opening of the door.

BT2600 thermal image shortly after reflow
BT2600 thermal image shortly after reflow

The temperature profile used by the controller can be manually configured through the serial interface using a terminal program. 

In summary this combination of controller and oven is a valuable addition to the prototyping hardware setup which can yield excellent results for the home hobbyist.

Friday, 4 September 2015

Wireless remote controlled rocket launcher with Atmel ATMega328 for Arduino - Version 2

Summary
This is the second version of the Rocket Launcher project. This includes improvements for safety, a microcontroller upgrade and additional features. With the maker community now so large this design will be based on the Arduino with custom hardware.


Improvement Summary
To improve the launcher design some items were considered.
  1. Reverse Battery Protection
    P
    revent false launches when a engine is fitted and the battery is wired in reverse
  2. Igniter Connected
    L
    oad (igniter) sense addition to show if the igniter is still connected
  3. Low Battery A defined threshold and indicator showing the low battery condition
  4. Alternative Transmitter and ReceiverAllow an alternative to the communications hardware
  5. Improve User InterfaceAllow for interfacing to an LCD to provide more information and control
  6. Upgraded MicroLarger microcontroller for the additional features listed above
Change Summary
Starting with the new Atmel microcontroller each of the improvements will be reviewed.
  1. MicrocontrollerThe Atmel ATMega328P is featured prominently in Arduino designs and is a well established micro. This device lacks some of the features newer devices offer such USB interfacing on the 32U4, however it is also half the price
    ATMega328P (TQFP Footprint)
    ATMega328P (TQFP Footprint)
  2. Reverse Battery ProtectionA high current diode with a low forward voltage (Schottky) added to the circuit to prevent reverse battery issues
  3. Igniter Active
    Detection of the battery voltage on the the MOSFET drain to indicate that an igniter is connected, analog to digital (AD) conversion
  4. User InterfaceLCD header integrated into the next circuit board with buttons for control and feedback
  5. Alternative Transmitter and Receiver
    Multiple footprints for receiver hardware on the circuit board
  6. Low Battery
    The Sealed Lead Acid (SLA) battery will be monitored with a Zener diode dropper with a resistor divider
  7. Data Logging
    With all the new metrics being gathered it makes sense to add an SD card
Design Notes
Aside from the new micro some additional buffering will be added to protect against ESD and other forms of damage.

Part Selection
Up next the alternative transmitter and receiver, then handling the level translation for the SD card... 

Saturday, 8 August 2015

Arlec 19 LED Lantern Torch upgrade with brighter LED's (45 lumen)

Summary
This blog illustrates one possible upgrade to the Arlec 19 LED lantern torch with the aim of upgrading the LED's, using a white LED driver to make the light output more consistent as the battery voltage decreases and extracting more life from the 6V lantern battery if possible.


Arlec LED Torch
Arlec LED Torch

Sections in this blog:
  1. Reason For Upgrade
  2. Lantern Battery
  3. LED Circuit
  4. Benchmark
  5. Upgrading The Design
  6. Selecting New Components
  7. Schematic Design
  8. PCB Design
  9. Populated PCB
  10. Comparison New and Old
  11. Downloads

Reason For Upgrade
There is a noticeable difference in the light intensity between this Arlec model and my older single bulb style Eveready Dolphin. The LED torch does the job for illuminating items close up, certainly no complaints there. When the Arlec was initially purchased the light output was more than acceptable with the 6V battery giving it's all. After sporadic use over a few months the light intensity simply dropped off. Time to investigate why and if this can be remedied.


Lantern Battery
When the torch was purchased it is supplied with an Arlec 6V Lantern Battery. The Arlec battery follows the standard 6V 11Ah design and is comprised internally of 4 separate F size batteries. The Eveready Super Heavy Duty 6V Lantern battery datasheet can be used as a comparison as Arlec don't appear to publish a datasheet.


Eveready Super Heavy Duty 6V Lantern Battery Discharge Curve
Eveready Super Heavy Duty 6V Lantern Battery Discharge Curve

Assuming a total LED current of 100mA and a constant current discharge, by using the discharge curve for a 3V cut off the torch will operate for almost 100 hours. This does not match up to the tens of hours the torch actually lasted for.

Over the expected 100 hours of operation, including self-discharge, the battery voltage will gradually decrease, meaning that depending on the circuit design the life of the torch will be somewhat less. To determine how much less it's time to look at the existing circuit and the battery together.


Battery Open Circuit Voltages
Firstly is the battery itself. This is comprised of four series F size batteries which can be considered flat at 0.8V under load (industry standard). This gives a terminal voltage of 3.2V.

For a known flat 6V lantern battery the unloaded terminal voltage is 5.67V. Looks great unloaded right. Connecting the LED circuit board the battery terminal voltage drops of 2.55V almost immediately then continues to drop at a rate of 0.1V every five or so seconds, this is too flat to be useable. Again removing the load and the battery recovers to 5.5V.

LED Circuit
The LED's themselves, the current driven through the LED and importantly the forward voltage drop of the LED itself.

Unscrewing the torch allows the back of the circuit board to be seen. The circuit board, shown below, can be removed from the front housing by unscrewing four screws.

From a quick visual inspection there appears to be two LED strings across the battery (after the ON switch). Two 33R resistors limit the current to two separate LED strings, one with 9 LED's and the other with 10 LED's. For each string of LED's all devices are connected in parallel.


Arlec LED Torch PCB
Arlec LED Torch PCB


Benchmark
To gather some metrics the LED board was powered from a benchtop power supply.

With a 6V output from the power supply the terminal voltage at the rear of the circuit board was 5.975V.

Arlec Active LED Torch PCB
Active LED Torch PCB

The power supply displayed 0.193A and the first string with 9 LED's in parallel had 2.86V forward voltage the second string with 10 LED's had a forward voltage of 2.83V.
Arlec PCB on Power supply
Arlec PCB on Power supply

When the power supply voltage is slowly reduced from 6V the light intensity appears just useable to 4.5V however reduced further to 3.5V this barely lights a small room.

Upgrading The Design
There are a few upgrades that can be made to the design.
  1. LED Driver: For the battery voltage between 4.5V and the discharged battery voltage of 3.2V there is some capacity left in the cells.
    In order to use this capacity the LED's must be driven in a different manner that is not using resistors, or at least resistors that are very small in value or keep losses to a minimum.

    One of the common methods for driving white LED's is by using a constant current source. There are a number of benefits by using a constant current design of which a relatively constant drive to the LED's can produce a more consistent light output over the range of the battery voltage when compared to using simply resistors.
  2. LED Type: In the discrete LED market the big player names of CREE and Nichia will sound familiar to those in the field. There are other tier LED manufacturers such as Optek, Line-On and Everlight to name a few.
    Certainly it would be surprising if the LED's used for the torch were CREE. Regardless it does not hurt to look for an LED with a better specification.
  3. LED Viewing Angle: Be it from me to suggest that a torch should resemble a spotlight in light pattern, on the other hand why waste light on objects you are not looking at. To that effect, selecting an LED with a narrow viewing angle of 15 degrees will be more effective as a torch instead of using an LED with a 120 degree viewing angle.
  4. Other Smarts: There are other designs online for torch retrofits with LED's with pulse width modulation, low battery cut out or using a single higher power LED device.
    Although pulsed LED's do have a higher efficiency when used with higher currents the low steady current used by torch would negate this gain. Again testing is the best way to validate this so a separate adjustable timer can be added to the design.
Selecting New Components
The constant current design for the LED's could be achieved with some discrete components and to solve the LED drive issue when the battery voltage drops, a boost converter can be used. This comes at a cost to the remaining battery capacity and no boost converter is perfect in the conversion.

Rather than build this design using discrete components a dedicated LED driver with a boost converter can be used with a handful of external parts. Chip manufacturers such as Texas Instruments (TI), Linear Technology and Micrel all have ready to solder solutions which will suit this application.


LED Driver
To select the new LED driver from the hundreds of devices found on Digikey, Mouser, Element14, RS Components and more it pays to detail a list of requirements which can be used to focus the search.
For this design the driver should have: 

  1. Input voltage range of 3V to 7V
  2. Capacity to drive a number of white LED's in series (string). This relates to the output voltage that can be generated by the boost converter
  3. Switching current to drive a number of strings, 3 in this design, at a current of 20mA per string
  4. Price, current consumption of the actual LED driver and flatness of the LED driver efficiency against the actual battery voltage are other factors to also keep in mind
EDIT
The TPS61160 was initially selected and tested, however due to the LED string design in this circuit, the operation was unstable. A more expensive device was chosen which was the LT1618EMS. Essentially the white LED driver design shown in the datasheet was used with a change to the 2.49R resistor used for current limiting.


LT1618 Datasheet Circuit Example (Courtesy Linear Technology)
LT1618 Datasheet Circuit Example (Courtesy Linear Technology)

White LED
Sorting through supplier's websites, component suppliers and blogs can be somewhat daunting. One novel site that summarised the essentials of LED's can be found on Gizmology
The Gizmology website contains a section on luminous intensity, which is the standard measurement for low power discrete LED's, and the conversion to luminous flux which was one of the factors used to select a replacement LED for this design.

Below is a sample of some of the comparisons made:
  1. Everlight, Part# 334-15/F1C2-1VWA, Angle 20 degrees, 14625mcd typical
  2. Cree, Part# C512A-WNN-CZ0B0151, Angle 25 degrees, 15850mcd typical
  3. Marl (Nichia), Part# NSPW500DS, Angle 20 degrees, 27000mcd typical
  4. Cree, Part# C503D-WAN-CCBEB151, Angle 15 degrees, 35000mcd typical
Glancing at the list item 4, Cree C503D, looks like the device to choose surely. However using an online calculator the luminous flux was calculated for beam angles giving a different result:
  1. Everlight, Angle 20 degrees, 14625mcd, 1.396 lumen
  2. Cree, Angle 25 degrees, 15850mcd, 2.360 lumen
  3. Marl, Angle 20 degrees, 27000mcd, 2.577 lumen
  4. Cree, Angle 15 degrees, 35000mcd, 1.88 lumen
No surprise that the Marl device, which was also the most expensive by 7 times compared to its closest rival, also has the highest luminous flux.

Now a twist in the selection criteria was the ranking or binning system used by most LED manufacturers. This sorts LED's by a number of physical characteristics. For the Marl (Nichia) device, which appeared to be a V ranked part, the minimum luminous intensity shows 22000mcd and maximum 31000mcd.

Listing the minimum luminous intensity and corresponding flux:

  1. Everlight, Angle 20 degrees, 11250mcd min, 1.074 lumen
  2. Cree, Angle 25 degrees, 8200mcd min, 1.221 lumen
  3. Marl, Angle 20 degrees, 22000mcd min, 2.099 lumen
  4. Cree, Angle 15 degrees, 16800mcd min, 0.903 lumen

For the limited budget of one dollar, the CREE C512A series was a cost effective option. Plenty of surface mount white LED's would outperform this thru hole LED. The usage of surface mount is a different circuit board technology (Al-Core).

The C512A CREE LED had a standard 3.2V forward voltage at a current of 20mA. Instead of retaining the 19 LED design the number of LED's was reduced to a even 18 such that split strings were able to be used. With these details the boost converter components were calculated.


Schematic Design
Added to the white LED driver design in an optional PWM circuit. It could be interesting to map out LED brightness against continuous current.


Updated LED Circuit with LT1618
Updated LED Circuit with LT1618

A low power 555 timer is wired in an astable configuration with some additional diodes to give a wider control over the PWM operational range. Either a pot or resistor is fitted between the discharge and trigger pins allowing the PWM to be manually adjusted or permanently set.


PCB Design
Before beginning the PCB layout the size of the board, mounting holes and LED positions are measured from the existing Arlec design.


PCB Mechanical Properties
PCB Mechanical Properties

The four mounting holes were measured, albeit rather crudely with a steel ruler and the corresponding middle LED position used to determine a radius for the outer two rings of LED's. On the PCB this detail was added to one of the mechanical layers. Individual LED positions were added as small crosses to aid in component placement.

Next the bulb connection is added and LED's which are placed at a 45 degree angles to simplify the routing.

PCB LED Placement
PCB LED Placement

A top layer fill was added to provide mechanical stability and routing for the LED driver.


PCB Top Layer Route
PCB Top Layer Route

PCB Bottom Layer Route
PCB Bottom Layer Route


Shown below is the board viewed from the front in 3D.

PCB 3D Front View
PCB 3D Front View

The rear of the PCB fully loaded with the white LED controller, optional timer and bulb mount to suit the existing torch hardware. There is a single wire connection from the tip of the bulb to a through hole pad connection on the board.

PCB Final Route in 3D
PCB Final Route in 3D

After a final component placement, board clearance and PCB design rule check the PCB is sent off to 3PCB for manufacture.

Populated PCB
Below is the populated PCB mounted on the reflector.


Populated PCB Front View (mounted on reflector)
Populated PCB Front View (mounted on reflector)


Populated PCB Rear View (mounted on reflector)
Populated PCB Rear View (mounted on reflector)

Comparison New and Old
Without having a Lux meter to compare, both boards were directed at a wall with a 1m between the boards, 1m away from the wall, with no other light sources. The reflector was not fitted to either board and the result is easily visible.

Comparison Improved and Original Boards (without reflector)
Comparison Improved and Original Boards (without reflector)

Fittingly the new board also draws less current at 6V, 160mA compared to the older board drawing 195mA. This is a saving of almost 18% although as the battery voltage drops the current drawn by the LED driver continues to increase.



Comparison Original and Improved Boards (current consumption)
Comparison Original and Improved Boards (current consumption)

The LED driver will run down to 2.6V on the bench power supply while drawing 700mA although at this time the lantern battery is probably well and truly dead!

Downloads
Schematic Rev D
Altium PCB File
Top Layer as DXF
Bottom Layer as DXF

Thursday, 11 June 2015

Wireless remote controlled rocket launcher with Atmel and Arduino/Atmel source

Summary
The focus of this blog is to redesign a circa 1999 remote controlled model rocket launcher. While updating the controller design the main capability of remote launching will be retained since this is a handy feature for those capturing rocket launches on camera or video.

Throughout the blog the steps of the design are documented with screen captures along the way.

History
A garage door style remote, two button key chain transmitter, and receiver module were used for the remote control section. The receiver unit had a dedicated decoder, AX5885, which was monitored by a Motorola microcontroller (Freescale), 68HC705J1, which had the most difficult tasks of timing a buzzer and driving a MOSFET. A sealed lead acid battery provided the amps to fire the igniters (Estes parts preferred).


Original Rocket Launcher PCB circa 1999
Original Rocket Launcher PCB circa 1999

Evolution
Knowing that a quick replacement was required, with say an Arduino, the design was to take a three step approach.
  1. Produce a new test board with an Atmel micro and code in Atmel Studio. This would mean the rocket launches could continue within weeks! PCB Zone aka Circuit Labs have a quick turnaround on boards meaning the bare circuit board usually takes a week
  2. Following on from the first design would be an update with new features and some much needed safety
  3. Lastly ensure the design is friendly enough for those starting out with devices such as Arduino. This would mean porting the existing code.
Remote Control Selection
The first redesign of the launcher was always going to be a reprint of the original 1999 board with 2015 parts to return the launcher to operation. In saying that, addition a status LED for debugging and putting an on-board connector for the receiver antenna would be the only intended additions.

Beginning with the remote control, SparkFun had an ideal unit - RF Shield however the corresponding remote was out of stock, nothing at LittleBird either. So fallback was to the garage style remotes. The local supplier, Oatley Electronics, imports a 433MHz UHF 4 channel remote and with the transmitter and receiver on special, it was worth a try. Provision can be made in a later design for other receivers such as those from SparkFun or KitStop since the Oatley parts are many times the price.

What's in a Micro
There was no preference when looking for a replacement microcontroller. As other Australian bloggers such as Dave Jones from the EEVBlog tend to suggest, picking a device or hardware, having a play and making mistakes is a excellent way to learn.

For this redesign an 8 pin Atmel micro was selected to replace the previous controller. The Atmel parts are low power (uA) devices, have a stable enough internal oscillator for this task and are small enough to setup by an enthusiast.


ATtiny pinouts

Selecting a Atmel micro can appear baffling considering the many devices available on the Atmel website, however when the requirement to have Arduino support, this narrows the field drastically. Leah Buechley of High Low Tech has a page on her site dedicated to the ATtiny45 and 85 and its use with the Arduino platform. With an online community already then this micro is a perfect choice.

Basic Circuit Design
First up is the board operating voltage and associated regulator. There are a plethora of options here from linear to buck style switching regulators which would provide the 5V DC required for the board. A lower voltage was not a option based on the receiver selected, although the Taiwanese manufacturer, AutoMicro Technology, does state the receiver operates at 3V. Since there are a number of 5V low drop out linear regulators on the shelf, surface mount, an ON Semi linear regulator will be used.

Since the micro is using the internal oscillator there is no need to select an external crystal or similar device, however the micro will be kept as a DIP package to allow for off board programming.

Switching MOSFET's
This leaves the drive devices for the buzzer and igniters. Separate MOSFET's will be used to run the buzzer and igniter. 

Searching Digikey and Element14 for a small MOSFET signal device there are plenty to choose from. Main requirements to drive the buzzer, continuous drain current 50mA and the drain source voltage better than 30V. A device that is a surface mount (SOT23 style) is chosen which will easily run the buzzer and be used in another project.

Selecting a replacement for the original IRF540 follows the same process that was used for the smaller MOSFET with the added parameter of ON resistance. That is the MOSFET's drain to source resistance, for a specified gate to source voltage. 
The original part with a 25A drain current, had an ON resistance of 26milliohms. With newer technology, surface mount and less than three dollars this device can be upgraded to a IRFR7540 which has an ON resistance of 4milliohms. This device handles 90A for a drain to source of 60V, complete overkill or is it! 

Why the High Current MOSFET?
According to the ESTES data sheets, the resistance of the igniter is approximately 0.8 ohms (measured 0.7 ohms on Estes igniters). Since a sealed lead acid battery is being used and we can assume the battery is near 100% charged before use, this gives a voltage of about 12.6V DC. Applying Ohms law, 12.6V/0.8R gives almost 16 Amps. In reality there are additional system resistances due to cable cross section, terminals fittings, battery, MOSFET ON resistances and other factors that would reduce this value.

In addition it should be noted that the current mentioned above is steady state and this resistance does vary for other manufacturers igniters meaning the inrush current could certainly be higher. So choosing a MOSFET with the lowest ON resistance together with lowering the total system resistance presents the igniter with the ability to ignite correctly.

Schematic Drafting Package
From KiCad to Altium Designer there are CAD packages to suit the needs of most individuals. Additionally there are now web based community PCB tools from Altium such as Circuit Maker. These fill the gap between the novice and the experienced designer as well as providing valuable community support. This design will stay with the Altium flavour for that sole reason.

Schematic Drafting
This design will require a single A3 page due to its simplicity. This may be a sticklers mentality but A3 is the suggested industry page size however not a hard and fast rule.

Searching Digikey for an ATtiny85 (ATtiny45 would do the job also) throws up over fifty results. Narrowing the search to DIP reduced the results to two. At the time of checking, one device with a speed of 10MHz and the other 20MHz, the faster device was cheaper. So the ATtiny85-20PU can be added to the centre of the schematic straight from the Atmel libraries. In addition a small decoupling capacitor is added to the supply rail of the micro.

To make life a little easier for those who prefer to solder the micro directly into the board, rather than using a socket, an in-circuit programming header is included. Using the In System Programming (ISP) pinouts and then mapping these to the micro with net labels allows the programming header to be moved around the schematic easily, no fixed wiring. A pullup resistor is added to the reset line of the micro although the ATtiny can be configured to operate without this pin.


ATtiny Processor Connections
ATtiny Processor Connections

Next is the linear regulator which is protected from reverse power with a single diode. Again, for this design not too many bolts and braces. To avoid the loss in the diode a 15V, or higher voltage rated, Transorb and resettable fuse combination could have been used.
Linear Regulator Connections
Linear Regulator Connections

Additionally the V_BAT supply rail that will provide power to the MOSFET's is not reverse polarity protected. This is a must for the revised board, a few other blogs describe the reason - false ignition. Some of the usual fixes for this problem are to use a high current relay or an arming switch.

RX3302D Receiver Connections
RX3302D Receiver Connections

The receiver unit (RX3302) can be connected in a number of configurations, either using the receiver data output or the four digital outputs that correspond to the buttons on the remote control. The latter will suffice for this project.

A pushbutton and LED are connected to the Learn Acknowledge (LA) pin allowing replacement remotes to be programmed by holding down the pushbutton for a few seconds. The LED is switched OFF by the receiver itself when learning mode is completed or the active learning time expires.

The two output MOSFET sections look identical on the schematics, one device for driving the buzzer and the second for the igniter. On the updated design the output section will be modified to include protection and load monitoring. The addition of load monitoring is helpful for instances when there is no ignition and the rocket engine must be inspected.


MOSFET Output Devices
MOSFET Output Devices

Adding an LED for basic debugging and the schematic can be rule checked then annotated by the software.

Rocket Schematic
Rocket Schematic

PCB Drafting
The Printed Circuit Board (PCB) can be laid out without any size constraints although the smaller the board area, means usually lower the cost. Most PCB suppliers offer options to collate other people's boards to reduce costs. 

Rocket PCB (two layer)
Rocket PCB (two layer)


Rocket PCB in 3D
Rocket PCB in 3D

The PCB is laid out with the vertical receiver board running down one section of the launcher board, processor in the middle and connectors with high power switching on the opposite section of the board. 

On the reverse side of the board are the optional LED's, receiver learning push button and the receiver antenna connector. After a Design Rule Check (DRC) the PCB is ready to send for manufacture.

The PCB was produced with a black solder mask as shown below. In addition the design is also Open Source Hardware.

Manufactured Rocket PCB
Manufactured Rocket PCB

PCB Population
On complex PCB's it is common to populate the power supply section, verify its operation, then populate specific sections of the circuit. With such as small board the entire population is completed in one sitting.

After population of the components and cleaning of the solder flux the board is given a brief visual examination. Compared to the usual lighter colour green solder mask, the black makes inspection of the board a touch more difficult. 

Populated Rocket PCB
Populated Rocket PCB

With the PCB loaded there are some power up checks and voltage levels to confirm.

Power Up
Powering the populated launcher board for the first time, the power supply is set to 12V with a current limit 50mA. The current limit is deliberately set to 50mA in the event there are any problems with the board.

Power Up Test of Rocket PCB
Power Up Test of Rocket PCB

The current reading on the power supply of 12mA is acceptable and a check of the 5V linear regulator output voltage shows 5.001V, so the board looks in order and programming can begin.

As a matter of interest the power supply voltage was lowered until the regulator dropped out of regulation. The regulator drop off was at 6.3V as shown on the supply.

Atmel Studio
For the initial coding of the launcher a basic state based scheme will be used. Ideally a task based solution would be implemented, possibly in the next board iteration when some smarts are added to the board.

Using the circuit as a reference for connections to the ATtiny micro, the physical inputs and outputs can be defined with some meaningful labels in the code. Hash defines or constants are used to make the code more understandable, examples for both shown below.

Software IO Definitions in Atmel Studio
Software IO Definitions in Atmel Studio

For the ATtiny clock the internal oscillator will be used at a speed of 8Mhz divided by 8 using the internal divider. To determine the fuse configuration it's over to the datasheet or open Atmel Studio, connect to the ATtiny using a device such as a JTAGICE3. Using the Device Programming window under the Tools menu the config can be verified before adding the fuse values into the code. Hands down this is far easier than accidentally disabling the serial programming through an incorrect setting and having to resort to other methods such as high voltage programming to restore the ATtiny.

Atmel Studio Fuse Configuration
Atmel Studio Fuse Configuration

The fuses can be defined in code to make programming a little simpler. Values for the fuse settings are implemented directly as shown in the fuse configuration above.

Atmel Studio Software Fuse Setup
Atmel Studio Software Fuse Setup

Control of the outputs is made through a basic state machine of sorts. This has three states:

Software State Machine Values
Software State Machine Values

There is a single port on the ATtiny, port B 0 to 5. The appropriate bit operators are used with the logical shift to firstly set the state of outputs to zero, OFF. Next the data direction, DDRB, is configured to change default inputs to outputs.

Port Setup in Atmel Studio
Port Setup in Atmel Studio

Even though the data direction register defaults pins to inputs the launch and cancel signals to the ATiny from the remote transmitter are configured as inputs. 

Similarly the one second buzzer on startup at the end of the setup routine is not required but is a good indication the system is running.  

The state machine is a simple routine that waits for the Launch button press, turns on a buzzer for a set period, 10 seconds, and during that period checks for the Cancel button signal. At the end of the set the launch output, igniter, is activated for a set period, 2 seconds.

State Machine Routine in Atmel Studio
State Machine Routine in Atmel Studio

Improvements for the above routine in the next board revision would include mapping at least the Cancel button to an interrupt and using timers instead of a wasteful delay. [EDIT] Correction in image above, turning the buzzer off (PORTB &= ~Buzzer) moved.[EDIT]

Finally is the slim mainline that calls the port setup and then continuously executes the state control routine.

Mainline in Atmel Studio
Mainline in Atmel Studio

With the JTAGICE3 connected to the Launcher PCB, Atmel Studio code compiled and the ATtiny can be programmed.

Output Window in Atmel Studio
Output Window in Atmel Studio 

Two items of note are the program and data usage of the Atmel Studio build, 3.7% of program and 0.8% of data memory. This will be used for comparison against the Arduino build. Before proceeding with porting the Atmel Studio code to operate with Arduino some testing.


Testing
Operational testing is just confirm that the code behaves itself and when buttons are pressed the correct outputs turn ON. Everything checks out fine so it's time to perform some load test on the igniter output.

Initially with a small load of 100R and the power supply on 12V with a 3A current limit the output measures a little under 12V DC with the multimeter.

Connecting up 10R resistor to the igniter output and load testing shows that the MOSFET is not conducting fully. A meagre 0.25mA is measured by the power supply when the igniter output switch on whereas close to 1.2A is expected.

Connecting the CRO to the gate of the MOSFET during a load test the gate to source voltage (Vgs) is measured. The Vgs is around 3.6V which is above the minimum Vgs turn on threshold but not above the maximum of 3.7V. A quick change of the gate pull-down from 100k to 1M yields almost 5V during tests.


Capture - MOSFET Turn ON
Capture - MOSFET Turn ON

The image above shows the gate voltage on the yellow trace and the MOSFET drain to ground (GND). Note the upper horizontal cursor on the yellow trace shows the threshold Vgs(th) for the gate.

As final confirmation of output timing, the bottom image shows the MOSFET gate voltage on the yellow trace and drain to GND on the green trace, whilst the igniter output is activated.


Capture - Igniter Output Timing
 Capture - Igniter Output Timing

Operationally the launcher is working, now how about finally porting this to Arduino!

Arduino Port
First up the ATtiny must be added to the Arduino software. With the built-in Board Manager this is straightforward, see High-Low Tech page for details.

Next up the loading the boot-loader onto the ATtiny85 from Arduino can take some massaging of the USB drivers. After installing the Arduino software and following the steps on High-Low Tech there were still some issues with the AVRSIP mkII being recognised. The Arduino forums have some suggestions and following one thread that suggests a replacement driver, libusb-win32-bin-1.2.6.0.zip, from http://sourceforge.net/projects/libusb-win32 which worked perfectly.

Using the Arduino Burn Bootloader command the ATtiny is furnished with the boot-loader software.

After creating a new sketch the existing C from Atmel can be copied into Arduino. This will not compile as is so some minor changes are required. 

Starting with the includes from Atmel Studio, these are deleted from the Arduino sketch.

Arduino IO
Again here no preference for port IO naming. Arduino offers a convention which is port name then number, eg PB0, as defined in the Pins header file for the ATtiny.

Arduino IO Definitions
Arduino IO Definitions

The states machine and program variables remain unchanged.

Arduino State Machine Values
Arduino State Machine Values

In the Setup routine, same function name is kept, some of the statements are changed to use the Arduino direction and output types.

Arduino Port Setup
Arduino Port Setup

For the Atmel Studio project bit manipulation of the port and direction registers was implemented for setup, however Arduino adds another level of ease to this process using Digital writes and Pin modes, as shown above. Similarly the delay routine is renamed to simply delay.

Arduino Main Loop

The Arduino loop can be considered the equivalent of main for the Atmel Studio project. This main function only needs to be renamed to loop in this instance.

Lastly is the launch control where the bulk of the changes must be made.

Arduino State Machine
Arduino State Machine

The function name and variables remain unchanged for the state machine however the reads of the port pins use the Arduino digitalRead function and writes digitalWrite.

For comparison purposes, of memory usage, the ATtiny flash memory has been programmed with the Atmel Studio build and then downloaded as a HEX file for Atmel Studio. The Arduino software was used to burn the bootloader into the ATtiny and then the Arduino sketch was uploaded. By comparing the two HEX files it is easy to see the overhead that the Arduino platform. In the next release of the launcher a comparison without the bootloader will be made.

Up next some photos of the launcher as soon as the weather breaks...

Improvements
To improve the launcher design some of the following items will be considered for the second revision:
  1. Reverse Battery Protection: To prevent false launches when a MOSFET is used, when a engine is fitted and the battery is wired in reverse a high current diode with a low forward voltage will be added to the circuit
  2. Igniter Connected: In cases where the launch was cancelled or simply did not happen a load sense addition will be made to the circuit to show if the igniter is still connected
  3. Low Battery: A solution using a standalone comparator and LED can indicate that the battery has dropped below a defined threshold
  4. Alternative Transmitter and Receiver: Allow an alternative to the communications hardware used
  5. Improve User Interface: Allow for interfacing to an LCD to provide more information and control. Will require a new microcontroller for the additional features.
Design of the next revision in the Revision 2 post.

Downloads for the Project

Schematic
PCB Altium Viewer/Designer
Atmel Studio Project
Arduino Sketch
Atmel Studio Hex File
Arduino Hex file