Montag, 10. März 2014

Public Transportation Display - LCARS style

Last week I read this post about a Public Transportation Display and recognized this is only a few streets away from my home. And more important, I remembered I started a similar project a month ago as I discovered the web app from our local transportation office (live.kvv.de). If you do a proper GET request the server sends you a json file with the traffic information.
My plan was to use one of my Ethernet boards I developed last year for my LED panels (I will post more about this project in a few weeks). But here is a sneak preview of the board:
  • Powered by an Atmega 644p@20Mhz 
  • ENC28J60 Ethernet controller
  • Micro SD-Card Socket
  • FTDI FT232 USB to serial converter
  • Pinheader for an HD44780 LCD Display

Freitag, 21. Februar 2014

The SoundCube


Finally I've got some time to write about a project I finished nearly two years ago. It's a portable music box and it's also a Companion Cube. 
It's created to supply your weekend with your favorite sound and your gadgets with power.

The key features are: 

Speakers:
  • 4x Alpine SXE-1725S
Amplifier:
  • TDA7318 - DIGITAL CONTROLLED STEREO AUDIO PROCESSOR
  • TDA7560 - 4 x 45W QUAD BRIDGE CAR RADIO AMPLIFIER
  • Arduino Mega with 3,5" Touchscreen for volume control and input selection.
  • BELKIN F8Z492CW - Bluetooth Music Receiver

Power supply:
At the top there are two USB ports to charge mobile devices and two 12V car power sockets for additional gadgets. 
To get your music to the speakers there are two channels with analog jacks or you can do it via Bluetooth.  

The audio amp has two parts: the main amp and the digital audio processor. This digital audio processor is controlled via i2c which is done by the Arduino Mega. Well yes, this is a little bit over-engineered but works fine. 

I put the code on github: https://github.com/4ndreas/SoundCube

The speaker grills are of course 3D printed, as well as the mounts for the electronics. 

Even though this is an older project I've collected some experience in the field. The battery runs for at least a full weekend. The sound quality is more than satisfying for this purpose. The only drawback is the weight if you have to carry it to your favorite spot. 

I've got a lot of additional pictures from constructing the wooden frame:

Building the SoundCube




This post contains a lot of pictures from making of the SoundCube.

Donnerstag, 26. September 2013

Expedit Coffee Bar

As the title implies, this is a simple mod to create a small coffee bar out of an Ikea Expedit rack.
I covered the desk with an 1 mm aluminium sheet, also the border is enhanced with an rectangular aluminium stripe. Everything is glued directly to the rack's surface in order to avoid screw holes.

The coffee maker is placed on a more ergonomic level. The stainless steal parts are also from Ikea (CAPITA) .

The lighting is made of an acrylic white plastic and a RGB led stripe. I bought 4 pieces of wood in the local home store, already cut to 33,5x33,5cm. I used my jigsaw to cut holes in each one, glued the LEDs to the wood using hot glue and assembled everything.


I used a self designed controller for the LED stripes. It is based on an ATMega8, and can drive 5-LED stripes. The firmware supports an 8-bit PWM on every channel. To control the lights remotely and changing the lighting mode I used an infrared receiver.  


This shows my test and development board. 


I used n-channel MOSFETs for switching the led stripes to reduce the voltage drop and to increase the efficiency of the board.
This picture shows the controller (and some other boards) after etching. 

To decode the IR-signals I used the great Infrarot-Multiprotokoll-Decoder (IRMP) library from mikrocontroller.net.

This is a demo of my new ethernet Arduino board I'm developing. I attached an IR-LED to the board and wrote a little program with buttons to change the colors. The windows program sends an UDP-package to the Arduino board which generates the IR signal. The LED controller receives the IR signal and sets up the light correctly.

In the future I plan to develop an Android app to switch the lights. 
The final installation is not very spectacular. As power supply I used an XBOX 360 HD-DVD drive AC adapter, which was left from salvaging the blue laser diode years ago.

As usual you can download the board files form thingiverse:
http://www.thingiverse.com/thing:156555

Sonntag, 8. September 2013

Building a small (Gaming-) KeyPad for StarCraft 2

A month ago or so I started playing StarCraft 2 again. I'm not really good at it, actually, but it's fun to play with my friends. I've never ever got used to the hotkeys, most of my refuse to practice. As an engineer I've tried to solve problems by creating tools, not to practice stupid routines. The grind hotkey system seems a good idea, but it if you think about it, there is a serious design fault. As a right-handed person you have to use the left hand for the hotkeys. The grid on the screen is on the right side and the most used keys are on the left. This means you have to use your little finger for the most common actions - that's not very comfortable. 
Another thing is that switching between right and left shift is not very intuitive. 
My idea was to mirror the grid on a special keypad. Mostly, you think from the middle of your view to the outside. The same is true for your hands. The index finger means center, the little finger is your outer side. 

It's totally stupid to shift the hole grid to the left.
For the brain (at least for mine) it's much easier to mirror the action, because we are always thinking from the center of our view to the left and the right side. 

After thinking about this I wanted to try it. So I decided to build a programmable mini keyboard. And this is the result:


First I salvaged some old Cherry-MX keys from an old keyboard. This was indeed cheaper than buying the buttons.



