CoffeeBreak Tutorial #4: Windows Phones on Ubuntu 12.04LTS

 

I have a Nokia Lumia 520 device that fails to enumerate as a USB Storage on my Ubuntu 12.04 LTS desktop. Things are not as plug and play it seems. I have been using the skydrive( *cough* OneDrive ) route to access media for a few weeks until today i sat down to fight the issue Running..

lsusb

shows:

nokia1This means the Linux knows that we have a nokia mobile phone! But it doesnt provide a file access to it.

A little dig shows that ‘modern’ ‘smartphones’ use MTP (Media Transfer Protocol) to transfer data ! Its a modified Picture Transfer Protocol.. Ubuntu 12.04 has no ‘native’ support but Ubuntu 13.04 does have it.

So, 2 options :

  1. Install 13.04 (rather upgrade)
  2. Find a work around

Well it turns out there is a PPA called GVFS (Genome Virtual File system)-MTP( Media Transfer Protocol) that can be installed to help nautilus get the device! This surfaced when some android devs were getting issues working with MTP on Android 4.0+ .(Does anyone care about WP8 anyway? )

The commands/steps are:

  1. sudo add-apt-repository ppa:langdalepl/gvfs-mtp
  2. sudo apt-get update
  3. Run the update manager and install update
  4. Restart
  5. Plug the Lumia
  6. It must show!

So, i followed the above link and after a bit of restarting the device finally showed up!

nokia2

But i was not quite able to access it as it failed to mount the device repeatedly. I replugged it a couple of times and went to Terminal and typed natilus and then it got mounted! I was able to access the SD Card and phone memory without issues.

nokia4

The read(copy from device) and write( paste to device) both operations worked!

nokia3But there was no thumbnail preview ! If you want to view an image just copy paste it somewhere outside the device to view it.

Hope this helps the small niche of people who have a WP8 based phone and have an Ubuntu System !

Cheers!

 

 

CoffeeBreak Tutorial #3:The Easy Peasy Stepper Driver/Stepper Motor Test Circuit

 

Stepper motors are quite widely used for CNCs/3D Printers or other Electromechanical hacks like the polar plotter etc. ! There is as always a constant need to run the motor to check whether its aligned properly or not? Does the flex coupling has any issues? Is the driver dead or alive and the best one- whether the current setting is fine to generate enough torque to hold or move the lead screw.

Pestered by the same above questions i wanted to build my own driver/motor tester overnight and it ‘must’ be microcontroller-less since there is no actual use of a controller here! I stumbled open this awesome project that i saw on Hack-A-Day.

It uses an ATiny AVR microcontroller which is (no offence to the author) an over-kill as most modern stepper drivers like the ones from polulu  need just two signal i.e STEP and DIR.

A pulse on step pin will initiate a step to the internal indexer that handles what coil has to be energized based on the sequence and micro-stepping settings, while the DIR is a level signal whose level decides whether the internal indexer of the driver counts up or down!

So, only two inputs i.e Pulsed input for STEP and level input for DIR. This can be achieved using the 555 timer in the astable mode. The Output of 555 i.e pin 3 will go into the step pin and the DIR pin is pulled up using a resistor and it is also connected to ground via switch.

This gets the job done! We can also have a POT to vary the frequency since some motors dont respond to faster pulses due to rotor inertia.The driver i am using is based on DRV8825 from TI. It is slightly wider than the polulu one. (You might call me a TI fan boy 🙂 )

With the designing almost final , I grabbed a piece of perfboard since, i didnt had the time to etch the board.

The circuit is as follows:

final

It has two power inputs 12v, 5v and a common ground, all of which are sourced from an ATX! The circuit itself is pretty simple.

The final build on a 8mm perfboard is shown below.

perfboard1

PERF

I chose to use a SMD 0603 10K resistor between pin 8 and 7 to reduce the space and connected 104 (0.1uF) Ceramic caps as shown. The switch is a 10xx and the capacitor is required at the input of stepper driver to reduce supply dips when it draws current. I have used female headers for the motor since most motors come with a connector that can be easily wired up with a single strand wire. I used the Power Terminal connectors for the main 12V Driver supply as the driver is rated for 2.5A which is too high for the usual jumper cables !

top and bottom
 

TIP: If you are using the non-tinned/less tinned headers that have been lying around in the component box for a while, make sure to rub the connectors using sandpaper to remove corrosion residue on the contacts else it might seem soldered but it wont actually be soldered. Also you may use some extra flux.

Video:

Cheers !

Rohit Gupta