Sunday, February 27, 2011

Micropendous Is Awesome!

Man, I wish I did this earlier! Actually, I though of doing this before, but had a feeling it was waaay out of my league, and too expensive. In a way, it is true, but given what I know now, it would probably have saved me money and time!

Since I've decided to create my own PCB, I also decided to build the board independently of other development boards. This will reduce cost, and make the whole thing smaller. Besides, it's cool!

Thankfully, I've found this OpenHardware project Micropendous which uses same components as the Teensy. This helps a lot, because I've been developing and based my code on the Teensy, which really just is a breakout board for some cool AVR microcontrollers. However, with Micropendous I'm able to modify the hardware and layout to suit my needs. For instance, I don't have any need for breaking out all those pins on the microcontroller to header pins, because I will use them internally, hooking up the sensor with it. I can also add LEDs and place them where I want them.

This cool thing dropped in my mail the other day:

Micropendous device


I can't thank this guy enough for his useful, fast and great help! Since I'm planing selling this thing, I want to create something of quality, and since this guy really know his stuff, and have helped me developing the new PCB for this project, I know the end product will be even better than if he didn't. Big kudos to him.

I've spend many, many hours now in KiCad, and, I must say that it's a fantastic program! It's also open source and free to use. There is a bit of a learning curve, but if you use Micropendou's already created KiCad projects, you will learn a lot faster than starting from scratch. There is also a bunch of KiCad tutorials on YouTube.

Man, just look at those Micropendous boards, intense and beautiful made:

Example of PCB layout - 1 layer shown.


In 3D view.

Just look at the routing here:Bad ass routing!


You really start to respect people that creates these boards. Just look at motherboards for instance. A lot of effort goes to create them, and they usually use 8 layers! That is trippy! These boards here use 2 layers.

Anyway, I'm currently in the process designing the board where I will most likely let MyRO PCB fabricate and assemble the board! Also, I was planing to use CNC Machine Shop to create an enclosure for it! That's right, create a quality product!

Saturday, February 12, 2011

PCBs - When you want to save time

This is what dropped in my mail the other day. Thanks to the guys at Cogra.se, I now have this board. Yes, been busy creating this layout based on what I've done by hand before. With this, I can just add the components and get this:



And guess what, IT WORKS! Man, does that feel good! The layout made saves me huge amount of time. Because of this, I'm seriously thinking replacing the components with surface mount ones and even let it be assembled where they create the board!

Now I'm wondering, Why didn't I do this earlier! Instead of investing in rotary tools etc...

I was planing doing PCB boards later, when it was more finished, but there exists good services out there that can do this for alright prices... so, why not start doing it already... That way, I will also have a product that I can test and when it is "perfect", sell it for others interested in buying it. That is, actually develop on what I will sell directly, instead of doing it twice...

Friday, January 28, 2011

Motion Data v2

Well, look at that! Obviously, some filtering has to be made. No surprise there really. I would love the raw data actually not giving me those noise values, but that only works in a perfect world I guess. However, increasing it's height from surface improves the data as you can see, and those peaks really are far and few in between! Shouldn't be a problem at all filtering that out.

It's also obviously working at higher jogging/running speeds as the second graph shows... Although more noise, but still really only a few. Who will run forever anyway? :)

Sunday, November 14, 2010

Life in Motion


So, this is a graph showing an example of me walking and then jogging on the treadmill using my device (negative is correct, as forward motion becomes a negative value apparently). Previous graphs were even more radical like the one on the right here, but putting it up, higher from the surface seems to solve that pretty well. I will see if I can improve this further, otherwise I will solve it in code by applying some kind of filter. Note that this is raw data from the sensor, so I guess some kind of filtering needs to be applied anyway... But this is really looking good I must say! Note also that the positive peaks are really few, compared to all the samples made.

Sunday, October 24, 2010

Motion Problem Now Resolved!

So, this is the first prototype using the better ADNS-9500 mouse sensor.