The case is fully 3D printed. The cover for the electronics is made of carbon, I personally like the way it looks. I even added folding feet to change the angle of the keypad.


 

For the future I plan to paint the buttons with somekind of rubber paint, called "PLASTI DIP". Thats a rubber like paint witch give the surface a very good grip.


The design is a simple matrix. Because this is a "gaming" device, every single button should be pressed at the same time. This means you need a diode for every button.



I used six of these PCB slices for the buttons, the last two rows are a little bit different, due to the different size of the key caps, though electrically the same.

The finished button matrix: 
Due to the fact the SMD-Diodes didn't arrive at time, I've soldered the normal ones out of my personal stock in. It's always a good idea to buy at least 100 pieces of the most used common parts. 


 

This shows the overall wiring of the button matrix and the USB-controller board:


The thing is powered by an ATmega8U2. These little guys come with a preprogrammed DFU bootloader. To use it as a HID-Device I used the LUFA-USB Framework. I just had to edit the Keyboard Demo a little bit. Unfortunately the Atmega8U2 has only 8kB of flash. The preprogrammed bootloader uses already 4kB and the USB stack another 3, there is not much left, but enough. Originally I planned to add a virtual serial port to edit the keyboard layout, but after adding the keyboard functions I have only less than 400 Bytes left and I'm not sure if this is enough. 

For now if I hold the upper left key pressed while plugging it in, the original Atmel bootloader comes up and I can flash it with the FLIP-Programmer. This can be done by an easy jump:

void (*bootloader)( void ) = 0x0800; // Address is in Words not Byte !!!!
          
void BootloaderCheck(void)
{
   readButtons();
   if (BootButton)
     { 
     bootloader();
     } 
}
I thought this would be interesting because I did't find so much about how to use the the bootloader of the ATmega8u2 and I tried a lot until I got it to work.

The keyboard layout can be easily edited by changing the values in the array:
uint8_t KeyTable[6][6] = {
 {HID_SC_0, HID_SC_9, HID_SC_8, HID_SC_7, HID_SC_6, HID_SC_ESCAPE},
 {HID_SC_1, HID_SC_2, HID_SC_3, HID_SC_4, HID_SC_5, HID_MO_LEFTALT },
 {HID_SC_T, HID_SC_R, HID_SC_E, HID_SC_W, HID_SC_Q, HID_SC_TAB },
 {HID_SC_G, HID_SC_F, HID_SC_D, HID_SC_S, HID_SC_A, HID_SC_BACKSPACE},
 {HID_SC_B, HID_SC_V, HID_SC_C, HID_SC_X, HID_SC_Z, HID_MO_LEFTSHIFT},
 {0x00,    0x00,  0x00,    0x00, HID_SC_SPACE, HID_MO_LEFTCTRL}
 };


Conclusion:

Back to the original intention: playing StarCraft 2. I played some games with it and you learn using the hotkeys incredibly fast. As I thought the mirrored grid is very intuitive. You don't have to move the hand as much as if you use the normal hotkeys and with the two rows of numbers, every short group is easily reachable. The rectilinear grid of the buttons is more ergonomical than I thought. 
Over all I like it (and it was fun to build a keyboard ;) ), even there is now a little space problem on my desk:


I put the 3D-Files, the PCB and the Sources on thingiverse:


Freitag, 7. Juni 2013

My new LaserCutter (technical details)

A lot of people asked me about additional information about my laser cutter project.


The Laser Driver, is based on the A 1 MHz Analog Laser Modulator Based On LM317 Regulator. I planned to build a Laser PCB Exposer like this one. But after some calculations I was not longer convinced that it would provide satisfying results in resolution and usability. I canceled the project and the laser with driver was unused for more than a year.

However, the driver has some serious disadvantages for this use case.
First of all, if the Atmega (Arduino) is booting up, all pins are high-Z - this is enough to power the laser, not on full current but it is damned bright. I highly recommend to build another driver from Sam's page. The analog modulation is not necessary, neither is the switching time.

Secondly, a current monitoring by the Arduino would be nice maybe even current controlling. I think this is worth to invest some time in.

Thirdly, no emergency switch-off or at least a second enable pin.

The Laser itself is a 445nm Diode I've purchased for about 50€. It was labeled 1000mW, but I don't believe it will run this long on that power output.

Now to the mechanical part. I don't feel comfortable by releasing the complete design because I'm not happy with it. It was very quickly done and has a lot of disadvantages. The worst part is the swinging of the Y-axis.

I think, a possible solution is a second belt, but this increases the cost and complexity of the device.
The belts are just fixed with cable ties and some other nasty hacks. If you really want the design, email me and I will send you the files.

I used Skeinforge to generate the G-Code.

I added a M103 to turn off the laser and a M101 for turning it on. So you have to add these two commands in the Commands.cpp file of the firmware:


      case 101: // M101 Laser ON
        wait_until_end_of_move();
        digitalWrite(5, HIGH);

        codenum = 100;        // Wait vor 100ms for the Laser to burn though the material.
        codenum += millis();  // keep track of when we started waiting
        while((unsigned long)(codenum-millis())  < 2000000000 ){
            gcode_read_serial();
            check_periodical();
          }
 break;

      case 103: // M103 Laser OFF
 wait_until_end_of_move();
 digitalWrite(5, LOW);
        break;

I hope some of you found parts of this entry useful.