torsdag 23. april 2015

SMS controlled cabin

My parents bought a new cabin. It’s pretty remote so we needed a way to “talk” to it. I want to be able to turn on the heat before I arrive, check that the power is on, no one has broken in and so on. Since there is no Internet connection GSM was the only alternative. So I've set up a simple remote controlled system with an Arduino. So far I've only done the remote heat part.

For this project you will need:

See the code here

To not get in trouble with insurance or electrical inspections I did not want to mess around with the main power (230v). To avoid this I bought remote controlled sockets and made the Arduino the remote. I already had most of the code to control the sockets from another project.

I used a cheap GSM module called LoNet. It connects to the Arduino using the serial interface. The module needs around 4v and up to 2A. So it’s not possible to power it from the Arduino. I had to add a buck converter to handle this.

fredag 6. juli 2012

Arduino key board Prank

I work at an office and there is always some pranks going around. One of them was plugging a second keyboard in to the computer and typing away while the other guy was trying to write emails.
So I thought way not make it a little more advanced, and make a device to do it all for me. I had an old teensy 1.0++ laying around. So the prank is as easy as setting it up to emulate a usb keyboard. Then have it press keys and write messages with a set interval. The way I programmed it in the code under is:

First hours: toggle caps lock every 2.5 min
Second hours: Press alt-tab (change window) every 2.5 min
Rest of the day: Type random messages on the screen

The teensy board
As you can see this quickly gets pretty irritating. But when you start looking for who’s pranking you the regular guy is sitting quietly typing on his key board. And it’s easy to change for your own messages and keys.
To make it less detectable you can use a USB-hub, so that there is no more cables then usual going in to the computer.

Arduino USB key borad prank

int count = 0;
bool caps;

void setup() {

// toggle caps-lock
void toggle_caps_lock() {
if (!caps) {
caps = true;
} else
caps = false;


void chage_app() {
Keyboard.set_modifier(MODIFIERKEY_ALT); // Press alt
Keyboard.set_key1(KEY_TAB); // Press tab

Keyboard.set_key1(0); // Release keys

void write_rnd_msg() {
char* msg[15];

msg[0] = "I am a sucker ";
msg[1] = "Hugs and kisses ";
msg[2] = "stupid ";
msg[3] = "Whats going on with my computer ";
msg[4] = "Im messing with you ";
msg[5] = "What??? ";

int rand = random(0, 5);


void loop() {
count = count + 1;

if (count < 120) { // first hour
if ((count%5) == 0) {

if ((count < 240)&&(count > 120)) { // second hour
if ((count%5) == 0) {

if (count > 240) { // the rest of the day
if ((count%10) == 0) {

fredag 8. juli 2011

Make your own capsules/pods for the nespresso machine

Ever thought about using your own coffee in a Nespresso coffee maker. Well you can, by recycling your old capsules. It's cheaper any you can use your favorite type of coffee. All you need is, a coffee filter, some tin foil and some espresso coffee.
Start by removing the used coffee from an old capsule.

Take a normal coffee filter and cut a small circle that fits on top of the capsule as shown in the image.

Cut a piece of tin foil and wrap it over the top of the capsule.

Make small holes in the tin foil. The machine will not do this automatically like on normal pods. Voila you now have your own capsule for the Nespresso machine. Enjoy your coffee.

Update: I had some problems with water coming out in the start of the brev. The solution to this was to put the capsule in your mouth and blow. So that the coffee gets pressed up to the lid of the capsule. Please comment if someone fines a better solution to this problem..