Sunday, 10 June 2012

Simple Digital On Off Cycler V1-A30m in Beta

On my Saturday I made this device which is the first actually useful thing I made with my Arduino (aside from a tiny programmer and a energylogger which haven't really been used).

It is a VERY simple thing that just switches some 220V AC power on and off on a 30 minute cycle. In beta testing I'm just turning a light on and off:

The main reason I made this is that the Vaporizer in my son's room empties halfway through the night on it's minimum setting, so with this I can switch it on on a half-hourly cycle so that it will last the night.

Let me know if you want one, I'll sell these if there is interest :)


It even has 2 LED's for debugging. The green one is on while it gives power out. The yellow one blinks 100 times each cycle (so if the cycle is 30 minutes, it is on for 9 seconds and then off for 9 seconds and so on).


I tested and measured over and over again to make sure it is safe, but I'm just an amateur electronics guy hacking away, so I should get this reviewed to make sure I don't burn my house down when leaving it on over night.


To my wife's dismay I made quite a mess, but I cleaned up nicely afterwards :)


When I did the tiny programmer I went straight from the breadboard to veroboard, this time I wrote down the design and I think in future I should really try to draw and lay it out on DipTrace first. This is open hardware, so here is the design and code so far:


==
#define BLINK_PIN 13
#define RELAY_PIN 12
#define MULTIPLIER 100

int cycleSeconds = 30*60;
int sleepMS = round(cycleSeconds * 1000 / MULTIPLIER / 2);
int counter = 0;
int blinkLevel = LOW;
int relayLevel = HIGH;

void setup() {                
  pinMode(BLINK_PIN, OUTPUT);     
  pinMode(RELAY_PIN, OUTPUT);     
  digitalWrite(RELAY_PIN, relayLevel); // start on
}

void loop() {
  if (blinkLevel == LOW)  {
    blinkLevel = HIGH;
    counter += 1;
  } else {
    blinkLevel = LOW;
  }
  digitalWrite(BLINK_PIN, blinkLevel);    
  
  if (counter >= MULTIPLIER) {
    counter = 0;
    if (relayLevel == LOW)  {
      relayLevel = HIGH;
    } else {
      relayLevel = LOW;
    }
    digitalWrite(RELAY_PIN, relayLevel);    
  }
  
  delay(sleepMS);       
}
==


For next versions I'll use an ATTINY85 in stead of the arduino, I can add some knobs to control the cycle times and maybe rather build it into a multi adaptor.

Wednesday, 30 May 2012

My first 3D print


I finally got round to do a 3D print of nice puzzle I found.

There has been a 3D at house4hack for ages now, earlier this year we got another one and this week they even made a baby.
Anyways, I challenged myself to do a print ASAP to get into it, which bared fruit now. 
My wife said she will believe it when she sees it, so I'm posting these photos and the video here as proof :)
 It's quite a nice puzzle with a handy holder. It would have been nice if the pieces could fit in when not assembled and if it had a lid, so they won't get lost. 

 Finally after the 4th time that I managed built the cube, I could reproduce it (the cube is a bit fragile and fell apart before I could figure out how I did it the first 3 times). 

It weighs in at +- 20grams (I don't have an accurate scale at home), so at R700/Kg, it comes to about R14.

Tuesday, 8 May 2012

Productive beach holiday.




The previous 2 weeks have been quite a productive holiday for me:

  • I wrote the start of a bazaar java library.
  • I learned the intro of The Call of Ktulu on the guitar (My brother happened to bring a guitar along and I had the tabs and I wanted to stay in practice, although nylon strings hardly breaks the skin).
  • I finally started reading The art of community (17% so far on my kindle)
  • I played a little of Warzone 2100 but got stuck on a transporter mission.
  • I finally got a new personal communication device (Samsung Galaxy SII)
  • Went to the mall almost every day.
  • I listened to 2 books, one driving down and one driving up. (Millionaire Upgrade - it was free ok, and Love & Respect)
  • Oh yeah I also went to the beach, built some sand castles and played with my son Dawid. It was his first time at the see and at 15 months he is the cutest boy in the world right now. He was a bit of a hand full on the beach, exploring far an wide, making friends, breaking my sandcastles... 
  • We also went to Croc-world and uShaka Marine World.