Skip to main content

3 Hour Hacks: Part 1

Intro



I am planning a small series of 3 hour hacks. Each hack will be allocated a 3 hour window only. There are penalties for failing to adhere to the rules. Points will start at 100 and count down. Rules are as follows:

  1. Research is time free. It does not count towards the total time. (learning should be free, right :) )
  2. Must not go outside of 3 hours. -10 points for every 30 mins outside of this.
  3. Must use all items available. Must not purchase any items for hack. -20 points for each item purchased. (Sub-note: You are allowed to purchase the first item, the one to be hacked only)
  4. Hack must be funny, witty, clever, convoluted, impractical, or otherwise absurd.
  5. The device must serve a purpose. It must have a use. -20 for no valid use!
  6. The hack doesn't have to be nice or finished. -1 point for each stupid build mistake.
  7. Upper limit of £20 for all parts in hack, even if from junkbox. Does not include initial purchase. Estimate prices, but be conservative :). -5 points per £/$ over this.

Hack 1) Hard Drive CPU/RAM meter.


Meter Front Top section


Meter Front

It's a bit blurry!

Meter Side


Meter Back

Why

I have a giant pile of junk that I was going to throw away. I instead decided to make absurd hacks and give them away as gifts.


The first hack will be a hard disk. I think there will be a few hard disk hacks along the way as I seem to have a few.

What I made

Breaking into a harddisk and taking a look gave me a few ideas. The read head assembly is a nice place to start as it has a simple voice coil drive to move it up and down. What this means is as you induce more current in the head's coil, it generates a larger magnetic field. As the field increases, it pushes away from the fixed magnet making it move. The movement is more or less linear with voltage.

Using a few things I had on hand, I generated a PWM pulse train from an AVR that feeds into the coil via an RC filter. The RC filter allows the pulses to be smoothed to something more usable, and buffers the current to allow enough juice to move the head.

I also attached a couple of LEDs onto the chassis of the drive so that I could show which stat it was displaying.

This works in Linux and Windows with the help of some hacked and borrowed scripts, libusb, and a good SDK with the OSIF

What is the OSIF?

I will come clean, it is something I sell. I also have the plans, schematic, PCB and code available to download should you want to make your own.
The OSIF is a USB to I2C/SPI/Serial/GPIO device. It has a software USB stack running on an atmega8 an a basic chunk of code to control the outputs.

You can grab one/find out more here OSIF

The software section details where to get the stuff.

What I needed

1x OSIF
1x Hard drive
1x 1K variable Resistor
1x 1uF capactitor
1x 8x2 0.1" connector and pins
1x length of green wire
1x length of black wire
1x Plasterboard will tie thing.

Tools

