Gas station without pumps

2017 August 6

Beacon detector board

I’m planning to sit in on CMPE 118/L (Mechatronics) this fall, and so I started looking over some of the material for the course from previous years.  One exercise involved designing a “beacon detector” that signals when it sees an infrared signal modulated with a 2kHz square wave. The exercise calls for an all-analog solution (phototransistor, transimpedance amplifier, active filter, rectifier, peak detector, …), which I plan to do when the time comes, but I got intrigued by the idea of doing an almost purely digital design.  That was the motivation for the Goertzel filter blog post.

I decided to take the digital design further and make a beacon detector that not only detects the 2kHz IR beacon, but also indicates what direction it is in.  To do this, I wanted 8 phototransistors around a circle, with one every 45°.  One can get a crude estimate of the angle from just which detector gets the strongest signal, but with wide-angle sensors one should be able to get finer estimates by looking at the ratio of the signals from two adjacent channels.

Because I was deliberately going for minimal analog design as an exercise, I used just a phototransistor and a pullup resistor for each channel, and a Teensy LC board for all the processing.  I chose SFH325FA side-look phototransistors, because they provide a nice, cubical package that I thought would make them easier to align.  They are surface-mount components, but with a 2.54mm pitch for the two terminals, they aren’t much harder to solder than through-hole parts.

For testing, I soldered one of the SFH325FA phototransistors to a pair of male header pins. This allowed me to experiment with different pullup resistor sizes in different lighting conditions and at different distances from an IR emitter.

My experimentation with different pullup resistors indicated that I could not operate in full sunlight, no matter what size pullup resistor I used—when the pullup was small enough that the phototransistor had sufficient voltage across it in full sunlight, the signal from the IR beacon was too small to be useful.  With AC-coupled amplifiers, I could have made it work, but I was committed to nearly pure digital solution.  If I had sunlight nearby, but the phototransistor itself was shaded, then I could go up to 22kΩ for the pullup without problems. The limiting factor was then that a very close beacon could saturate the detector, making it hard to determine power ratios.  I ended up choosing 22kΩ as my pullup, as I wanted to detect beacons from up to 2m away.

With a 22kΩ pullup and a strong signal, I can get a very clean “shark’s fin” waveform, because of the capacitance of the phototransistor acting with the resistor as a low-pass filter.  This low-pass filtering helps remove aliasing artifacts from the sampling by the analog-to-digital filter.

Behind each phototransistor I placed an LED, to indicate which channel had the maximum signal.  I charlieplexed the LEDs, so that I needed only 4 I/O pins for the 8 LEDs (I could encode up to 12 LEDs with 4 charlieplex wires). I used WP710A10SGC green LEDs for the indicators, because I had a lot of them around, but it would have been better to use an amber LED with a wide-angle, diffuse case, as the green indicators are only clearly visible over a fairly narrow angle.  The current-limiting resistors I used would keep the current low enough even with a low-forward-voltage red LED.

I also added an RGB LED to indicate the overall state—I used a common-anode one, because my son had a lot of them with diffuse cases, which are best for an indicator that needs to be seen from any angle.  The RGB LEDs were part of an unidentified lot from China, so I don’t have a part number or specs for them.  I hooked them up to PWM pins, so that I could adjust the brightness and color as needed.

I also designed in a connector for SPI connection, so that the board could be used a slave peripheral of another microcontroller.  I used Eagle on my old laptop to design the PCB (I know that in Need to find new PC board software and PCB CAD tools I said that I would be trying to switch to KiCAD or Diptrace, but I was lazy and stuck with what I already knew how to use).

I sent the design to Seeedstudio to make the PCB—like many of the Chinese firms that cater to hobbyists, they had a sale in July of boards up to 10cm×10cm for only $5.  Of course, it cost me another $21 for shipping with DHL, because I was too impatient to wait for Chinese air mail (and not trusting enough of the reliability). I chose Seeedstudio because they had the best user interface to their design-rule check, and at least as good pricing as anyone else.

The boards arrived quite quickly—only 8 days from order to delivery. Here is what they look like:

The back of the board has some documentation to remind me what is connected where.

The front of the board has relatively little documentation.

The boards are 8cm×8cm, fitting comfortably within both the cheap manufacturing limit and the Eagle free-version size limit.  I made them this big so that the Teensy LC board would fit without interfering with mounting holes (for M2 and M3 screws) and a central hole for attaching the board to a servo arm.

Getting a good right angle for the surface-mount phototransistors took some practice:

My first solder joint for the SFH325FA phototransistor tilted the transistor substantially, because the solder underneath formed a wedge. I reworked it a couple of times and finally got something sort of acceptable.

By the fifth phototransistor, I had worked out a technique that seemed to hold the phototransistor cleanly at a right angle. There is probably not much solder underneath the phototransistor, but the large wedge behind the phototransistor should provide sufficient mechanical strength.

Here are pictures of the populated board:

The back of the board does not look very different after being populated. I put one M3 screw in the bottom M3 screw hole, in order to see how compatible the screw hole design is with the screw head.

