Blog

  • A little home sense

    It felt good to have a soldering iron back in my hand. Felt right. I’m in the process of channeling a new obsession into an old hobby. The latter is electronics design. The former is home maintenance and environmental awareness.

    When we first moved in, it became apparent we had a minor microbial problem. It turns out that mold likes two things: moisture and warmth. We were also beset by a series of issues with the forced hot air system. Furnace cleanliness, closed ducts, and (as by brother was keen to point out) an open window were all contributing to a serious temperature difference between upstairs and downstairs.

    So, I started thinking about ways to quantify these problems and more actively monitor my surroundings. I cooked up a nifty microcontroller project. Have an Arduino receive sensor information from a series of wireless nodes scattered throughout the house. The nodes would be equipped with temperature and humidity sensors. I wound up buying a Wicked Device transmitter node/receiver shield pair from MakerSHED.  The kits come as an empty board and loose components.  A little solder work, and we’re ready to write some code.

    Wireless sensor pair, post-soldering

     

    Arduino with its lovely new shield

    There are two software components required immediately: the microcontroller code to manage receiving the wireless data and forwarding it out through USB, and a daemon running on a PC to intercept and log it.

    As a test run, I left one in the bathroom while (and after) I took a hot shower. I didn’t timestamp the data, but the node transmitted a packet every ten seconds. Some packets seem to get dropped, but that should give a rough idea about time elapsed. I’m also just too lazy to convert the data into actual degrees or percentages, thus no labels on the axes. This is all relative.  Statistics faux pas, I know.

    Showering with SCIENCE!

    I left the fan running and the door closed during and after. The point where the shower ended is pretty obvious, but I’m rather surprised at how long it took for the conditions to get back to normal. Towards the end, I opened the door, causing the quick equalization at the tail of the graph.

    Eventually I may push the results into a database and add more sensor nodes. Maybe even a web frontend to view the house’s current conditions in a visual manner, or graphically inspect logs.  Of course, that will require more soldering.  Bring it on.

  • Comparing Controls: Part 1

     

    The debate among gamers between analog control sticks and the classic mouse/keyboard conversation has been raging for decades. I’ve been kicking around the ideas behind this post for a while, and my recent foray into Mechwarrior Online has rekindled my interest in putting this idea out there. Let’s look at the mathematics of the these control systems as a means of addressing their relative pros and cons.

    The mouse is a simple rodent. It controls the cursor position, directly. Moving the mouse ‘x’ distance will result in a proportional cursor displacement.

     

    Let’s take a look at how moving the mouse back and forth over one dimension translates to cursor movement over time.

    Pretty simple triangular wave.

    Now let’s look at analog sticks, or joysticks. Joysticks are a bit more complicated. In most applications, the joystick doesn’t directly control position. It controls the derivative of position (in other words, cursor speed). Move the joystick a little, and the cursor moves slowly. Push it farther, and the cursor moves faster.

    Let’s do the same graph as above, where a user is moving the joystick back and forth from its resting position. Note that this is all hand-waving and not mathematically precise (or even properly scaled).

    Note the curvature of the cursor position. Because we’re only controlling the derivative, the actual position will be a continuous function. Therein lies the primary difference between a mouse and a joystick: a cursor driven by a mouse can be move in a discontinuous fashion (think jagged edges), but a cursor driven by a joystick will always need to form smooth curves.

    Truth be told, this paints analog sticks in a pretty grim light. But we’re making a couple of assumptions that might not be true for all games:

    1. that the joystick always controls the derivative of cursor position
    2. that the mouse movement is directly mapped and not limited.

    There are mechanics available which can turn both assumptions on their heads and level the playing field a bit. We’re also leaving out a critical portion of the mouse-and-keyboard setup: the keyboard. We’ll look at both of these factors in the next post.