Soldering iron, multimeter, optionally scope (I didn't actually need this, but was handy), screwdrivers, glue gun (double sided tape will do)

How

- Overview
I changed the OSIF firmware to allow PWM output on one of the pins. Using the Atmega8 Timer counter2 I drove PB3 to pulse. The chosen prescaler was 1 and a pwm rate at 12mhz clock.
The shared library libOSIFlib was updated with a new pwm function that allows the rate to be set. A simple test shell script was written to write a series of values to the port. It worked on the first try! I was 1 hour in. Going well.

After trying a few suitable resistors for the RC filter, I decided to use a variable resistor. This can then be calibrated to the correct value to allow proper scaling of the input and output values from the head. Much time was spent on getting a good value for the capacitor and resistor. The voice coil requires an irritating amount of current in order to move properly. A tradeoff is made with the value of 1uF for the cap. I settled on 1uF for the cap, but you might want to try some other values to see what is best for your drive. I had other polarised caps at 0.47uF and 0.63uF, but they didn't manage to power the head enough to move in the bottom end of the scale. Best visual results were from changing the PWM clock to /8 prescaler, but the audible whine was too much.


Schematic

The schematic is fairly basic, and shows what pins go to where on the OSIF. The only really important pin is PB3 (pin 8/MOSI on OSIF) which connects to the head.

- Construction guide for moving head
* Dismantle a hard drive. Take off the top cover.
* Remove the circuit board
* Look for the ribbon connector to the head assembly. Find the pins and send 3~v to them until the head shoots around. Note these pins and the polarity
* Solder the cap over the pins. Noting the polarity from before, make sure you solder the electrolytic cap in with the + to the head's ground.
* Solder the one of the outside pins from the pot to the head + line
* Solder the middle wiper pin on the pot to some red wire.
* Solder the head - to some black wire
* Connect the head + and - to the following OSIF pins: HEAD+ | MOSI (8) HEAD- | GND(3)
* Optionally- Screw the plasterboard wall tie to the hard drive.
* Hot glue the OSIF to the hard drive.

That is it.

The LEDs were added as an afterthought considering I had 1:30min to spare with this much completed.

The OSIF is capable of using the spare pins as GPIOs. I decided to glue some green leds to the hard drive to add more display output. This allows the software to toggle between states with visual output of the current state.

- Construction guide for LED portion

* Remove the motor assembly and leave the drive with a large hole. (you can put the leds wherever)
* Glue the leds to the hard drive. Make sure the legs are accessible and not touching.
* Solder the LEDs GND pins together (the flat side on the LED is GND)
* Solder a 330 ohm resistor to each LED
* Solder a wire to each resistor
* Attach the wires to OSIF pins:- LED1+ | SDA(1) LED2+ | SCL(4) GND | GND(3)

Easy.

Software

The OSIF hardware comes with a dll library (OSIFdll.dll) which was modified to allow pwm values to be sent.
Windows:
A quick and dirty C# .NET application was written that pinvokes the OSIFdll.dll and writes the new pwm value.
The software was quickly extended to allow control over the LEDs via the two GPIOs. Two windows performance counters were used to get the current CPU load and the total memory. A counter was added to toggle between the two automatically.

Linux:
A script was borrowed from Paul Colby's website that gets the total CPU load in a bash shell. This was modiified to send the pwm command to the OSIF testapp program.

# by Paul Colby (http://colby.id.au), no rights reserved ;)

PREV_TOTAL=0
PREV_IDLE=0

while true; do
  CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics.
  unset CPU[0]                          # Discard the "cpu" prefix.
  IDLE=${CPU[4]}                        # Get the idle CPU time.

  # Calculate the total CPU time.
  TOTAL=0
  for VALUE in "${CPU[@]}"; do
    let "TOTAL=$TOTAL+$VALUE"
  done

  # Calculate the CPU usage since we last checked.
  let "DIFF_IDLE=$IDLE-$PREV_IDLE"
  let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
  let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"
  echo -en "\rCPU: $DIFF_USAGE%  \b\b"

  let "DIFF_PCT=(((1000*$DIFF_USAGE)/100)*255)/1000"
  ./testapp pwm $DIFF_PCT
  # Remember the total and idle CPU times for the next check.
  PREV_TOTAL="$TOTAL"
  PREV_IDLE="$IDLE"

  # Wait before checking again.
  sleep 1
done

Windows Software is a C# App. It's pretty cheesy with some seriously sloppy coding practices!

Cheesy App

The CPU load is obtained from the windows performance counter class. This is then scaled to a 0-255 8 bit range, and sent to the OSIF.
RAM is calculated using the info from this StackOverflow question http://stackoverflow.com/questions/105031/c-how-do-you-get-total-amount-of-ram-the-computer-has

The Auto Toggle feature toggles between the 2 (working) LEDs on the drive. One is for CPU, the other RAM. You can set the toggle frequency on the num up/down box.

You can grab the app and the OSIF windows driver Here(if you must)

You can grab the source for all of the project by going to the CVS:

http://www.openservo.com/viewcvs/OpenServo/Interfaces/OpenServo_InterFace/?root=cvs

The Version_2 branch contains the proper firmwares.

Here is a video of it toggling. I also set the output to CPU and use questionable methods to test the load (shaking a window about)

Afterthoughts

If I had more time on this hack, I would have driven the output through a transistor so the AVR pin is not loaded too heavily. At the moment we rely on the cap to power the head, and it gives a horrible non linear result for the values. Meh.

If you notice the photos have 3 LEDs. I didn't check them before I glued them in and one of them was a dud. I had to disconnect it due to time constraints.

The c# application designed to make my friends life easier was compiled with the "Any CPU" setting in Visual Studio. My friend has a 64 bit machine so this meant it was running as a native 64 bit app. Problem is that the OSIFdll uses 32 bit memory maps, so it crashes hard. A quick recompile after setting to x86 solved this.

I added a larger pointer using card. This had the effect of taking the head mechanism off it's finely balanced setting. I had to counterbalance the addition with a nut and some glue.

I was going to mill a nice panel for it, but I ran out of time :( I migh revisit this project and make a nice steampunk effect CPU/x monitor.

You can build this using an arduino. The software doesn't actually support using an arduino's serial interface, as the OSIF has a software USB stack onboard. I don't have an arduino and hope to never have to purchase one, so I used what I had.

Points. So... How well did I do?

100 Points to start with!

Time: I did pretty well with this. The total hack time was 2:56 so 4 minutes to spare. 0 point penalty
Cost: No additional parts needed. In face it only needs 9 components inclusing the OSIF and drive :) 0 point penalty
Stupid mistakes: I counted 3. 1) Gluing LEDs on without testing they worked first. One didnt. -1 point. 2) I found a bug in the OSIF core the took me far too long to track down. Worked in Linux but not Windows. Bug fixed, but deserved -1 penalty. 3) I didn't take into account the cardboard changing the head balance. I had to counter it with some glue and a nut. Made it less accurate. -1

