Armageddon421's Hackingblog

Author Archive

ResCan – scan resistor values!

by on Feb.15, 2014, under quickhack

Well, this one was unexpected. I went to visit ST from project-insanity and he wanted to have a huge pile of unsorted resistors… sorted. Measuring with a Multimeter is unpractical and slow and reading the color codes gets tiring very quickly.

“A machine could do this!” -me

So I started writing an android app using opencv to detect the color codes. Although the camera outputs a fullHD-Stream, it has trouble focusing at low distances. Moving the phone further away results in the color rings being only 2 pixels wide, what makes it quite hard to safely detect.

I decided to use a cheap USB-Webcam with manual focus to overcome the problem. Luckily the webcam has six cold white LEDs around the lens, providing a nice constant light source. Only the automatic adjustment of exposure time sometimes causes trouble. I used java on the desktop-PC so I could reuse parts of the code from the android app.

Although I’m using opencv to grab the video stream and its tools to crop images and draw on them, the algorithm itself is a bunch of for loops. I couldn’t bother to find out how to train any classifiers. Basically all I do is separating the resistor from the white background and then detecting the “thicker thing” between the two leads. This works pretty stable, even for extremely bent leads.

The thick red line shows where the algorithm thinks the center of the resistor is, the blue lines show where the color is grabbed. Because of the specular reflections from the LEDs, there is no grabbing happening at the center line.

ResCap1

Finally, I decided that it would be nice if the tool reads out the values loudly, just the way we worked in tandem when we tried to sort them manually. I used FreeTTS, an open source pure-java text to speech implementation to achieve this.

Watch the video to see it in action!

Update: I put the project on GitHub! There is also a jar to try out! https://github.com/armageddon421/ResCan/releases

14 Comments more...

Snake on LED-Panel

by on Feb.14, 2014, under LED Panels, Projects

Hey there!

Today I want to show you a project from early 2013. Someone sold adressable LED-Stripes on the 29th Chaos Communication Congress in Hamburg and I just couldn’t resist getting me some. I bought 10 meters. The strip has 32 RGB-LEDs per meter and is made adressable by adding an IC (can’t remember the type right now) for every two LEDs. The protocol is equivalent to the WS2801, using SPI (with clock line, as opposed to the LED-integrated WS2811 which have no clock line and are pain in the a** to talk to) and therefore can easily be used directly with the raspberry pi.

Since the raspberry pi outputs a logic level of 3.3V and the LED-strip expects 5V level, some level shifting had to be done. On the 29C3 I found some nice guys giving me some SMD MosFETs, resistors and perfboard so I could fiddle together a basic level shifter. It could only handle frequencies of about 1MHz, but that was enough to make the thing shine!

The trash cans at the location had a circumference of exactly 1m, wich was ideal to just wrap the stripe around. So it happened. A USB battery pack was used to supply the thing, so it was even portable! Go party with a trash can! Unfortunately I had to leave the trash can there… This video is from the guy who sold me the stripes. Check it out!

Back at shackspace, my local hackerspace in stuttgart, I rearranged the stripes on a wooden board to make it look more like a normal LED-Panel. What game could be better on such a thing than snake? So it happened. I implemented the main thing in one night, everythin in one file. Ugly. Works. The rest of the time was spent optimizing the bot. Did I say bot? Yes I did. One weekend later I made this video showing off the result. Unfortunately it is german. Watch it.

Things like plasma effects look super smooth!

Later I added a proper level shifter, allowing stable bus clocks of up to 8MHz and much higher framerates. Next steps include prettifying, that means building a nice enclosure with milk glass and maybe cleaning up the code.

The code can be found over at github.

That’s it for now. If there are any questions… You know the drill!

Leave a Comment :, , , , , , , , more...

Android dead reckoning

by on Feb.13, 2014, under quickhack, Random

One of our lecturers gave us the excercise to to over the winter holidays to write an android app in qt that reads and logs sensor and GPS data, does some calculations on them and displays the refined result on a map.

Reading out GPS and sensors from within qt proved difficult, and displaying a map was also not exactly the easiest task at all. Two weeks before the deadline, he lifted the qt-restriction. Naturally, I started the project in android studio two days before the deadline.

In the videos below you can see the result. The data has been recorded with my smartphone placed in the center console of my car.

