Cookie Notice

As far as I know, and as far as I remember, nothing in this page does anything with Cookies.
Showing posts with label hacking. Show all posts
Showing posts with label hacking. Show all posts

2012/12/03

Pinokio, or, Oh my goodness I have to make this


My friend Mark sent me this, and he was right. It's right up my alley. It is the next step from webcam-on-a-swing-arm idea. I really need to start learning how to add servomotors to a lamp and start making this myself.

I love how it's also a call-back to the World's Most Useless Device, except, instead of always turning itself off, it turns itself back on.

2012/11/05

Hacking NTP into an Alarm Clock - Talking Through A Problem

Photo by  Douglas Heriot. Thanks.
In my life, there are very few clocks I rely on, and few of them need me to manually set them. The ones in my computers are connected to the network and use NTP to stay correct. My phone syncs to the phone network, which isn't quite as accurate as NTP, which can cause problems for flashmobs but is within tolerances for my daily life. The clocks with my cable boxes similarly connect outside of themselves to keep correct time.

There are three that I can think of that need manual maintenance: my watch, my car and my alarm clock.

My watch is an analog self-winding Seiko watch and I really don't think it is hackable. I have never really trusted in-car timepieces, so while driving, I'll check my watch or my phone. This leaves my alarm clock.

For me, I don't set the alarm, so that's almost a wash. But I might want to set it up for one. So, an alarm clock has 
  • An LED display
  • A speaker
  • A snooze button
  • Other buttons for different purposes
  • Stuff to be cleared out to make room for my stuff.
It strikes me that, if there was something that could do NTP within the case, the only issue is knowing where it is, and you could use IP Location lookup (like IPLocation.net ) to figure out where you are, and determine time zones from there. That is, if all the smarts are within your alarm clock, which doesn't have to be true.

The snooze button is a switch like any other, so you could easily connect them to whatever electronics project you put together, and we're talking just a few LEDs and four seven-segment displays, so driving the display itself should be easy enough. One alarm clock hack I saw went to 24-hour time rather than learning how to drive the AM/PM light, which is fair enough.

If this ends up being an Arduino project, you could write your alarm to the speaker output yourself, but if you use an MP3 shield or go Raspberry Pi, it would be just as easy to use an audio file for your alarm. And, once you factor in the $80 for a WIFI shield vs the $10-20 or so for one that plugs into your Raspberry Pi, the Pi solution seems less and less overkill.

So, this seems like a doable thing. Is there anything I'm missing?

2012/10/31

What to do with this?

It's pretty simple. There's a magnet and a sensor. If the magnet is away from a sensor, it trips the circuit, turning on the LED. There's three button batteries up in there to light the LED with 3.5 volts or so. All that for a buck from the discount store.

So, let's think.

You can get the 3.5 volt current from the power pin of an Arduino, and sending the signal back to the Arduino rather than to an LED, you now get an "Is it closed?" sensor.

So what? What can we do with that?

I don't really care about what happens with the drawers in my office and I really don't care what happens with the drawers in my bedroom. Same, pretty much, with the doors. I never close my closet door, and really, hooking something to the bathroom door has nothing but creepy uses.

So, what can I do with this? I'm failing at ideas.

2012/08/21

Easy Does It!

As previously blogged, my Stapes Easy button has been turned into a switch and connected to a Teensy. The last issue was getting the code worked out. I now have that code worked out.

And released to Github.

// ========= ========= ========= =========
void setup() {
  // make pin 10 an input and turn on the 
  // pullup resistor so it goes high unless
  // connected to ground:
  pinMode(10, INPUT_PULLUP);
  delay(2000);
  Keyboard.begin() ;
  }

// ========= ========= ========= =========
void loop() {
  if ( digitalRead( 10 ) == LOW ) {
    Keyboard.press( KEY_SCROLL_LOCK ) ;
    Keyboard.releaseAll() ;
    delay(300); 
    Keyboard.press( KEY_SCROLL_LOCK ) ;
    Keyboard.releaseAll() ;
    delay(600); // Delay of 6/10 second to keep from repeating.
    } 
  delay(10);
  }

This was my first serious use of Github for Windows, too. Far easier to handle than the previous stuff I did.

2012/08/20

Easy Like Sunday Morning

Remember my intention to reimplement the Button?

I have my Easy Button torn down, with the speaker out and the circuit bent. You press the button and there is definitely signal going through. I scratched away at the green and soldered in. It works.

On the other side, I have my Teensy, and man, is it teensy. I'm now 93% sure that the micro-B USB cable I've been carrying arround is charge-only, because I couldn't get it to update the code. The code it has on it right now simply kicks out "Hello World" every 5 seconds. The next step, obviously, is to get the Teensy and the easy together, to code it up so that when I hit the button, it kicks out two scroll-lock characters, and to put that code up on Github.

And, to get a nice long micro-B cable.

2012/07/09

Planning My Lamp Project, with Pictures


Have I gone on about my lighting plan? No?

It connects a few of my interests and plans.

  1. I'm starting to become a morning person, which gets a bit hard during the winter, when sunrise is several hours away when I get up. Darkness is important for serotonin is important for sleep, but lightness is important for waking up. But sunlight alarm clocks are both expensive and a single-tasker in my mind. Multitasking might be bad for people's heads, but to my mind (and Alton Brown's) our tools should be multitaskers. 
  2. The Android@Home talk at Google I/O 2011 really inspires me, too.
  3. The key to the sunlight lamp is the fade of it. It strikes me that jarring changes from dark to light would not be as good for waking up well as a gentle increase of light. Like sunrise. 
  4. I'm learning about the Arduino and electronics in general and want to develop those skills more. I'm also a programmer, so these things I build, I'd ultimately want to be able to control via web interface and/or crontab.
  5. I like torchiere lamps, the kind that bounce light off the ceiling, but the one I still have is a halogen lamp, and the problem with halogen lamps is that they get crazy crazy hot, and my current one is either broken or has a burned-out bulb. I'd rather replace it.
  6. The means I know so far to control the dimming of lights is phase width multiplexing, which means turning on the LED for a number of milliseconds and then turning it off for another number of milliseconds to make it seem like it's dim, but you know? There exists an entire industry which involves itself with creating of light from electricity, and I'd rather work with that and involve the greatest amount of industry standard and the smallest possible amount of individual invention.
So, I went searching in Menards on Sunday, and I found a few things. There's a torchiere lamp that's $21 and a wall switch that'll dim CF bulbs for $17. (I'm going to have to live with a lamp with a hacked wall switch on it. I'll live.) The CF is $7, but it'll pay for itself over time. The one-gang outlet box will be < $1. Somehow, I'll have to mount it, but I can dream about that later. I'll need to get two switches, I think. One to make work and one to tear down and connect the Arduino to. That makes it $21 + $17 + $17 + 7, which brings us to ~$60. Before the cost of an Arduino. And I'll have to get a shield

Thing is, I get something like this $7 switch and I won't get the graceful increase or the control, but I get something I know works. Maybe I should think this through some.