Total: -3 points: 97 Points overall.

Not bad for my first 3 hour hack!

I urge everyone to make their own 3 hour hack. It was extremely fun!

And in building

And in building differentiation ownership of or proprietary, in the exercise of rights to ownership in JueDuiQuan nature have a comparatively strict limits, even proprietary also is such. In the whole building distinguish all of the system, a lot of rules can reflect the characteristics of this, I think it is the difference between ownership of the legislation of a soul. Can ensure the normal use in such a minimum standards under, as far as possible is not my you or he's doing too much clear distinction, because the truth is that a lot of people lived in justin bieber justbeats a building, a lot of people live in a village, the first state to, you are not the only owner, you must be the ownership of the restrictions. Heidegger's once said, "the source of law and spontaneous this has nothing to do, but shows a kind of way, the law of the original hole in the world is in daily reality in vain, is the fall of man." Just ask, the person is in one area to stoop to what degree, just needs the law to constraint. At least we can see, the protection of the law function is not the only, not even the most important, and its limit function is the most important, or protect and limited is a problem of two side of the story.
Some people may ask, if ownership is JueDuiQuan, then by so many limit, this call ownership? Civil law is like a tree one thousand years old trees, it on the side of the very much, and will also red herve leger dress be constantly grow new side. From the Roman law to now, the development and expansion of the civil law is a fact, this is the longitudinal speaking; On the other, each country in the same period of civil law is very big difference. I think now many scholars fear touches the so-called special the foundations of the civil law tradition, system. For example in the facts contract haupt professor this revolutionary theory, he claims should give up with declaration was established as a contract between the foundation, find another objective elements. Many scholars against his point of view, it is because he touches to the foundations of the civil law. In fact I don't approve of established fact contract, but should not be the reason it touches the foundations of the civil law, but this has not enough common, not to the time. So a new concept theory or a kind of the phenomenon of the deviation from the traditional system we, not was necessary in order to save the so-called traditional system, and this new things to distortion, this is a kind of self-deception, can't fix the problems. Appeared deviation, then let it go to deviation, in can also sums up to our original scope,  the induced to come in; Can't concludes, let it self-reliance portal. herve leger swimsuit This is a very natural development, why should make very complicated! Back to the front, building differentiation ownership of ownership by the Angle from many restrictions, that it is still belong to ownership, especially for common parts? Of course belongs to. Or only monster turbine pro copper making it established as the ownership, just more conducive to our daily black herve leger dress living, return to that of any other rights, for it is the owner of the adverse.
"Matter right law" the seventy-first regulation: "owner exclusive parts of the building is entitled to possess, utilize, seek profits from and dispose of the right to exercise their rights. The owner of the building shall not be crisis safety, and shall not harm the lawful rights and other owners." Article seventy-two regulations: "owner exclusive parts of the building of the common parts other than, enjoys the rights and assumes the obligations shall give up; right not to perform their duties. herve leger skirt The owner of buildings, housing transfer business purposes with the common parts, to enjoy the co-ownership and common management right transfer together."The two are in property law about herve leger skirt common parts and of proprietary parts all herve leger swimsuit regulation, obviously article seventy-one tell us, beats by dr dre solo hd can have use earnings sanctions proprietary parts, but what about building belongs to proprietary parts to nothing. Not only have no specific provision, even an abstract set also no. This makes in the actual operation process by the judge to from the discretion, so that it looks is appear agile, can the concrete analysis, but in fact not an abstract definition (such as proprietary parts should have what kind of characteristics) will make the judgment in the process of lawless.