I found out we also had to do a height profile, so I hacked this together last-minute:

It was fun playing around with dead reckoning. If anyone is interested I might post about how it works or even try to implement some proper algorithms, since this is just a quick mockup rather than anything useful. For example there is no real calibration or gravity compensation of any kind.

This was also the first time I tried to use fragments in android, which proved quite difficult because I didn’t quite read up enough to understand how they work and how to deal with their lifecycles. I obviously managed to get it to work somehow, though, but it might not be exactly the prettiest solution.

Greetings,

armageddon421

Leave a Comment more...

Reviving The Blog

by on Feb.13, 2014, under Random

Hey there,

It’s been a long time since my last post. I must’ve kinda forgotten about this blog – or just couldn’t bother writing anything about my projects. I’m planning to revive this blog and try to make regular small updates even on small projects.

Some of the projects I’m going to post about include:

  • MLP – Massive LED Panel
  • 3D – Engine on Teensy 3
  • The smaller counterpart of the LED panel running snake
  • LED ring clock prototype
  • Android dead reckoning test
  • Playing with the neato XV-11 LIDAR
  • Quad- and Hexacopter Projects

Some of the projects I am planning to start in the future include:

  • A robot that brings me drinks! (using the LIDAR)
  • Ultrasonic Indoor Positioning System
  • Part database – catalogue all the stuff in your mess!!
  • FPV – Hexacopter

I also added a donate button in case you want to support some of the aweseome projects!

If you have any ideas or suggestions, don’t hesitate to share them in the comments.

Greetings,

armageddon421

Leave a Comment :, , , , , more...

RepRap upgrades

by on Apr.19, 2012, under Projects, RepRap

Last week I was thinking about improvements for my RepRap Prusa Mendel. I found out that some things didn’t really work as expected. I’ll explain some of my modifications here.

First of all, the print was sometimes slightly irregular. I found out that this was due to the filament screw not having enough grip. I asked my local metal worker if he could help me. He created a filament screw from a raw aluminum cylinder for me, using a mill to make a total of 24 edges to grip on the filament which is way better than the tap and die method.

Additionally I swapped the Wade’s v2 that came with the parts I bought with the Wade’s v3 I printed a while ago. Together this makes a quite powerful extruder that exceeds the 2kg holding force by quite a lot.

After that, I finally replaced the broken linear bearing. Unfortunately, it left really bad grooves in the smooth rod. I worked around this by turning the smooth rod by 45 degrees so the new bearing can have a virgin surface to run on. I also made sure that the screws holding the bearings are not tightened too much because this leads to tensions, affecting ease of movement. While assembling everything, I made sure that the two belts have about the same tension.

Yesterday the filament slipped off the grooved part of the filament screw while printing, effectively ruining the print. To fix this, I printed a modified version of this filament guide for the Wade’s extruder. I used openSCAD to make the part clip-on so I neither have to remove a screw nor unmount the filament. It does its job good enough.

This video shows printing at 36mm/sec, I could only do about 28mm/sec before. I have not found the maximum possible speed yet.

Then I tried the ultimate overhang test again: This bird

This time I decided to do some cooling by putting a small fan next to the build plate. It worked quite well and cooled enough to remakrably reduce the bending that ruined my previous try.

The problem with the fan is, obviously, that it cools down things. But there are parts that shouldn’t be cooled down too much, like, for example, the hot end / nozzle or the build plate. The cooling caused the hot end to only heat up to about 170°C, which is 15°C below the temperature I found out to work best for this filament.

Further problems and possible improvements:

  • Permanently install a fan to do some cooling and to reduce bending, ideally mounted on the carriage.
  • Shield the hot end from the fan to keep the temperature up and reduce power usage.
  • Buy/Build a new hot-end with more heat output and a smaller nozzle (probably 0.4mm)
  • Improve filament spool holder, probably by redoing the whole thing with a different approach.
  • Increase the stability of the printer frame by adding cross-bracings.
  • Replace the temporary mechanical z-endstop with an opto endstop again.
  • Try a different carriage: one with two bearings on the belt-side or one with a total of four bearings.
  • Circles still don’t always turn out perfectly round.
  • Think about a way to automatically take a picture at every layer.
Sorry, there’s no timelapse today!

Leave a Comment :, , , , , , more...