Category Archives: PCB

Supermoto Power Control Module

Since 2010 the Yamaha YZ450F has had electronic fuel injection (EFI). To support the new electrical loads of the bike – more powerful ECU, fuel pump, fuel injector, additional sensors – Yamaha beefed up the stator and added a capacitor to help with start-up transients (this is a battery-less system and still starts first kick!). However, after all of these loads are taken into account, the stator has roughly 50W of additional power available for accessory loads. The two largest loads on a street legal bike are the headlight and radiator fan (with the horn pulling up a close third). Even with a high-efficiency LED headlight the load can be as high as 20W, and a radiator fan (like this one) can draw 24-30W. To overcome these limitations, I decided to design a control unit to:

  • Provide HI/LO functionality for the headlight
  • Control radiator fan speed
  • Automatically dim the headlight when the radiator fan is on

This post details the design process I took to arrive at a functional control unit.

MOSFET Evaluation

While still working on specifications for the final design, I decided to take a detour on a small side project to more closely evaluate MOSFETs and associated driver circuitry. At this point, I hadn’t designed a board to drive any sort of real load, so I was curious about the behavior of the associated electronics. I designed a PCB to evaluate the MOSFET I was considering for the final design (IRFR3806), as well as a MOSFET driver (IRS44273L). I included a BNC connection for the input signal (as I expected to use a function generator to drive it), as well as removable Molex connectors for the supply voltage and drive output, and test points to check the voltages at the input, gate, and drain. I also used an 0805 resistor between the driver output and the MOFSET gate labeled “SLEW” on the silk – I didn’t end up playing with this part, but the idea was I would be able to control how quickly the driver charged the gate by swapping out this resistor for different values.

I happened to be reading the FET chapter in The Art of Electronics while working on this project, so I grabbed a scope shot of the gate voltage:

Always cool to see theory reduced to practice.

The next day I brought my board and fan into work to take advantage of the higher-end equipment I had available. As part of the design I included a current shunt resistor – the Fluke seen in the picture is measuring the voltage across it. With this setup I was able to easily perform a number of tests:

  • Carrier frequency evaluation – because the fan makes a large amount of noise, this frequency could be much lower than the one used for the headlight (I don’t have any pictures of testing that with this board).
  • Duty-cycle to current table

I’ve been spoiled by the MSO4034 at work, makes my TDS320 look a little sad.

Control Module Development

Let’s start with the good stuff, the assembled board:

Assembled! This was a fun one, first board I’ve made with 0402 components.

I ended up switching to a smaller, “lower” power capacity MOSFET for the final design (BSC340N08NS3G). I targeted a rather small enclosure from Digi-Key, in part because I didn’t want some honking enclosure in the headstock and in part because I like a good challenge (and because OSH Park charges $5/in^2, I’m always seeing just how small I can make something). The design is simple, there are two identical output channels and three identical input channels. I used an ATMega168PB, a low-power version of the classic ATMega168A.

Coming soon:

  • Schematics
  • Description of firmware
  • Photos of it working

ThumperFI – Single-Cylinder Motorcycle EFI Controller

What started as a summer project morphed in to today what I like to call ThumperFI – “thumper” from the characteristic sound associated with single-cylinder dirt bikes and “FI” for Fuel Injection. I started the project with the intention of fuel injecting a lawn mower as a sort of in-depth introduction to fuel injection before I started work in the Internal Combustion Engines lab at school. However, the project quickly increased in complexity as my goals became loftier (and I maxed out the inputs to the MyDAQ) until it became a full-fledged system for controlling any single-cylinder engine.

Assembled ThumperFI v1.0 board

Assembled ThumperFI v1.0 board

The system is based around the Atmel ATMega644 8-bit microprocessor. Among it’s many features:

  • On-board serial-to-USB converter (FT232RL)
  • 16kB SPI EEPROM
  • Variable Reluctance CPS (MAX9924)
  • Flyback protected injector output

There are 6 analog inputs to the system, which uses speed-density to calculate airflow. The analog inputs are:

  • Manifold Absolute Pressure (MAP)
  • Intake Air Temperature (IAT)
  • Coolant Temperature (CLT)
  •  Throttle Position (TPS)
  •  Wideband O2 (UEGO)
  • Battery Voltage (BATT)

The firmware is written C and compiled by the AVR-GCC compiler in AVR Studio 6. User configuration and tables (warm-up table, MAP-RPM VE table, etc.) are stored on the external 16kB EEPROM.

The driving force behind this project has been my own desire to learn and grow in both my field of study (mechanical engineering) and other, related fields of study (computer, electrical engineering) as well as learn about engines and controlling them. Since starting this project I have attained experience in:

  • Use of oscilloscope for general measurement and circuit debugging (TDS 320)
  • Use of digital logic analyzer (USBee ZX)
  • Familiarity with engine control sensor use and operation
  • Circuit construction, design and debugging
  • Component selection and sizing
  • Basic engine fuel control algorithms and theory
  • Reading data sheets
  • Microcontrollers and embedded programming
  • Project management and documentation
  • Soldering, both through-hole and SMD (with Weller WES51)
  • PCB layout and assembly