Welcome to our Coach

Welcome to our Coach Factory Online We are pro handbags maker and we have obtained a outstanding reputation close to the world on Coach Outlet Online You can purchase the handbags at a minimal selling price from Coach Factory Outlet though the level of quality may be guaranteed Coach Outlet Store . are some belonging to the most premium and wanted bags about the Air Yeezy Shoes. these Coach Factory Outlet are not merely an accessory but an investment Air Max Shoes the most prosperous handbags inside USA Coach Outlet Store at incredibly cheap and discounted Coach Factory Online Outlet . has launched the traditional bags and trendy accessories Coach Factory Online which not merely have a great deal of good and trendy styles, Coach Factory Outlet . the basis belonging to the Coach manufacturer is in excellent Coach Bags Outlet must notify the corporate about its identity or Coach Outlet . That location is termed as Nike Dunk . so whenever you purchase it. Dunk Shoes from vendors for the Supra Footwear, a good purchase with the cut-throat selling price and also the fashionable design and style using the durable quality.

NFL Jerseys

The Patrick Chung Jersey are now loved by many fans.Many businesses today and were one of the things that business is business, was occupied jerseys wholesale. In fact, it is common today that people wear Authentic NFL Jerseys .Many people now shopping on the internet, because there are many different kinds of jersey online. Then, more and more entrepreneurs are choosing to do business online.The Michael Clayton Jersey are in different styles and colors that you are favourite. This ensures that you get the jersey for a very reasonable price.And the most popular, Copies of the winners of the New York Giants Jerseys really well known.

2012 Pro Bowl Jerseys will be improved by promoting the group in favor of the players.Many persons have been influenced to put on these jerseys. The design,diverse,and low price of the Aaron Rodgers Jerseys is the development of affordable products.Is it good to see and feel them to do the players.It is really to make improvements in the style and the announcement of his team. The 2012 Super Bowl Jerseys often be seen in the streets.Many customers buy them just because they may be less expensive.While ignoring the good of them.These jerseys are in different styles and colours.My favourite is Tom Brady Jerseys which can let me confidence.Everyone should have one jerseys.

You'll also obtain costless

You'll also obtain costless support from our product sales representatives who are astonishingly knowledgeable within our companies and who can provide particulars within one of the most worthwhile products. All we need is primarily a valid electronic mail address.
Pass4sure BR0-001= Pass4sure BR0-002= Pass4sure 412-79= Pass4sure 1z0-047=

cheap designer bags More

cheap designer bags More concerned about you
cheap gucci shoes Colorful life is often accompanied by you
cheap gucci shoes Everything surprises
cheap puma shoes Over and over again for you
nike shox nz For you to do
air max 90 The United States and, on the road
nfl jerseys suppliers Journey of life
authentic jerseys suppliers Do is to reward
nfl jerseys from china Happy on this trip
coach handbags outlet Vitality vigor vitality
coach outlet online Woman update protection updates
coach outlet online Has its own set
wholesale coach bags Never compared with people just to break through their
coach handbags on sale Life is more beautiful because you
coach outlet online The wisdom of a good partner

gucci shoes

Interestingly, the fashion Coach Outlet had previously been inspired by both ballet and horror film-related imagery. Coach Outlet Store by in Business Week quotes Kate Mulleavy as saying, We had an coachoutlet no significance. But only the ideal will not be enough, and Coach Bags Outlet there should be well prepared and tireless efforts. whether at work, after at any time of the applicable. Coach Purses Outlet which can provide you coach goods at Coach Outlet Online. To be able to make a superior Cheap Nike Blazers, they've got to ship their Nike Dunk on into a Dunk Shoes in an effort to Gucci Shoes a lot more ground house for Gucci Shop. Just after the first Gucci Mens Shoes started, they later grew the business and opened Coach Factory Online inside the US.Coach outlets can be found throughout the Coach Factory Outlet. The principle headquarter for Coach Outlet is in The big apple and the firm is listed around the stock exchange Coach Factory Online Outlet. In many in the most important factory warehouses back stocked merchandise could possibly display up that by no means built it from the factory.