The top of the board, when populated shows how close channels 0 and 7 come to the Teensy board.

Here the board is on (powered through the USB cable), detecting an IR beacon about a meter away in the direction of channel 4. The green LED by the channel indicates the direction, and the green RGB LED indicates a strong signal.

I put the header pins on the pullup resistors, so that I could record the signal seen by the analog-to-digital converters.  Unfortunately, the signal is much noisier than I expected:

The large spikes are at 15kHz, and probably correspond to noise injected by the ADC sampling.

I turned off the beacon and looked just at the noise spikes, using the 10× probe on the oscilloscope to get better bandwidth.  I sampled at 100MHz and averaged 1000 traces to get a clean view of the signal (the triggering was set far enough from the background level that only fairly large spikes were captured, but close enough that the 1000 frames were gathered as quickly as possible).

The pulses are very short (2–3 µs), so almost certainly correspond to the charging of the sampling capacitor. After looking at this waveform, I changed my sample time on the ADC to 2µs (it had been 1µs) to reduce the noise in what the ADC reports.

This post has gotten more than long enough, though I still have a couple of things that should be added: a schematic diagram of the board and a plot of the reported angle vs actual angle.

The schematics from Eagle are really ugly, so I’ve been thinking about redrawing them with SchemeIt—perhaps that can be a subsequent post.

The reported angle vs. actual angle plot is going to require building a jig that allow me to set the angle precisely.  I tried jury-rigging something out of Lego today, but the result had too much slop—the board could not be reliably set level with the IR emitter at a fixed angle.  The OED-EL-1L2 5mm IR emitter does fit in the middle hole of a Lego Technic brick, so I using Lego to align the IR emitter was attractive. I may have to make something out of wood and MDF (medium-density fiberboard) for a more solid test jig.  The M3 screw holes will allow me to attach the board firmly to MDF with standoffs, and I can drill holes in Lego bricks to make a stand for the IR emitter.



2017 May 30

Need to find new PC board software

Filed under: Uncategorized — gasstationwithoutpumps @ 21:54
Tags: , , , ,

I need to find an learn some new PC-board layout software.  For several years I’ve been using Eagle, a reasonably decent program from Cadsoft that was free (in a crippled version) for hobbyists and reasonably cheap for small-scale commercial use.  Apparently the program (or the company) was bought by Autodesk, and the newest version requires that you login with an Autodesk account every time you use it.  Furthermore, the upgrades now come by subscription, not purchase.

I am not willing to log in to a web-based account every time I use my PC-board layout tool (even though I do that for my schematic capture for non-PC-board schematics—I think I understand how Digi-Key monetizes Scheme-It, and I’m comfortable with it).

So I’m now looking for new software to use for PC board design.  Open-source would be nice, but only if the user interface is not horribly clunky (as so many open-source projects are, such as Gimp and Inkscape, both of which I’ve used, but am not fond of). Free, or very cheap, are important to me, as I mostly do PC board design as a hobby, and I’d like to encourage students to use the tools I use, which is not compatible with expensive software (such as the Cadence suite that UCSC pays for).

The main programs I’ve heard of other than Eagle are DipTrace and KiCAD, and I’d like to hear reviews from users of them.  Last I heard, KiCAD was both clunky and woefully incomplete, but that was some time ago, so things may be different nowP.  I know of one student who likes DipTrace, but I’m slightly worried that they’ll go the route of Eagle, raising barriers to easy use. Other suggestions would be welcome, as would updated information on the strengths and weaknesses of the different programs.

I don’t want programs that tie me to a particular manufacturer of PC boards, as I’d like to be able to take advantage of cheap prices (like Elecrow’s new offer of 5 10cm×10cm boards for $4.90).

Anyone out there with suggestions or experience?

2016 May 5

PCB CAD tools

Filed under: Uncategorized — gasstationwithoutpumps @ 20:58
Tags: , , , ,

I’ve been using Eagle for designing printed circuit boards for a few years now, and I am reasonably happy with it as a free tool. However, I’m a little annoyed by the low quality of the schematics and by the awkward creation of new footprints for components, and so I am willing to consider other tools, and am looking for recommendations for free PCB tools that are better than Eagle.

Two I’ve heard of (but not tried yet) are

  • EasyEDA , which is web-based, and
  • DipTrace, which (like Eagle) is a commercial package with a free, but limited, hobbyist version.

I’ve not used either of these yet, and I don’t have any PCB designs to do right now (nor time to do them until the quarter ends), but I’m curious whether any of my readers have tried EasyEDA or DipTrace, particularly if they can compare them with Eagle.  I’m also curious whether there are other PCB tools out there that run under both Mac OS X and Linux and that are free, easy to use, and robust.

My son and I are planning a couple of boards this summer as part of the LED theater lights project, so there will be an opportunity then to try out different PCB tools, if anyone has ones to recommend.

2014 December 12

Roaring start for Kickstarter campaign

Filed under: Uncategorized — gasstationwithoutpumps @ 22:26
Tags: , , , ,

