Wednesday, 6 November 2013

Starting the Raspberry Pi project and experimenting

Starting with Raspberry Pi


    After reading a bit on the net and checking a few projects done by others - I decided to play also with this board. Why "also" maybe you are asking yourself now. Because I have a lot of other things to play with also and this is just another experience. This is what I thought in the beginning. Now after I have the first implementation running I totally changed my opinion. This is not just a board - there is much more out there - like a lot of software developed for it and a lot of nice projects done with it. Most importantly this project has a lot of potential.

How to start up with raspi

    There is a lot of information on the net. But let's be exact - you need :
  1.  Raspberry Pi board, I prefer model B because it doubles the RAM for the same price
  2. SD card, the faster the better, I took 16GB class 10 ( 30 MB/s )
  3. Good power supply - 5V / 2A at least because you need to power up also your additional devices.
  4. HDMI screen and HDMI cable, good cable is important!
  5. USB hub, no, sorry, you can avoid it, I will explain later why
  6. USB mouse and keyboard, as standard as possible
  7. Additional devices depending on your project. I took USB HD web cam
    The list above is actually the absolute minimum.

HW dependencies - be aware !


    There is a big list with compatible devices and also issue list describing what other users experienced with their raspis. I strongly recommend you to check this before ordering any HW!


Get the schematics from here.

Please, take care to check this before starting.

    I started trying to install Raspbian with my wireless mouse and keyboard, 2.4GHz wireless USB package from A4 Tech and I found out that they are not compatible, so I needed to look for more "standard" components. Interesting thing is that the mouse did worked for NOOBS and then later on when Raspbian was installed it stopped working. Maybe missing drivers, maybe power supply problems ...

    Other thing I found out the hard way was that some SD cards have problems. The particular one I choose - SanDisk 16GB Ultra 30 MB/s is actually one of those SD cards with resizing problems. The package NOOBS 1.3 which is available as ZIP archive do not work with this card. The issue is already reported by other users - after installation is done it reboots and hangs up in the bootloading, nothing works so there is noting you can do. I had to download the network install package and to install NOOBS 1.3.1 which is already patched for this card. Network install took just a bit longer then the zipped package, so if you have a normal i-net connection ( I have ISDN 10 MB/s, which is actually quite slow ) it is maybe better to go directly this way and not to bother yourself downloading a ZIP of over 1GB. In my case the network setup went straight forward, I have WiFi ISDN modem with DHCP - it was all done automatic and just worked. Only thing I had to do was to connect the Ethernet cable.

    Power supply implemented in Raspberry Pi is totally wrong by concept. I was about to write very harsh on this topic but then I read about the history of raspi and about all the compromises that had to be done in order to have it at that price. So I decided to keep the critics away and to provide you with DIY description how to overcome this problem. This will be a big part of this post.

    HD web cam - there are plenty of them available now. Just check the compatibility list before you order. I bought Microsoft LiveCam HD-3000 because it is small, does not have adjustable optics and I read good reviews about it. I plan to use it as fixed position surveillance cam - so this is a very good choice for me. In the list it is listed as not compatible and having some issues with update rate. I guess this was again a power supply issue or some software issue which was later fixed because for me the camera worked fine.

    USB hub - unfortunately you are not able to skip this expense, the board has only 2 ports and if you want to connect both mouse and keyboard they will be occupied. Many people use powered hubs in order to overcome the power supply problems. Some even power the raspi also from the hub. This might seem to be OK, but it is not because it may create a problem. Many hubs are reported leak current back to raspi through the USB ports. Those hubs are usually bigger, i.e. 7 or more ports, and expensive. Here in EU, in Media Markt the cheapest product available was above 20 euro. So I decided to make my own "powered" hub. I bought Belkin F4U045, 4 port USB 2.0 mini hub. Modification was trivial.

Power supply rework


    First thing that come to my mind when I read that I have to supply the board over the micro USB connector was "This is never going to work for me!" and I was indeed right. The small connector is so bulky that I will loose power each time I move the board or if in accident I pull the cables it will rip off the whole connector out of the board and damage it beyond point of repair. Natural solution is not to use the micro USB. Unfortunately the designers left no other option but to solder wires yourself. This is not a safe procedure, so I looked for a place, connector or part lead which can be easily accessed to allow as safe as possible soldering.

Schematics, Raspberry Pi model B


 Red and blue hand drawing mark the good places to solder additional wires in order to supply the board directly.









    If the positive supply is connected before the fuse as shown above it will keep the protection circuit more or less intact. This might have impact if you want to power additional devices from on board 2 USB connectors. One must keep in mind that there is no over-current protection on those ports, yes, they are connected directly to board's +5V rail and all the current is going to pass trough the fuse. In some cases is better to bypass the fuse and to be able to supply more current without danger to blow it. I decided to use a powered hub so there is no obvious reason to supply high current from raspi's USB ports - therefore I kept the fuse.

Schematics, Raspberry Pi linear voltage regulators



     I mentioned above that I will keep my criticism away, but I cant's stand to not mention this. The schematic on left is the on board power supply done with linear voltage regulators - very inefficient solution! Let's take the 3.3V rail as example - 3.3V/500mA out of 5V supply will waste 0.85W in a form of heat dissipation. SMPS regulator would be an elegant solution here.








  
   This is a good place to solder the GND wire - the GND lead of the RCA ( analog ) video connector.


















Connect the wires as shown on the picture. Use wires with proper size.

    Power supply is arranged around a standard "chinese" brick LM2596 which I obtained from eBay. It has a nice red LED and 3A maximum current. It is supplied by a standard 12V/1A line transformer.



The whole system including reworked powered USB hub.

    The system was attached to a piece of cardboard to keep the parts at position and to avoid shorts and messy arrangement. Attachment is done with wires from UTP cable, blue wire visible on the picture.

USB Power hub rework

    Powered hubs are usually much more expensive then conventional ones - this can be explained with extra components and design efforts required to make a good powered hub. My goals were just to extend the raspi's USB capabilities and to avoid power overload through the board. Those simplified requirements can be easily satisfied by a simple modification done on normal USB hub. I choose to use a 4 port hub and just add external power supply. Power connection from USB cable is removed, so the hub do not return back current over the +5V line. VDD and GND wires are soldered to a big SMD cap achieving stable connection to PCB and good filtering.


USB hub after +5V wire is removed and a "big" cap was attached in its place.


    Back side of the PCB to show the power connection. Red wire is obviously +5V, green wire is GND. If you cut the plastic enclosure a little bit you will be able to close it with the extra cables.

Stay tuned for the next post where I will describe the first application - web cam.


No comments:

Post a Comment