Thursday, December 5, 2013

Wyolum 3rd annual Innovation Grant - 2013

Are you working on a cool project? Do you want to make $2,000? Share it with the world by open sourcing it and you may win the Wyolum Innovation Grant! Now in its 3rd year!


This is the place to submit your project, find out the rules and deadline, and generally learn more about this generous team of innovators!

Wednesday, December 4, 2013

Eulogy for my Chumby

My beloved Chumby One died today. I first thought to be a software glitch, since the booting seemed to take a long time, then it seemed to re-boot itself after a little while. After a few cold resets, the screen started to literally flash, like the flash of a camera, once every 2 or 3 seconds. Not a good sign. I opened it up, for the first time. Beautiful on the inside too. Regretfully, it does not look like something I could repair.


My Chumby served me faithfully and inspired me (I am not kidding) for the last 4 years or so, mainly as a desk clock . It had all the features I wanted in such a device: fairly sized touch screen, good WiFi, great speaker (bass reflex nonetheless), reasonable radio, rotary encoder for volume (or menu scrolling), backup battery, USB socket, internal SD card for the operating system. In the beginning, the OS allowed for various apps to be downloaded and installed (support was cut after the company went bankrupt). The app-installation process was seamless, comparable with today's Google Play, just earlier. The alarm clock app I used was perfect, with snooze, night dimming, always displaying accurate time (acquired from ntp time server). Other apps I installed showed photos from flickr, displayed RSS streams, played mp3s from USB stick; there was even a piano app that used the touch screen capabilities. Chumby was really a much cheaper alternative to a tablet, with a similarly great potential. Compared to a smart phone, Chumby's only missing feature was the GSM/GPRS, which I bet was considered to be added (since it has a microphone too). I also liked its stable shape, simple design and ease of use (great way to re-connect to the WiFi network too).

I never understood why it did not have a greater success.

Sunday, December 1, 2013

My first impression on Cogwheel Nixie clock

Many months ago I bought, attracted by the clearance price, the PCB for the "Nixie Driver Board Rev A" from "Cogwheel circuit works" store. I was hoping that, with all documentation in place, I would be able to build it on my own, considering it's controlled by an ATmega328 and the software was available, though not the source code.

First thing to note is that the board uses mostly SMDs. If anything went wrong (and there was a high chance, since the PCB was already described as a "mistake the board house made"), the board would become a coaster.

The schematic includes some exotic components, like the HV513 Nixie driver, not offered by digikey. Others are the DS1302 RTC and the optional DS32KHZ oscillator for RTC, which I heard of for the first time. But thanks to the detailed BOM, gathering the components was relatively (some of them are already discontinued, for example) easy.

High voltage for the Nixie tubes is generated by a hardware PWM under software control. So, like the Ice Tube Clock, in order to measure the high voltage and make sure the HV circuitry works, some software must be uploaded onto the processor. I expected the released software to do that. Unfortunately, the highest voltage I saw was under 9V.




After some digging (and learning in the process), I ended up with this simple sketch, adapted from Satashnik Nixie clock, which generates a stable 190V. I know, I was surprised too :)

#include "Arduino.h"

#define DDRHVPUMP  DDRB
#define BV2(a,b) (_BV(a)|_BV(b))
#define BV6(a,b,c,d,e,f) (_BV(a)|_BV(b)|_BV(c)|_BV(d)|_BV(e)|_BV(f))
#define VOLTAGE_WASTE   370                     //!< ~180V
#define VOLTAGE_SAVE    355                     //!< ~170V

volatile uint16_t voltage; 
static volatile uint16_t voltage_setpoint = VOLTAGE_WASTE;
static const uint16_t ocr1a_reload = 60;

void pump_init()
{
    // set fast pwm mode
    // COM1A1:0 = 10, clear oc1a on compare match, set at top
    // COM1B1:0 = 00, normal port operation
    // no FOC
    // WGM11:10 (WGM = Fast PWM, TOP=ICR1: 1110) = 11
    TCCR1A = BV2(COM1A1, WGM11);
    TCCR1B = BV2(WGM13,  WGM12);
    OCR1A = ocr1a_reload; 
    ICR1 = 170;
    TCCR1B |= _BV(CS10); // clk/1 (16MHz)
    DDRHVPUMP |= BV2(1,2);
}

void adc_init()
{
    voltage = 0;
    // PORTA.6 is the feedback input, AREF = AREF pin
    ADMUX = 6;  
    // ADC enable, autotrigger, interrupt enable, prescaler = 111 (divide by 32)
    ADCSRA = BV6(ADEN, ADATE, ADIE, ADPS2, ADPS1, ADPS0); 
    ADCSRA |= _BV(ADSC); 
}

/// Start voltage booster
void voltage_start()
{
    adc_init();
    pump_init();
}