Few months have gone by now mostly because I have done everything I could think of, asked around, trying to solve the issue I had. I have actually thought this could be the issue a few times, but what can one do. The problem I had was that whatever I did, I couldn't get any motion data. The SPI worked, as I could get product id and such, but when I moved the sensor, I got nothing. As you can see in the image to the left, I have highlighted the component that is to blame for it all. This tiny, 1.5mm MOSFET wasn't properly connected (either not soldered properly, or damaged during soldering), and thus the Laser didn't get any voltage, and thus the sensor couldn't detect any motion. This is all solved now, in another prototype I've build, build like the one in the image, but using a similar MOSFET and this SOT23 to DIP Adapter.

So now, finally, the fun starts! It feels like a heavy weight has been lifted, and I can now finally continue with this project! I've actually started with the coding already and even started to create graphs based on the motion data I get...

More images and progress will follow...

Friday, July 9, 2010

Prototype #1


One would think nothing happens here, since the post are so sparse, but I have actually been too busy with this to post anything. The one in the image, is one of the two prototypes I have build using the older sensor. Works pretty well. After a lot of smacking head against the wall, I finally had expected results showing up. I have also build a new prototype based on a better chip than the one showing in the image. The one in the image can handle walk speed, but will not work properly for running speeds. It can handle speeds up to around 1.6m/s. I am currently about to solder the new prototype together, and will reuse most of the code I've made for this prototype! More about the new prototype in the upcoming posts...

If you start walking and have some debug information showing using this prototype, you get something like this:

7 6 5 4 3 2 1 0
0x20 0b 0 0 1 0 0 0 0 0 --- No motion

7 6 5 4 3 2 1 0
0x00 0b 0 0 0 0 0 0 0 0 --- X motion

7 6 5 4 3 2 1 0
0x00 0b 0 0 0 0 0 0 0 0 --- Y motion


7 6 5 4 3 2 1 0
0xA0 0b 1 0 1 0 0 0 0 0 --- Motion detected

7 6 5 4 3 2 1 0
0x01 0b 0 0 0 0 0 0 0 1 --- X motion

7 6 5 4 3 2 1 0
0x02 0b 0 0 0 0 0 0 1 0 --- Y motion


7 6 5 4 3 2 1 0
0xA0 0b 1 0 1 0 0 0 0 0 --- Guess

7 6 5 4 3 2 1 0
0x0E 0b 0 0 0 0 1 1 1 0 --- X motion

7 6 5 4 3 2 1 0
0x1D 0b 0 0 0 1 1 1 0 1 --- Y motion


7 6 5 4 3 2 1 0
0xA0 0b 1 0 1 0 0 0 0 0 --- Yo mama

7 6 5 4 3 2 1 0
0x0E 0b 0 0 0 0 1 1 1 0 --- X motion

7 6 5 4 3 2 1 0
0x2A 0b 0 0 1 0 1 0 1 0 --- Y motion


The first byte (0x20) is from an address showing among other things if motion is detected. Next byte is X motion and next is Y motion. As you can see in the example here, bit 8 (7) is set in that address when motion is detected by the sensor. What I do here is just printing these addresses in an infinite loop, and you get the above when starting to move on the treadmill...

Sunday, April 25, 2010

Teensy 2!


This little thing is damn cool!

I have now been diving into micro-controllers, registers, timers, interrupts... all that to make the multicolored LED dim! Turning the LED on or off is easy. It's hell of a lot more complicated to make it work between on and off. To turn it on or off, I just have to activate some pins. To dim, timers and interrupts are used to create a PWM (Pulse-Width Modulation)!

I'm waiting for the sensor to arrive, but the wait is good, because I can use the time to learn more about this electronic stuff. I just love how it all works with the Teensy. Hook it up with USB to power it, and be able to flash it. You flash with a simple program by just pushing the button on the Teensy! You do the code in C (or assembler if you want). The compiler creates a .hex file, which is used to be flashed onto the device. It's all quite simple, thankfully! This means you can put more effort in how to actually use it, which takes time if you haven't been doing much of this before. But, with my background, and ease of learning, I will figure it out eventually. Also, there is Internet you can use for resources...

I also love how the thing can pretend to be any kind of USB device! It's all up to what you program the microprocessor to tell what it is when the handshake is taking place between the HOST (your computer) and this device. This will solve the driver issues and mouse issues explained before.