Hacking Minecraft, adding output using Arduino

With the future/career day coming up I was wrecking my brains on what to do on the day my son visits me at my workplace. There will be stuff organized for him in the morning but I will have to entertain him for about four hours in the afternoon.

I was thinking I would bring my laptop and let him do some Scratch programming, something he already did and enjoyed. Thinking further I thought I could bring my Arduino Uno and he could blink some LEDs. The most important thing for me is to bring him into programming and not to bore him so I searched further. I thought connecting Arduino and programming to something he is really into… like Minecraft!

I came across this blog post where Rozz decompiles, hacks and recompiles Minecraft to output the health status via a connected Arduino! DONE! This project had all the ingredients I was looking for!

Continue reading

Connecting to Arduino using Processing and bluetooth (HC-05, HC06)

USB bluetooth dongle

USB bluetooth dongle

The other day I bought myself a USB bluetooth dongle for my HP laptop and a HC-05 bluetooth adapter for the Arduino.

When I connected the dongle to my laptop running Windows 8 it appeared like it would install the default drivers for it. I connected the HC-05 to an Arduino and I could locate it from my laptop. I could even pair the dongle with the adapter. (Default code: 1234.)

HC-05 bluetooth module

HC-05 bluetooth module

But when checking the HC-05 in Windows’ device manager its status would say “Offline”. It took me several hours of googling until I came across a suggestion by another user that bought the same dongle on amazon: I installed the Toshiba Bluetooth Stack! Even though it says it’s only for toshiba laptops it worked on my HP like a charm.

I also had a HC-06 adapter lying around. Optically they look very similar. As far as I know HC-05 can work as master or slave whereas HC-06 is slave only. If you use them as slaves you can use either of them using the same pins. HC-05 came up under COM40 and HC-06 identifies itself as “linvor” under COM41.
Continue reading

I won a GPS Bee Kit from Seeed!

*retweet*

wooohooo!

The kit is on its way, can’t wait to test it…

Featured on freetronics.com!

I daily scan the internet for some inspiration and just to see with what awesome ideas other Arduino lovers come up. A page I regularly visit is Freetronics and their blog. I am also following their twitter account @freetronics and was very happy to see their tweet on Feb 22 mentioning one of my projects:

Thanks guys!

Nikon Intervalometer with a Digispark

Years ago I bought myself an IR remote for my Nikon D40. That worked ok, but of course I wanted to build my own using a Digispark.

There’s lots of tutorials for IR remotes out there, like LuckyLarry’s. I then later came across the nikonIrControl library which basically allows you to trigger a photo with a single line of code! Best of it is this library will work for every camera supported by ML-L1 and ML-L3 such as D40, D40X, D50, D60, D70, D70s, D80, D90, D7000, D5000, D5100, D3000, Coolpix 8400, 8800, P6000, P7000, P7100, Nikon 1 J1/V1.

And because the intervalometer should be as tiny as possible I was using a Digispark to control everything.
Continue reading

Spycam with Arduino / Digispark

This is my first real project with the Digispark.

My son made a bird feeder at school and every now and then we could spot a bird eating on our balcony. I thought that would be cool to make photos of the birds stopping by.

Somehow we would have to detect when something comes/flies by. This is done using the PIR motion sensor. But apart from that, Digispark should also trigger after a defined interval, like making a foto every 5 minutes for some nice time lapse movies. I actually added a 1k potentiometer with which we can adjust the delay between two photos between 30 secs and 10 minutes. Setting the poti value in the middle Digispark would trigger a photo every 5 mins.

I bought myself a spycam on ebay:

spycam

Features:
Image Resolution: 1280 x 960 pixel
Color Video Resolution: 640 x 480 pixel
FPS: 29 frames per second
Image file format: JPEG
Video file format: AVI
Color Video and Audio
Rechargeable Li-ion battery: 280mA 3.7V
Dimension: 5.0 x 3.0 x 1.2 cm

Continue reading

HC-SR501 passive infrared sensor with Arduino

Got myself a HC-SR501 passive infrared sensor from ebay for less than 5€.
As information about this sensor is hard to find but usage is pretty easy I thought I share my findings.

HC-SR501

HC-SR501: Left poti is to adjust sensitivity. I have set it to medium. Right poti is to adjust the delay. I set it to minimum which means it triggers about every 5 seconds.

HC-SR501

On the bottom are the connections for 5V (left), signal (middle) and GND (right). I tried around with the jumper on the top right, but couldn’t really tell a different behaviour.

I thought the signal pin delivers an analog value according to the distance so I added a LED to pin 11 for the output. This was the initial setup:

#define pir A0
#define led 11

void setup() {
  pinMode(pir, INPUT);
  pinMode(led, OUTPUT);
  Serial.begin(9600);

}

void loop() {
  int i = analogRead(pir);
  int l = map(i,0,1023,0,255);

  Serial.print(i);
  Serial.print(" / ");
  Serial.println(l);
  analogWrite(led, l);

  delay(100);
}

I realized that the value I was reading at the sensor pin was always around 680 not matter what.
I then went on to change analogRead to digitalRead:

#define pir A0
#define led 11

void setup() {
  pinMode(pir, INPUT);
  pinMode(led, OUTPUT);
}

void loop() {
  digitalWrite(led, digitalRead(pir));
  delay(100);
}

And it worked too… but I think going forward I will use analogRead and will react to motion once the value delivered by the PIR is higher than 500.