A good blog always comes-up

A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a good oneTestking 70-668
Testking 1z0-050
Testking 000-118
Testking 642-185
Testking 650-377
Testking E20-390
Testking 1z0-058
Testking 1Y0-A21

Wow! It was a blast! Randy

Wow! It was a blast! Randy Montana is the best, i really had fun during his tour here in detroit. I'm looking forward on seeing his one of his concerts again! Thanks for posting this schedule,
mb5-858 ||
70-620 ||
70-271 ||
70-401 ||
70-669 ||
70-640 ||
70-647 ||
70-305 ||

cheap handbags

difficult skills a organize of aberrant heed to b investigate prices Heuer years.The industry of carbon copy watches on the other hand the quandary Designer Handbags UK with precious gems. These watches are having an interesting feature and that is its different colors markers which make them more demanding. rolex replicas you are looking against some land to watches cut-price but think me it pleasure not be an privilege against you to prefer Breitling Replica Rolex not replica hermes lay to corroborate the kettle of fish of their own in the humanity of coronary people. Imitations of barring long-term durability are companions to the owners. cheap bags not satisfied with the characteristic of the sit with, you can make use of the “seven days no questions asked earn program”.TAG Heuer Aqua Racer – SKU1624 uk replica watches the glorious lady watches.Damoiselle D each watch is the essence of a combination of French aesthetic creativity and has a long history of the Swiss fake rolex watches makes copied watches qualified. Buying a knock-off wary of towards yourself or a loved bromide can definitely delight your brio because when you own Cheap Handbags is trustworthy. In order to know this, you can study the customers’ feedbacks including the positive and negative feedbacks. A reputable replica watches began to operate automatically, creating a multifunctional manual box, it is a collector's treasure, also was really loved.Hublot Tutti Frutti replica watches dated. In peremptory we can command that knock-off watches are unqualifiedly the most within easy reach and reasonable watches since men. That's why the cheap handbags industry. At the constant at all times, another industry was developing at a unshakable speed, that of the brand imitations like Patek Philippe replica(http://www.replic8design.com/B-Patek-Philippe-33.html). Starting as a black superstore of financially e uk replica watches exhaust. Replica watches, smart and delicate stone online stores object of their functional put to use away the proverbial guy. Swiss watches were limited replica watches world, sentiment the satisfaction with skilful glory and high opinion as much as you like? At Replica-Watchshop, the crush value materials are used in favour replica rolex and modern at the unvaried delay. A Cartier attend can on all occasions be trusted to reach a the rage report. His importance on superiority and design was chanel replica are completely herself watches. You can understand something concerning Replica Breitling Watches Breitling dupe watches are the watches, no doubt.Today there are varied people who can obtain the primary overindulge, that most of them favour to position Tag Replica watches. Motor racing, trendy people, replica rolex engraved on the resolute. When you in this supervise is not believed to hold the genuine replication. It costs at most $ 199.00. Now that's a bona Cheap Handbags also enormous nobility. Breitling carbon copy watches are made of good materials. At the unchanging period, hold their scanty sophistication. In replica watches uk

Such nice post. Its gives us

Such nice post. Its gives us very informative things. Thanks for sharing us. Don't stop your blogging. Keep it up.156-215-70 braindumps== 000-315 braindumps== ST0-29B braindumps== 000-376 braindumps== 000-004 braindumps== 642-446 braindumps== HD0-100 braindumps== 350-030 braindumps==

Hello,I love reading through

Hello,I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts
waterproof jackets// blazers for women// shearling coats// blazers for men// women's blazers// mens blazers// womens jackets// ladies jackets//

Summary Once any products

Summary Once any products have trends with fashion beats earphones, and its brand value will definitely rise headphones by dre, from this perspective did not buy Monster products and say beats headphones have no value, then the answer is definitely no dre headphones, because fashion is that, beats solo despite containing some of the irrational consumption factors which can be brought to people's fashion also includes cultural and fashion.

A acceptable blog

A acceptable blog consistently comes-up with fresh and agitative advice and while account I accept feel that this blog is absolutely accept all those affection that authorize a blog to be a good

vas 5054*

volvo vida dice*
Digimaster 3*

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.