ISR(ADC_vect)
{
    voltage = (voltage + ADC) / 2;
    if (voltage < voltage_setpoint) {
        OCR1A = ocr1a_reload;
    } else {
        OCR1A = 0;
    }
}

void setup()
{
    sei();
    voltage_start();        // start HV generation    
}

void loop()
{
  // clock functionality in here;
}

The next big step is to write the software to drive the tubes and actually show the time, which is essentially re-writing the Cogwheel Nixie clock code (or at least the basic functionality) from scratch. Then open source it. Any help would be appreciated :)

Thursday, November 28, 2013

Black Friday (and beyond) sale

I was going to have a Black Friday sale anyway, but now I have one more reason for it, and it's an embarrassing one: the latest batch of PCBs have a little flaw, but they can be easily fixed. So, until I run out of them, both the Wise Clock 4 kit and the Complete Wise Clock 4 kit will be $10 less, for $57 and $115 respectively. (As always, I also offer discounts for multiple units, just ask.)

The photos below show a few ways to fix it. Basically, the GND terminal of the USB connector is disconnected from the board's ground. The short wire re-connects them again.


The sleekest way would be on the bottom, using a resistor terminal inserted together with the 2x8-pin female header, as shown in the photo below.


Solder the other end together with the 6-pin FTDI connector.

Here is the story of how this happened. The PCB used to be 101.2 mm in length. That was 1.2 mm longer than the 10 cm limit imposed when using Seeedstudio's PCB prototyping service. I never had a problem before, I always got them manufactured like they were 10 cm in length. Now, Seeedstudio decided to enforce the 10 cm limit (or pay up like they were in the next size bracket). I reacted by shrinking the board, cutting 1.2 mm from the right side. It seems that the 1.2 mm side was very important.

There is more, unfortunately: in the process of generating the Gerber files, I even forgot to select the "Top names" for the silkscreen, so now the resistors are not named at all.


When you install the resistors, keep in mind that 3 of them, with values of 4k7, must be positioned in the correct places, as shown in the assembling instructions. (The other resistors are all 10k, soldered stress-free in the remaining resistor places.)

And that's why the board is now essentially free with the kit. If you don't feel confident that you can do it, please ask me to fix it for you. I will solder the little bridge wire and also solder the three 4k7 resistors correctly. You do the rest.

Note: The photo shows the board bare, but the PCB in the kit comes with the SMD components (SD card socket, the DS3231 and the 3V3 regulator) soldered already.

And here is the (latest) schematic, for those interested in details.


Wednesday, November 27, 2013

The ugliest project I've built so far

Based on this photo from BroHogan's gallery of Geiger counters, it was supposed to be a simple encasing using Adafruit's Arduino enclosure. Everything looked neat and clean inside, even with room to spare.
I wanted to use LiPo instead of AAA batteries, to avoid opening and closing the device every so often. This required the use of a LiPo charger, for which I picked the one I already had, the seeedstudio's LiPo Rider.

I spent countless hours trying to put this puzzle together:
  • only 4 places for screws;
  • small(ish) charger board must to be solidly anchored to the case (since an USB cable will be plugged in frequently), yet it does not have any hole for screws;
  • 6 wires (battery, V out, switch) must be soldered to the charger SMD board;
  • 12 wires need to connect the Geiger board to the LCD, on the other half of the case;
  • trim pot suspended somewhere (since there is no room for it on the PCB);
  • power switch to fit in the rectangular opening of the bottom ;

When I thought I figured it out, the two halves of the case wouldn't close because things inside were too tall/thick. Back to the "drawing board". Took out the ATmega328 from the Geiger board (it was touching the LCD connectors, which were already minimized for space), and replaced it with a cheap ($4) "Arduino Nano" (or is it "Mini") from ebay. This also helped immensely with the wiring: instead of connecting 12 wires between the case halves (Atmega328 to LCD), I had to solder only 3 (Vcc, Gnd, Int).



After a few more kludges (e.g. re-positioned the inductor on its side, removed the (over)power(ing) LED on Arduino Nano), I ended up with something , as the saying goes, "only a mother can love".

The lesson I learned from this experience is that, if one wants a seamless, solid, beautiful, project, one needs to either design the board for an enclosure, or the enclosure for a board. Trying to mix and match the board with the enclosure leads, at best, to something ugly.


Did I mention that I worked on it on and off for about 3 months?
The red light in the bottom left corner is the "charging" LED. (And then there is the somehow annoying LCD's backlight, visible through the translucent enclosure.)


The power switch is advertised as being the smallest rocker power switch out there. I only had to file off about 1mm on the upper side of the original rectangular opening to make it fit.

Another lesson I learned: use a transparent enclosure only when the inside looks perfect and you want to show it, and by "perfect" I mean even no visible wires.

Stay tuned for the next version of this Geiger device. (You did not think I would stop here, did you ? :)