Latest Tricks :
Showing posts with label Hardware Hacking. Show all posts
Showing posts with label Hardware Hacking. Show all posts

Electromagnetic Boots

| 0 comments

X-Men: Days of Future Past is making its way to theaters around the world, and [Mr. Furze] has released his second X-Men related hack 

In case you missed it, [Colin Furze] has made three projects to celebrate geekdom and a mastery of fabrication for all the comic book fans out there. He started with the fully functional pneumatic Wolverine Claws, and now he’s tackling Magneto’s powers. The third project isn’t out quite yet, but we can’t wait to see the final installment!

Now the problem with Magneto is his powers are a wee bit too… magical? Without special effects, you can’t really replicate his mutant abilities (please prove us wrong if you can!), so [Colin] decided to do the next best thing. Magnetize himself — well, his shoes.


Not wanting to spend too much money on this project, he needed electromagnets — but where do you get cheap electromagnets? The answer? Microwave ovens. By salvaging the transformers out of microwave ovens, you can easily cut them in half, remove the secondary coils, and bam, you’ve got a bunch of giant electromagnets.



 


 
Continue Reading

Remote Control Anything With A PS3 Controller

| 0 comments

When looking for a remote control for your next project, you might want to look in your living room. Wii controllers are a hacker’s favorite, but wagging an electronic wand around isn’t the greatest for remote control planes, cars, tanks, and multicopters. What you need for this is dual analog controls, something every playstation since the 90s has included.
[Marcel] created a replacement electronics board for the Sony DualShock 3 controller for just this purpose. With this board, an XBee, and an old controller, it’s easy to add dual analog control and a whole lot of buttons to any project using an XBee receiver.
The replacement board is based on the ATMega328p uC, includes a Lipo charge circuit and power supply, and inputs for the analog sticks and all the button boards inside the DualShock controller.



Continue Reading

Convert Optical Mouse into Arduino Web Camera

| 0 comments

Optical mouse uses a small camera that records surface to calculate movements of the mouse.
In this tutorial I will show you how to display video signal of this camera in your browser.

The mouse I took apart was an old Logitech RX 250 which contains ADNS-5020 optical sensor.
This sensor records 15x15 pixel images in grayscale. It also calculates X-Y movements of the mouse. 




To get the things running you will need:
- arduino
- ethernet shield
- optical mouse with ADNS-5020 sensor
- 10K ohm resistor

Connect everything together

Make sure that pins (NRESET, NCS, DSIO, SCLK) of the sensor don't connect to anything on the mouse board.
If they do, cut the traces. (I removed the main chip and some resistors to achieve the same thing.)




Solder 10K ohm resistor between NRESET and +5V. Then solder wires (approx. 20cm) to pins NCS, DSIO, SCLK, +5V, GND.
This is a scheme that you should end with: 

 


Put Ethernet shield on arduino and connect it to local network.
Then connect mouse sensor to arduino like this:
+5V -------------- Arduino +5V
GND -------------- Arduino GND
NCS -------------- Arduino digital pin 7
SDIO -------------- Arduino digital pin 6
SCLK -------------- Arduino digital pin 5  

Arduino sketch

In the sketch below replace receiverIP value (in my case 192, 168, 1, 102) to IP of your computer.
Then upload the sketch to arduino. 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>

byte arduinoMac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress arduinoIP(192, 168, 1, 177); // desired IP for Arduino
unsigned int arduinoPort = 8888; // port of Arduino

IPAddress receiverIP(192, 168, 1, 102); // IP of udp packets receiver
unsigned int receiverPort = 6000; // port to listen on my PC

EthernetUDP Udp;

int SCLK = 5;
int SDIO = 6;
int NCS = 7;

void setup() {
Serial.begin(9600);
Ethernet.begin(arduinoMac,arduinoIP);
Udp.begin(arduinoPort);

pinMode(SCLK, OUTPUT);
pinMode(SDIO, OUTPUT);
pinMode(NCS, OUTPUT);

mouse_reset();
delay(10);
}

void loop() {
char img[225];
for (int i=0;i<225;i++){
img[i]=readLoc(0x0b);
img[i] &= 0x7F;
img[i]+=1;//if there is 0 value, part of udp package is lost
Serial.print(img[i], DEC);
Serial.print(",");
delay(2);
}
Serial.println();
Udp.beginPacket(receiverIP, receiverPort); //start udp packet
Udp.write(img); //write mouse data to udp packet
Udp.endPacket(); // end packet

delay(500);
}

void mouse_reset(){
// Initiate chip reset
digitalWrite(NCS, LOW);
pushbyte(0x3a);
pushbyte(0x5a);
digitalWrite(NCS, HIGH);
delay(10);
// Set 1000cpi resolution
digitalWrite(NCS, LOW);
pushbyte(0x0d);
pushbyte(0x01);
digitalWrite(NCS, HIGH);
}