Needless to say, I’ve learned quite a lot – and I’m always learning more each day. Two weeks ago I put the finishing touches on my communication scheme and implementation. Over winter break (2013) I received my PCB from the fab, spent 10 hours soldering it, tested it and only had to make two slight modifications.

PCB Design

Introduction

One theme you might have noticed throughout my project blog posts is that I like to design and assemble PCBs. I’m not saying that I’m a great PCB designer by any means, I still consider myself quite the novice with a lot to learn (especially about higher-speed PCB layout and noise considerations). However, my lack of experience hasn’t stopped me from trying; all said and done I’ve designed six PCBs to date which you can see below.

The six boards I've designed to date

The six boards I’ve designed to date

I started designing boards in the fall of 2013 with ThumperFI v1.0 (far left), a prototype single-cylinder engine controller. After successfully assembling and testing I was amazed what I had built worked – I had designed and assembled a circuit board! From here out I knew that if I needed a board (or just wanted a board) I could make it, or at least try to. My next board was VRSim (center next to ThumperFI), a VR signal simulator that I’m still developing software for. I’ve also found the ability to build boards useful for breakouts, like the RJ45 breakout I detail in another post or the MAX9924 breakout (far right, middle).

Why?

Why not, really. I’ve always been fascinated by circuit boards. As early as 7 or 8 I displayed a stereotypical engineer trait – I liked taking things apart (and not always getting them back together at first…). I remember taking apart my grandparent’s VCR that had broken and just staring at all of the intricate parts inside. I had no idea how it worked but I thought it was pretty cool. I had various run-ins with electronics through my teenage years; I had a BASIC Stamp at one point and even played around with AVRs on a breadboard before school took up most of my time. It wasn’t until sophomore year of college I decided to start pursuing my interest in them again. ThumperFI was that first attempt, a friend convinced me to try to build an EFI controller as a means of learning about fuel injection before working in the engine’s lab at school. Naturally, I decided that building something this complex had to be done from scratch (haha!) and dived in to brushing up on my embedded C and basic AVR breadboard layout. Two years later ThumperFI is still a project I’m working on and has more-or-less been the driving behind the knowledge I’ve gained in hobby electronics.

Where Does Mechanical Engineering Fit In?

I have a pretty strong interest in engines, like a good number of mechanical engineers, and in today’s automotive environment the engines are controlled by embedded controllers. As a mechanical engineer I feel that my understanding of how engines operate is enhanced by my understanding of the underlying electronics, the capabilities and limitations of the control system.

Bench Setup

Like any engineer I enjoy collecting and using tools and my electronics hobby has been no different. I started with a terrible RadioShack soldering iron, a breadboard and a handful of through-hole components and have worked my way up to a bench setup that includes:

  • Weller WES51
  • Tektronix TDS 320
  • Fluke 115 Multimeter
  • TrippLite PR-7b (still looking for a good, reasonably priced variable power supply)
  • Hot-air Rework Station
  • And much more!

Collecting this equipment has taken roughly two years and plenty of research, both online and through discussions with my electrical engineering friends.

Logan's workbench

Logan’s workbench

Ethernet with LEDs Breakout

As I work on various projects I’ve often found I need a breakout for a standard part – a serial port, some SMD IC, etc. – and while such a breakout may exist the price of the part + shipping is either comparable or greater than the price that I can produce and assemble a board. This board is an example of such a case – Sparkfun sells a MagJack ethernet breakout board @ $0.95/piece which is really reasonable; however, that doesn’t include shipping or the jack. I can produce a very similar board for basically the same price shipped, purchase comparable parts from DigiKey and layout/add features to my board for no cost.

I also took this as an opportunity to continue working on standardizing my PCB design project layout and source control. You can find the project on GitHub with the latest files in the release/1.0 folder.

I recently returned to school and was able to assemble and photograph the boards:

Populated and unpopulated version of RJ45 Breakout.

Populated and unpopulated version of RJ45 breakout

The board includes two 1k resistors for the yellow and green LEDs included in the ethernet jack. There are also two solder jumpers so you can optionally connect the ethernet shield to ground. I designed the board to straddler a breadboard for easy prototyping.

RJ45 breakout on a breadboard.

RJ45 breakout on a breadboard

In addition to working on my PCB layout skills, I was able to add a few parts to my custom Eagle library that you can also find on GitHub. I’ve been working on standardizing the parts I use in my designs – text size, outline thickness, footprints, etc.

After testing the board works as expected, the LEDs light up and after connecting two together I confirmed all 8 pins functioned.

If you’re interested in getting this board or your own boards produced, I suggest OSH Park.

Kit photo of the RJ45 breakout

Kit photo of the RJ45 breakout