Author: scruss

  • Life with Ardweeny

    I’m pretty new to Arduino, and electronics in general. Sure, I used to wire up sensors to a bunch of dataloggers, but there wasn’t much variation or application of theory. I made up a bunch of Ardweenies, mostly to practice soldering skills, but now I’ve made them, I might as well use them.

    ardweeny, breadboard, USB programmer and PSU

    The Ardweeny is a tiny broadboard-only Arduino-compatible microcontroller board. It needs both a power supply and a means of programming it. Solarbotics’ own Breadboard Voltage Regulator Kit provides the juice, while a SparkFun’s FTDI Basic Breakout handles the USB serial programming. The FTDI breakout board can supply power, so I turn the power off to the board at the regulator when programming it. You can’t use shields with the Ardweeny, but it’s small enough that you can have a simple project on a small breadboard. It communicates with the Arduino IDE as if it were a Duemilanove.

    The Ardweeny has pins clearly (if tinily) marked by function. To power it, you need to feed GND and +. The familiar A0-A5 and D0-D13 are present, if not quite where you’d expect them. There isn’t room to mark the digital pins capable of PWM.

    For no particular reason (perhaps that spring finally looks like it might be warming things up around here) I wanted to make a a temperature sensor that would sample the temperature at start up, then warn if the temperature got more than 2°C hotter or colder.

    I used an LM35 as the sensor. These are a bit noisy, so I added some smoothing (nicked, with little grace, from the Arduino – Smoothing tutorial). The temperature is indicated by three LEDs: red for ≥2°C over, amber for within ±2°C of the starting temperature, and green for ≥2°C under. I also wanted all the LEDs lit while the system was working out starting temperature. Here’s how it runs:

    starting up, showing all LEDs
    showing normal temperature
    warmed by a finger, showing ≥2°C over normal
    chilled by a frozen cayenne (!), showing ≥2°C below normal

    I put the LM35 on A0, and the red, amber and green LEDs on D5, D6 & D8. The only reason I didn’t use D7 was that I didn’t have the right length jumper wire. 680Ω resistors are used to limit current through the LEDs.

    Here’s the code:

    /*
     lm35_plusminus - read temperature at startup then light
     leds if over or under
     
     lm35 - analogue 0
     
     red led - digital 5
     amber led - digital 6
     green led - digital 8
     
     scruss - 2011-02-17
     */
    
    #define REDPIN 5
    #define AMBERPIN 6
    #define GREENPIN 8
    #define TEMPPIN 0 // analogue
    #define DELTA 2.0 // amount +/- from start to warn
    #define READINGS 15
    
    //declare variables
    float tempC, start_temp, array[READINGS], total;
    int val, i;
    
    void setup()
    {
      pinMode(REDPIN, OUTPUT);
      pinMode(AMBERPIN, OUTPUT);
      pinMode(GREENPIN, OUTPUT);
    
      // signal start of test by lighting all LEDs
      digitalWrite(REDPIN, HIGH);
      digitalWrite(AMBERPIN, HIGH);
      digitalWrite(GREENPIN, HIGH);
    
      // read initial values
      for (i=0; i< READINGS; i++) {
        delay(500/READINGS); // just so initialization is visible
        val = analogRead(TEMPPIN);
        array[i] =  (5.0 * (float) val * 100.0)/1024.0;
        total += array[i];
      }
      start_temp = total / READINGS;
    
      // test off, lights off
      digitalWrite(REDPIN, LOW);
      digitalWrite(AMBERPIN, LOW);
      digitalWrite(GREENPIN, LOW);
      i=0; // just to initialize  
    }
    
    void loop()
    {
      // some cheapo smoothing copied from the Smoothing example 
      //  in the playground
      total -= array[i];
      val = analogRead(TEMPPIN);
      tempC = (5.0 * (float) val * 100.0)/1024.0;
      array[i] = tempC;
      total += tempC;
      i++;
      if (i>=READINGS) {
        i=0;
      }
      tempC = total/READINGS;
      if (tempC - start_temp >= DELTA) {
        // we're hot !
        digitalWrite(REDPIN, HIGH);
        digitalWrite(AMBERPIN, LOW);
        digitalWrite(GREENPIN, LOW);
      }
      else if (tempC - start_temp <= -DELTA) {
        // we're cold !
        digitalWrite(REDPIN, LOW);
        digitalWrite(AMBERPIN, LOW);
        digitalWrite(GREENPIN, HIGH);
      }
      else {
        // we're just right !
        digitalWrite(REDPIN, LOW);
        digitalWrite(AMBERPIN, HIGH);
        digitalWrite(GREENPIN, LOW);
      }
    }
    

    Despite the smoothing, the LEDs flicker briefly as they turn on. I kind of like the effect, so I made no attempt to change it.

    What I like about Arduino is that — within the limits of my sensor knowledge — the programming language does what I expect. The above program worked first time; worked, that is, save for me putting one LED in the wrong way round, so it didn’t light. I know I could probably replicate the same function with a few linear devices and other components, but it would take much more time and effort. It may not be the most elegant, but it does work,  and gives me the satisfaction of the desired result quickly.

  • the white details on a white background are a bit hard to make out …

    A house down the road does these very intricate snow sculptures:

  • Emily’s castle cake


    Emilys castle cake

    Originally uploaded by Emilymadeawish

    My sister-in-law makes very nice cakes.

  • this week, I have been mostly solderin’ …

    … several Solarbotics Ardweenys. They are extremely tiny Arduino clones designed for the breadboard.

  • now *that’s* more like it …

    After bumping along at about 600Kbps for the last few weeks, Bell (through TekSavvy) finally kicked my connection over to 3 megabit. I don’t think we’ve ever managed this speed before, as I think I’ve been routed to a different exchange. Whee!

    Update: Yowza! Looks like I’ve been upped to as close to the 5M that I can get …

  • big trouble in little microSD

    It was a bit of a fight to get the SparkFun microSD Shield working. At first, I thought it was my choice of cards. Then, on reading the manual (ahem), I discovered the section “I downloaded a FAT library for Arduino on my own from the Web but it’s not working! Why not?“. It seems that the SparkFun shield uses non-standard pins for signalling, which they consider a feature, but some consider a bug.

    After fixing the code in the awesome sdfatlib library, I’ve now got it logging the temperature of a cooling container of hot water:

    You might just be able to make out the LM35 pressed up against the measuring cup.

    I remember making a right mess of this experiment in my school final Physics practical exam. I also used to do this in my first job when bored testing Campbell CR10 dataloggers, making a nice 1-d cooling curve with a thermocouple and a cup of hot water.

    I think the heating came on a couple of times, as there shouldn’t be bumps in the curve. Here’s the data.

  • four decades of xedit

    I realize that I first started using X11‘s xedit in 1989. I’ve moved on a bit from editing ANSYS source scripts, but that means I’ve used it in the 80s, 90s, 00s and 10s.

  • you say homage, I say ripoff

    Can you tell the difference?

    (awesome sleuthing by fegmaniax)

  • it looks like Scotland’s sneezing …

    I think that IfItWereMyHome.com needs to work on its tracing of the UK.

    (via)

  • This is not how it’s done …

    YouTube – How To Fold A Brompton.

    (via)

    I miss my Brompton … not that I rode it much latterly.

  • just look at this moose stamp

    Just look at it:

    No, really look at it:

    I DON’T THINK YOU’RE LOOKING AT IT PROPERLY …


  • goin’ up to eleven for twenty ten

    This is the music that powered the year for me:

    • Bertrand Belin — Hypernuit: heard this on the radio. He has an awesome voice. Seeing as it’s all in French, I have no idea what it’s about, but that’s okay.
    • Calvin, don’t Jump! — Under Bridges: Kirk Pleasant’s first major outing from his Canadian location. Combines E6 ambient and skronk with some thoughtful songwriting.
    • Colleen and Paul — Colleen and Paul: happy, sunny, folky, lovely. Enjoy it before it becomes car ads.
    • Dum Dum Girls — I Will Be: Motown meets The Jesus & Mary Chain, with screamy lofi fuzz. Like Strawberry Switchblade (DDG are big fans) with maximal noise.
    • Entertainment For The Braindead — Roadkill: Julia did a banjo album! It’s great — and free!
    • Frightened Rabbit — The Winter of Mixed Drinks: juddery Scottish gloriousness with full miserability ahead.
    • Jónsi — Go: this album’s so sunny it farts marigolds.
    • Peter Stampfel & Baby Gramps — Outertainment: dementedly demented, with demented bits gleefully stuck to it. Gramps sings like Popeye’s ancestor, and Peter’s got the caterwauling yawp down pat. They’re having so much fun making this, they don’t care what you think.
    • The Ruby Suns — Fight Softly: don’t you dare call them Animal Collective Lite. They can dance better, for one thing.
    • Stereo Total — Baby Ouh!: “irritating” is not usually a word one associates with a favourite album, but Stereo Total are completely annoying. I love them for it.
    • Sufjan Stevens — The Age of Adz: this is a hard album to like. I was about to completely give up on it when I played it on a long subway ride home. I’m sold. Charming, but difficult.

    Here’s six not from 2010 that also helped make the year:

    • Brett Dennen — Brett Dennen (2005): he’s got a weird little voice in his first album, but Don’t Forget is as catchy as anything.
    • Charlotte Gainsbourg — IRM (2009): it’s a Beck album! Not sung by Beck!!
    • Kyle Creed — Liberty (1977): this is the clawhammer album. Kyle played such a clean banjo; e-v-e-r-y note’s in the right place, the volume’s right, he doesn’t dominate (bluegrass pickers, take note). So brilliant, and finally available on something other than cassette.
    • Major Organ And The Adding Machine — Major Organ and the Adding Machine (re-release): squee! An expanded version of 2001’s mad outing complete with the movie. Spot all your favourite E6 musicians!
    • Raymond Scott — Soothing Sounds For Baby (1963): The first volume (designated for one to six months) is about my level. I’d have been tripping spheroids if this had been playing near my crib.
    • The Turtles — The Turtles Present The Battle of the Bands (1968): a delightful confection of phenomenal songwriting and playing making a very silly concept album. You’d hardly believe it was all done by one band.

    Podcast: scruss-best_of_2010 [mp3]

  • lolcobol

    The bloke standing behind the console looks like he’s working an iPhone – in 1959!

    (actually, it might just be a cigarette; see the open pack of Luckies by Grace Murray Hopper’s right elbow.)

    Image nicked from the NMAH | COBOL – COBOL online exhibit.

  • The Cleland rides again!

    Geoff Apps dropped a comment in an earlier post to say that he’s updated the Aventura for the 21st century. I’m going to have a hard time justifying not buying this bike.

    I wonder what the good people of MetaFilter will think?

  • just hope I didn’t get a wee girl’s christmas present by mistake

    This arrived today:

    A bright pink EMUS soprano ukulele from Empire Music. I’m confused — not merely because I’ve never known Canada Post to deliver on a Sunday, but:

    • I haven’t ordered from Empire since 2007
    • I have a ukulele already
    • I’m relatively unlikely to have ordered a pink one.

    It actually plays quite well — but where did it come from?

  • 2010 contenders

    Dammit, is it really December? Anyway, this is what I listened to this year:

    • Albemarle Ramblers — Gentleman from Virginia
    • Amanda Palmer — Amanda Palmer Performs The Popular Hits Of Radiohead On Her Magical Ukulele
    • The Apples in stereo — Travellers in Space and Time
    • Arcade Fire — The Suburbs
    • Bart Veerman — Some o’ Mine and Some I Like (2003)
    • Basia Bulat — Heart Of My Own
    • Belle & Sebastian — Write About Love
    • Ben Veneer — Ben Veneer
    • Bertrand Belin — Hypernuit
    • Bill Holt — Dreamies (1973)
    • Brett Dennen — Brett Dennen (2005)
    • Brian Wilson — Brian Wilson Reimagines Gershwin
    • Broken Social Scene — Forgiveness Rock Record
    • Calvin, Don’t Jump! — Under Bridges
    • Caribou — Swim
    • Carolina Chocolate Drops — Genuine Negro Jig
    • Charlotte Gainsbourg — IRM (2009)
    • Chris Coole & Ivan Rosenberg — Farewell Trion
    • Colleen and Paul — Colleen and Paul
    • The Corin Tucker Band — 1,000 Years
    • Dan Jones — Dan Jones and The Squids:Live 09
    • Dan Jones & Peter Wilde — My Name Is John Smith
    • The Delgados — The Great Eastern (2000)
    • Dum Dum Girls — I Will Be
    • Eels — End Times
    • Eels — Tomorrow Morning
    • Elf Power — Elf Power
    • Entertainment For The Braindead — Roadkill
    • Final Fantasy — Heartland
    • Forest City Lovers — Carriage
    • Friendly Rich and the Lollipop People — The Sacred Prune Of Remembrance
    • Frightened Rabbit — The Winter of Mixed Drinks
    • Frontier Ruckus — Deadmalls and Nightfalls
    • Germans — Elf Shot Lame Witch (2008)
    • Goldfrapp — Head First
    • Gonja Sufi — A Sufi And A Killer
    • The Good Right Arm Stringband — The Good Right Arm Stringband
    • High Places — High Places vs. Mankind
    • Hold Your Horses! — 70 Million
    • The Hungry Moment — Phantom 45
    • Hurray for the Riff Raff — Young Blood Blues
    • James Blackshaw — All Is Falling
    • Joanna Newsom — Have One On Me
    • Jónsi — Go
    • Kyle Creed — Liberty (1977)
    • Ladies of the Canyon — Haunted Woman
    • M.I.A. — Maya
    • Macy Gray — The Sellout
    • Major Organ And The Adding Machine — Major Organ and the Adding Machine (re-release)
    • MGMT — Congratulations
    • Miles Kurosky — The Desert of Shallow Effects
    • Mojave 3 — Ask Me Tomorrow (1995)
    • Nana Grizol — “Ruth”
    • Nesey Gallons — Southern Winter by Smouldering Porches
    • The New Pornographers — Together
    • of Montreal — False Priest
    • Old Man Luedecke — My Hands Are On Fire and Other Love Songs
    • The Open Letters — Bicycle EP
    • Peter Stampfel & Baby Gramps — Outertainment
    • Peter Stampfel & Zöe Stampfel — Ass in the Air
    • Pocahaunted — Make It Real
    • Princess Pangolin — Princess Pangolin
    • Raymond Scott — Soothing Sounds For Baby (1963)
    • Robyn Hitchcock — Propellor Time
    • The Ruby Suns — Fight Softly
    • Smoosh — Withershins
    • Someone Still Loves You Boris Yeltsin — Let It Sway
    • Stereo Total — Baby Ouh!
    • Suckers — Wild Smile
    • Sufjan Stevens — All Delighted People EP
    • Sufjan Stevens — The Age of Adz
    • Sunbear — Moonbath
    • The Superions — the Superions
    • The Tallest Man On Earth — The Wild Hunt
    • Tune-Yards — Bird-Brains (2009)
    • The Turtles — The Turtles Present The Battle of the Bands (1968)
    • Vampire Weekend — Contra

    Must be getting old; two of the albums (Bertrand Belin and Brett Dennen) I bought because I heard tracks on the radio. Consequently, I predict Lawrence Welk in my best of 2011.