unsigned int readLoc(uint8_t addr){
unsigned int ret=0;
digitalWrite(NCS, LOW);
pushbyte(addr);
ret=pullbyte();
digitalWrite(NCS, HIGH);
return(ret);
}

void pushbyte(uint8_t c){
pinMode(SDIO, OUTPUT);
for(unsigned int i=0x80;i;i=i>>1){
digitalWrite(SCLK, LOW);
digitalWrite(SDIO, c & i);
digitalWrite(SCLK, HIGH);
}
}

unsigned int pullbyte(){
unsigned int ret=0;
pinMode(SDIO, INPUT);
for(unsigned int i=0x80; i>0; i>>=1) {
digitalWrite(SCLK, LOW);
ret |= i*digitalRead(SDIO);
digitalWrite(SCLK, HIGH);
}
pinMode(SDIO, OUTPUT);
return(ret);
} 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 

Open serial window and you should see data flow from mouse:
 

Install Node.js and Socket.IO

To display data in browser we need to have node.js and socket.io installed on computer.
Install node.js from here: nodejs.org then go to windows command prompt and run:
npm install socket.io

Node.js and and website code

In the code below we configure node.js to listen to udp traffic from arduino, send all data to browser with socket.io and setup a basic web server. 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

var dgram = require("dgram");
var server = dgram.createSocket("udp4");

var io = require('socket.io').listen(8000); // server listens for socket.io communication at port 8000
io.set('log level', 1); // disables debugging. this is optional. you may remove it if desired.

server.on("message", function (msg, rinfo) { //every time new data arrives do this:
//console.log("server got: " + msg + " from " + rinfo.address + ":" + rinfo.port);
//console.log("server got:" + msg);
io.sockets.emit('message', msg);
});

server.on("listening", function () {
var address = server.address();
console.log("server listening " + address.address + ":" + address.port);
});

server.bind(6000); //listen to udp traffic on port 6000

var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;

http.createServer(function(request, response) {

var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);

var contentTypesByExtension = {
'.html': "text/html",
'.css': "text/css",
'.js': "text/javascript"
};

fs.exists(filename, function(exists) {

if(!exists) {
response.writeHead(404, {"Content-Type": "text/plain"});
response.write("404 Not Found\n");
response.end();
return;
}

if (fs.statSync(filename).isDirectory()) filename += '/index.html';

fs.readFile(filename, "binary", function(err, file) {
var headers = {};
var contentType = contentTypesByExtension[path.extname(filename)];
if (contentType) headers["Content-Type"] = contentType;
response.writeHead(200, headers);
response.write(file, "binary");
response.end();
});
});
}).listen(parseInt(port, 10));

console.log("Static file server running at\n => http://localhost:" + port + "/\nCTRL + C to shutdown");
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
Just save the code as: code.js
Now we need to create a website which will convert data from socket.io into 15x15 image.
This is it: 


 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<html>
<head>
<style>
#wrapper { width:300px; height:300px; }
div div { width:20px; height:20px; float:left; }
</style>
<script type="text/javascript" src="//localhost:8000/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost:8000');
socket.on('connect', function () {
socket.on('message', function (msg) {
document.getElementById('wrapper').innerHTML = '';
for (var i = 0; i < 225; i++) {
pixDraw(Math.round((msg[i])*2.4));
}
});
});
function pixDraw(clr) {
var pixDiv = document.createElement('div');
pixDiv.style.backgroundColor = "rgb("+clr+","+clr+","+clr+")";
document.getElementById("wrapper").appendChild(pixDiv);
}
</script>
</head>
<body>
<div id="wrapper"></div>
</body>
</html>
 
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Save it as index.html

Run it!

If you are on windows then just download zip file below and run the runme.bat file.
If you are on linux then run the command node code.js in the shell.

Now open the address http://localhost:8888/ in a web browser and you should see a realtime image from mouse:
 

Continue Reading

SDR as a Police and Fire radio scanner

| 0 comments

police-scanner-sdr

If you’ve lost interest in that DVB dongle you bought to give software defined radio a try you should bust it back out. [Harrison Sand] just finished a guide on how to use SDR to listen in on Police and Fire radio bands.
The project, which results in the crystal clear audio reception heard after the break, uses a whole lists of packages on a Windows box to access the emergency bands. SDRSharp, which has been popular with other DVB dongle hacks, handles the hardware work. In this case the dongle is a Newsky TV28T v2 module that he picked up for a few bucks. He’s also using some support programs including the Digital Speech Decoder which turns the data into audio.
We wonder how many areas this will work for. It was our understanding that law enforcement was moving to encrypted communications systems. But all we really know about it is that you can jam the system with a children’s toy.
Continue Reading
 
A Website by Neeraj
Copyright © 2014. Hacking Crush - All Rights Reserved
Developed by :Neeraj Dhawan
Organized by : Neeraj Dhawan