In a previous post, I talked about my son’s company Futuristic Lights being about to launch their Kickstarter campaign.  Well they launched it at noon today (, and within an hour they had made their $20,000 goal. According to the comments on their Facebook page, they made their goal within 15 minutes (probably not a Kickstarter record, but a real achievement nonetheless).

As I write this post, they have pledges of $34,511 from 203 backers after only 10 hours, with a corresponding commitment to make and ship 642 regular Kinetic boards and 1264 limited-edition boards.  This easily takes them over the 1000-unit price point for parts and assembly (the assembly is the same for both the regular and the limited-edition boards, as the differences are in the firmware and the appearance of the board). With 29.5 days still to go, they’ll probably go way over that.

I wonder if they’ll get enough orders to make 10,000 boards (which is probably the next price point for manufacturing). Given the usual Kickstarter project trends, they are unlikely to make 5 times their first-day sales, unless the Kickstarter staff decide to feature them (making one’s goal in 15 minutes is good advertising for Kickstarter!) or they get some other lucky press coverage.

If they do get enough backers to make 10,000 boards, they may have to rethink their plans for fulfillment, as what I had overheard of their planning may not scale up that high.  Still, the drop in manufacturing costs may let them afford to use a commercial fulfillment company.

I’m planning to order a set, but I’ve not decided whether to get a limited edition set or a regular set. Probably I’ll wait until later in the campaign, and get a limited-edition set only if they haven’t sold out of them—no sense depriving some glover who might really care about the limited edition.

I’m also wondering what I’ll do with the set when I get it, since I’ve no real need for gloving lights other than as a proud parent to say “My son designed these!”  At least, they should make good presents—but for whom?

The company has put together a fine web page for the Kickstarter with lots of demo videos and pictures of the boards.  The founders (Zohar and Abe) can be seen in the intro video at the top of the page.  Zohar is the CEO, the originator of the idea for the company, and the main force behind the marketing effort. Abe is the CTO (chief technical officer) and the engineer for both the hardware and software.

I’m very impressed by what this team of young entrepreneurs has accomplished—even if the project had failed to make its goals,  the amount my son has learned about engineering, manufacturing, and business management is far more than most kids get in 4 years of college (and he’s only 1/12 of the way through college at this point).  I just hope that this early success doesn’t distract him too much from college.

Update 2014 Dec 13:  Abe and Zohar wrote an article about the company that was published in Santa Cruz Tech Beat: Glowing Art Form – What’s Glove Got To Do With It.

2014 November 29

Futuristic Lights close to their Kickstarter launch

Filed under: Uncategorized — gasstationwithoutpumps @ 00:05
Tags: , , , ,

My son has been working hard at school, but perhaps not as much on school work as on his start-up company, Futuristic Lights. It was just over a year ago that I was writing about My son’s first PC board, and I talked more about what his company was doing about 6 months ago, when they participated in TechRaising 2014. During that year he has designed, written software for, and tested 4 PC boards: 1 through-hole and 3 with surface-mount components (not counting a test fixture and a tiny board for connecting LEDs to cables).

His most recent design (the “Kinetic”) is going to be a real product—they are starting a Kickstarter campaign soon (they want to start it before Christmas, though they probably won’t be able to ship product until March). They just got 100 prototypes delivered from their manufacturer last week, and they are pleased with how well they came out.

The Futuristic Lights Facebook page has demo videos of the new board, but does not currently show a picture of the board itself (they do have some nice shots of the previous prototype, which has the same functionality, but needed some redesign for durability and fitting in the cases).

I don’t know how big their goal will be for the Kickstarter campaign, but I think that they need to make at least 1000 of the Kinetic boards to get a low enough price on the manufacturing (the 100 prototypes cost almost as much per board as the retail price for the finished ones, but a lot of the costs drop dramatically at 1000 units, and some of the tooling costs were already paid to make the prototypes).

They’re currently working mainly on their marketing efforts (they’ve got 6.8k likes on their Facebook page, but I’ve no idea how many people are following them closely).  If they sell the lights in sets of 10 (one per finger), they’ll need to sell around 100 sets, which is a conversion rate of sales at 1.5% of likes, which seems high to me.  They’ll need to get a lot more people interested once the Kickstarter campaign starts, so they are gearing up for that.  I believe that they’ll be releasing new demo videos and some more technical videos that describe the features of the Kinetic boards over the next couple of weeks—you can follow the progress on their Facebook page.

My son, as Chief Technical Officer, is not a major part of the media campaign, but he’ll have to start lining up suppliers and manufacturers and figuring out lead times for the actual manufacturing.  The 100 prototypes took less than a month from ordering to delivery of assembled boards, but getting sourcing the parts for a small batch run may take longer, as Digi-Key and Mouser don’t always stock that many of all the parts they need—they may need to contact some of the chip makers directly.  They also need to get the cases, batteries, gloves, and custom boxes for shipping the sets.

This project has been a marvelous educational experience for my son—something that would be hard to duplicate at any university, as student projects rarely get past the prototyping stage into small batch manufacturing and fulfillment.


Next Page »

Blog at

%d bloggers like this: