Pentax IR Trigger

IMG_20170815_203021315_TOPSeveral years ago I was into astrophotography and I ended up building a barn door tracker, or Scotch mount, for use with my camera.  For this to work well I also needed a way to trigger my camera without touching it. My Pentax K-x uses an infrared signal as the shutter trigger for which an IR remote is normally used. For long exposures, my camera allows for an IR signal to open the shutter and another IR signal to close the shutter. My particular remote did not function very well and required me to manually press the buttons. This made consistent timing difficult and was boring. I wanted to automate this process so exposure times would be consistent and so that I could stargaze while my camera clicked away, or sit inside my warm house during a night of winter exposures.

PentaxIR SchematicI designed a small circuit to do this based on an Attiny25 microcontroller. The circuit is very simple consisting of a single AVR, two resistors, two LEDs (one red and one IR), and one tactile switch. Both LEDs are driven by a single pin on the AVR configured for output. The tactile switch is connected to a pin configured as input. The power input is 5v. Not shown in the schematic (but is present in the photograph) is a 5v L78L linear voltage regulator and a couple of ceramic caps. This allows me to power from sources up to 30v though I usually use a 12v UPS battery. Current draw is only 12mA so I don’t care to use a switching mode buck converter.

IMG_20170816_213151530The AVR is configured to run at 8Mhz and I also calibrated the internal oscillator with an oscilloscope to dial in on 8Mhz. A timer interrupt is configured to count each millisecond which the program uses as a clock. The C program is available here. The IR carrier frequency for the Pentax camera is 38kHz. The IR sequence for the shutter is 13ms of carrier frequency, 3ms pause, followed by seven 1ms pulses with 1ms pause between each. I have to admit, I found this sequence in someone else’s program, but it has been so long that the source escapes me.

To operate the IR trigger, the tactile switch is held down to set the exposure time. While the switch is held down the LEDs will flash once a second, each flash indicating one minute of exposure. To kick off the exposure sequence, the tactile switch is pressed for less than one second. After the exposure time has elapsed, the LEDs will flicker to signal the camera to close the shutter.  The exposure sequence will then repeat six seconds later. This six second pause allows the camera to process the previous image before beginning the next. If this delay is too short the camera may miss the shutter signal and become out of sync.

This has worked quite well for my needs allowing me to take many multi-minute exposures with almost no interaction from myself.


Setting exposure time. IR LED slightly visible.
The Milky Way, just below Vega (the bright star at the top). 10 stacked exposures, 4 minutes each. Total exposure time, 40 minutes.

Parts List

  • AVR Attiny25 x 1
  • 8 pin dip socket x 1
  • 220 ohm resistor x 2
  • Red LED x 1
  • IR LED x 1
  • Tactile switch x 1
  • Protoboard

  • L78L x 1
  • Ceramic caps (see L78L datasheet)

How NOT To Use Pushbuttons

Board Layout
ARM Pro Mini Board Layout
ARM Pro Mini Before Reflow
ARM Pro Mini Before Reflow

I decided to try my hand at making a simple ARM Cortex microcontroller board. I based my board on the ARM Pro Mini design. The ARM Pro Mini uses an NXP ARM Cortex M0 chip, and has the nice feature of letting you drag and drop program files on to the chip as a USB mass storage device.

I essentially copied the existing ARM Pro Mini schematic in KiCAD and then started making my own modified board layout. I ended up with a design that I could panelize to fit 8 copies on a SeeedStudio 10cm x 10cm board.

I ordered a set of boards from SeeedStudio, and got a laser cut solder paste stencil from OSH Stencils. I have reflowed a number of boards by just hand applying solder paste, but this design is the first I have attempted to use tiny 0402 sized resistors, and it has a tiny 32 pin QFN chip for the ARM processor. I pasted a board and got to work placing all of the components with tweezers. Time for the moment of truth! I put the populated board in the toaster oven and watched as the solder paste melted into nice shiny solder joints.

The board out of the oven looked really good.

Soldered Board
Soldered Board

I connected a USB cable and plugged the finished board into a computer. Initial signs were good. The power LED lit up, so at least the basic power input was good. Unfortunately, there was no sign of any actual USB device showing up in the operating system. I spent a bit of time troubleshooting the board. I first measured the DC power input voltages at all the pins they should be. I also checked for continuity between various pins to make sure that there were no short circuits between pins on any of the tiny surface mount chips. Everything seemed to be OK, so I spent some time reviewing my circuit design for errors. I double checked the schematic against the original ARM Pro Mini design and ruled out problems there.

While double checking some pinouts in data sheets, I found the problem… According to the datasheet of the pushbutton switches that I used on the board, the two terminals on each long side of the switch are tied together. I had unfortunately drawn the terminal layout in KiCAD rotated 90 degrees, tying the two terminals on each short edge of the switch together. This effectively makes my switches always “pushed” on my board.
PRO TIP:If you generally use any two opposite corners of most pushbutton switches, you can avoid this problem

Switch Pinout
Switch Pinout

How to Fix What You Screw Up
I sat around for a minute annoyed that I have a bunch of boards that won’t work. Then I started to brainstorm ideas for work arounds. I initially thought about some kind of intermediate adapter layer between the board and my switches. Then I came up with an alternate idea. What If I could rotate the switches and solder them on crooked?
I played around with rotating the switch footprint in KiCAD.

Looks like it should work!

Original Switch Layout
Original Switch Layout
Hacked switch layout
Hacked switch layout











I tried to unsolder the switches on my board, but melted them in the process. I got some fresh switches and did an ugly hand solder job to attempt to replace them in the new, slightly tilted orientation.

Switch hack
Switch hack

I gave the new fix a shot by plugging it in to my computer. Success! The board showed up as a new mass storage device and some quick test programs worked just fine.

2015 PaxSpace Ornaments

The 2015 PaxSpace Christmas ornaments are here!

We have scheduled several group build sessions to work on assembling and programming your ornaments. See the sign up link below for information on dates and times.

Click here to sign up for a 2015 PaxSpace ornament kit.


We hope to see everyone at these build sessions and are looking forward to seeing what kind of cool things people can make their ornaments do.

‘Tis The Season To Hack Blinky Ornaments

We’ve been working on developing a PaxSpace Christmas ornament this year.  A bunch of Christmas ball-shaped PCBs have been designed and are on order from  The plan is that once the finished boards arrive, we will hold several workshops at PaxSpace to reflow solder the surface mount components, hand solder the through-hole LEDs and any other peripherals that you might want (such as a speaker, microphone, sensors, more LEDs, etc.), and to program the microcontroller on the board to blink the lights and control whatever you attached to it.

We’re planning to keep the cost of the workshop low, probably about $10 for PaxSpace members, and maybe a bit more for non-members.  This should be a good activity for people of any skill level.  You don’t need to be an electronics or software expert and can just do the parts of the build that you choose.  If you are an expert it will be a good challenge to hack the ornament do something cool.




The ornament will have a PSoC 4 microcontroller, 3 RGB LEDs, space for a bunch of extra LEDs, and some pin headers to attach other random peripherals.  There is space on the board to attach batteries, and a hole at the top to hang it from a Christmas tree.

Keep an eye out for updates on the ornament build workshops!

Altium CircuitMaker

There is a new kid on the block to compete with existing free PCB design software such as Eagle , KiCAD, gEDA, and DesignSpark.

Altium recently opened a public beta of their new free PCB design tool, CircuitMaker. CircuitMaker is a free to use tool that incorporates many of the features of their several thousand dollar professional PCB design software, Altium Designer. Some of the things that set CicruitMaker apart from other free options are:

  • No board limits – Unlike Eagle, there are no limits on board layer count, board size, or quantity of pads and signals (except for likely performance issues past a certain point of complexity)
  • Advanced PCB routing features – CircuitMaker has many of the same interactive routing features as the full Altium Designer software, which let you more easily route signals around obstacles, route differential pair signals, and many other features. See this video for some examples.
  • 3D view – CircuitMaker has a nice 3D preview and the ability to export 3D models as STEP files for use in other 3D CAD software.
  • Community features – CircuitMaker stores your designs in the cloud and allows for CircuitMaker 3Dcollaboration and version control of projects. The parts library is also a shared resource and leveragees existing data from a third party parts database, Ciiva

So, what’s the catch?

  • Windows only – There are no Linux or Mac versions of CircuitMaker
  • Time – Like all software, CircuitMaker requires some learning curve. If you don’t have prior experience with Altium Designer (like me) it takes some reading to get familiar with the workflow and menue locations for creating schematics, netlists, and boards. That being said, I was able to pretty easily work through a quick test project. On the other hand if you do have lots of previous Altium Designer experience, you might get frustrated with some of the differences between hotkey layouts, menue locations, and other user interface differences between Designer and CircuitMaker.
  • Internet Required – A good, active connection to the Internet is required to even USE the software due to the cloud and community features. This means that there is no ability to work offline.
  • The community features – CircuitMaker lets you store 2 projects in a private sandbox and publicly shares the rest of your work in the CircuitMaker online community. This could be an issue if you don’t want to share your work publicly.
  • Cloud Storage – CircuitMaker stores your projects on Altium’s servers. And only on Altium’s servers. There is no way to make a local copy of your work. If at some point Altium decides to stop providing this free software and service you may lose any work you’ve done with CircuitMaker with no way to use if in the future.

CircuitMaker can be a big step up from other free tools. I’d recommend giving it a shot and evaluating whether any of the negative factors are a deal breaker for you. If the software allowed for local storage and backup, CircuitMaker would almost be a no-brainer. Hopefully Altium will offer a free or low cost way to do so to reduce the massive risk of losing all of your work if Altium decides to stop supporting CircuitMaker and its storage cloud.