Archive for the ‘My Book’ Category

So you were lucky enough to receive a Raspberry Pi for Christmas or perhaps you’ve had one a while and wasn’t too sure what to do with it then read on for some tips on how you can do more with this wonderful little computer.

1. Add a Wifi Adaptor

Even if your Raspberry Pi is a model B or B+ (which has a built in network connection) going wireless can have many advantages.

RaLink Wifi Adaptor

Not only does it make it easier to setup your Raspberry Pi in a location which is convenient for you (you don’t need to be next to a network socket or your router) but it means if you are using your Raspberry Pi remotely i.e. without a screen (see my Guide to Remote Connections) you just need to add power to run.

Model A Plus Wifi Setup

A Wifi adaptor will require some additional configuration, so be prepared to set it up before you use it (also be warned that you must plug in the Wifi dongle before you power up the Raspberry Pi – particularly for the older models – otherwise it will cause the Raspberry Pi to reboot).

The Pi-Kitchen can help greatly with the Wifi setup and can allow you to configure everything up front so when you install via NOOBS it will work immediately!

Although remember, if you are using an older model B or a model A (or A+) adding a USB Wifi dongle will take up a USB socket, so you may be limited to using either a mouse or a keyboard (or neither on a model A/A+).  However there are ways around this limitation too:

  1. Use a USB hub (ideally a powered one)
  2. Use a wireless keyboard and mouse set since they typically have a single USB wireless RF dongle for both
  3. You can also use a bluetooth keyboard/mouse – but remember you will need to configure these with the Raspberry Pi before you can use them.
  4. There are also keyboards which have a trackpad built-in (in place of the number pad), these use a single USB connection so are rather handy for the Raspberry Pi.

keyboard

2. Get a dedicated screen

ScreenSetup

Generally if you are planning on using the Raspberry Pi with your kids, then having a dedicated screen you can setup specifically for their use is by far the best solution.  Don’t forget that the whole idea of having a cheap computer is so that kids can experiment freely with it without worrying about causing damage to expensive parts or hogging the use of the family computer/TV.

TIP: For particularly young kids it can even help to have a 2nd setup for you to use, that way you can go through the same steps as them and if they get stuck demonstrate the answer.  By having a 2nd setup (even if you use a laptop and remote connection) you avoid the temptation to take hold of the mouse or keyboard and do it for them: you can show them and they can copy.  That way the sense of achievement is far greater as everything they do has been totally their own work.

When the Raspberry Pi was first released HDMI to VGA adaptors were rather expensive, bulky and often required external power.  This typically meant the best option was to find a screen which supported HDMI (such as a digital TV) and use that.

HDMI to VGA Adaptors:

HDMI2VGA

However these adaptors are now relatively cheap (£8 or less) very compact and will run directly from the Raspberry Pi.  These low cost adaptors are ideal if you have a spare screen available or an old computer, as HDMI compatible monitors are still quite expensive and it probably overkill to run a £30 computer with.  You may even find that your IT department or a local company will have unwanted VGA monitors or screens available, as newer PCs no longer support analogue connections they will still be ideal for the Raspberry Pi.

You may need to use slightly different settings with these adaptors, the config.txt file controls these settings (initially you can use hdmi_safe=1 to check everything is working).

disable_overscan=0
hdmi_drive=2

config_hdmi_boost=4

For more details see config.txt file.

 

 

 

DVI to VGA Adaptors:

6623OT_01_003

If you have a screen which supports DVI-D even better, as HDMI to DVI-D adaptors are around £2 at most and generally will result in a better signal (by remaining as a digital output).

Also remember if you use an adaptor for the HDMI output to convert to DVI-D or VGA audio will not be provided by the monitor so you may need additional speakers for sound (or a suitable cable if your screen has built-in speakers).

Again, there are a few other alternatives for display output:

Analogue Output:

The Raspberry Pi does have an analogue output (which can connect to older TVs though composite and SCART connections) but for most situations the display is low resolution and hard to see.  I would not recommend this method for general use except as a fall back when configuring things.  When using the Raspbian desktop you find that most programs will not physically fit on the screen making it impossible to click dialogue items or use them effectively.

Gert VGA Adaptor:

The Gert VGA adapter board is available from PiSupply (click on image to go to the shop).

The Gert VGA adaptor board is available from PiSupply (click on image to go to the shop).

This little board plugs (designed by the Raspberry Pi foundation’s Gert-van-Loo) directly onto the newer Model A+ or B+ Raspberry Pi GPIO header and allows you to drive a VGA monitor directly from the Raspberry Pi itself.  This allows you to connect directly to a VGA screen and also supports a 2nd display (via HDMI for example).  However it does use up most of the GPIO pins (4 are left over which can still used for hardware).

Note: If you have an older Raspberry Pi model (Model A or Model B) then this adaptor will not work (it required the newer 40 pin GPIO connection).

Use Remote Connections:

By using VNC, X11-Forwarding or SSH you don’t even need to have a screen (see my Guide to Remote Connections).

However, it is always helpful to have a screen available for those times when there is a problem connecting to the Raspberry Pi and you need to trouble-shoot the issue (you will fix your problem much quicker if you can see what is happening).

Generally if you are planning on using the Raspberry Pi with your kids, then having a dedicated screen you can setup specifically for their use is by far the best solution.  Don’t forget that the whole idea of having a cheap computer is so that kids can experiment freely with it without worrying about causing damage to expensive parts or hogging the use of the family TV/computer.

TIP: For particularly young kids it can even help to have a 2nd setup for you to use, that way you can go through the same steps as them and if they get stuck demonstrate the answer.  By having a 2nd setup (even if you use a laptop and remote connection) you avoid the temptation to take hold of the mouse or keyboard and do it for them: you can show them and they can copy.  That way there is a far greater sense of achievement as everything they do has been entirely their own work.

3. Get some educational resources!

Everyone needs to start somewhere and using some of the vast array of resources available is an excellent way to get started.

The MagPi Magazine

There are 30 issues of the MagPi available covering over 2 years of  the Raspberry Pi.

There are 30 issues of the MagPi available covering over 2 years of the Raspberry Pi.

This community led magazine is available for download for FREE from the MagPi website, and is a perfect resource for those starting out with the Raspberry Pi and also to get some more advanced ideas too.  You can support the MagPi by purchasing printed versions of the magazine from the many retailers (see the site for details).

Raspberry Pi foundation educational resources

The Raspberry Pi resources are split into three sections: Teach, Make and Learn.

The Raspberry Pi resources are split into three sections:
Teach, Make and Learn.

The Raspberry Pi website has a whole section of resources available, a perfect place to get started and learn the basics of using the Raspberry Pi and starting your own projects.

Get a book

For those bigger projects and a more complete guide a good book makes an excellent resource.  Ideally you will find that you will often find the solutions to what you need just by grabbing it off the shelf and looking the answer up (a good reference book will keep being useful long after you’ve read it once).

There are lots of great Raspberry Pi books out there, but I would like to recommend my own one as a comprehensive guide to what you can achieve with the Raspberry Pi.

Raspberry Pi Cookbook for Python Programmers

Get the most out of the Raspberry Pi and unleash its huge potential using Python.

You can read more about in the sections above on this site, and also see what other’s think by reading the excellent reviews (of which I am very thankful for) I’ve had on Amazon.  The book is also available from other retailers, or direct from the Packt website.

4. Get started with hardware

The Pi-Stop

LogoDesignVertOp

As any hardware or embedded software engineer will tell you, the first step to any project is to get some lights flashing.  For kids the ability to control something which they can physically pick up and handle is a huge incentive and can make following guides and tutorials far more engaging.

Pi-StopGuides

The Pi-Stop is an excellent starting point, fitting directly onto the Raspberry Pi it provides a excellent starting point for interfacing with hardware on the Raspberry Pi.  There are lots of resources available to get you started and also a number of workshops and tutorials to follow.

Python Pirate Workshop Setup - 3 small treasure chests, 1 large (with gold coins), Combination Padlock, 4 Raspberry Pi with Pi-Stops (plus PSU/SDCards), Maps and Worksheets

The Pi-Stop was jointly designed by PiHardware (this site!) and 4Tronix as a low-cost and easy to use add-on for workshops and home use.  Of course once you’ve got used to controlling hardware they are excellent for debugging and indicating different operations while the Raspberry Pi is running, and can also be used with other micro-controllers too.

They are available from 4Tronix and now also from CPC (Farnel).


More tips to supercharge your Raspberry Pi coming soon!

PIHWlogoTM

Breadboard & Components Hobby/Education Kit for Raspberry Pi (Chapter 6 Hardware Kit)

 

The mini breadboard kit includes some of the components used in Chapter 6 of my book, plus are ideal for a number of starter projects (traffic lights, RGB colour mixing, timed response challenge, memory game etc).

The mini breadboard kit includes some of the components used in Chapter 6 of my book, plus are ideal for a number of starter projects (traffic lights, RGB colour mixing, timed response challenge, memory game etc).

__________________

Mini-Breadboard Kit

The mini-breadboard kit includes all the components needed to complete several small hardware projects.  This kit is intended to provide all the parts you need to complete the following recipes from my book:

  • Controlling an LED
  • Responding to a Button
  • Controlled Shutdown Button

Add a Self-Solder Combo Kit

The Mini-Breadboard & Self-Solder Combo Kit contains everything to complete all the examples in Chapter 6 of the book, including two self-solder kits (the RGB-LED and D-Pad modules used in the more advanced recipes).

Mini-Breadboard & Self-Solder Combo Kit - For everything in Chapter 6

Mini-Breadboard & Self-Solder Combo Kit – For everything in Chapter 6

The Mini-Breadboard & Self-Solder Combo Kit contains everything to complete all the examples in Chapter 6 of the book, including two self-solder kits (the RGB-LED and D-Pad modules used in the more advanced recipes).

RGB-LED Kit B (Includes GPIO Cable)

Used in the following sections in Chapter 6 of the book:

  • Multiplexed color LEDs
  • There’s more… Hardware Multiplexing
  • There’s more… Displaying random patterns
  • There’s more… Mixing multiple colors

There are also lots of lessons already on the site for the RGB-LED kit

D-Pad / Game Controller Kit B (Includes GPIO Cable)

Used in the following sections in Chapter 6 of the book:

  • The GPIO keypad input
  • There’s more… Generating other key combinations
  • There’s more… Emulating mouse events
  • See also – Can also be used with the game examples created in Chapter 4
I hope by providing these kits people can try out all the examples and material now available, and enjoy using hardware and electronics with the Raspberry Pi.

See the Breadboard & Components Kit (Ch6 Kit) product page for more details, or the Shop to purchase.


Note regarding the hardware in other chapters of the book:

I currently do not have plans to release kits for the other chapters 7, 8, 9 and 10.  This is because these chapters mainly make use of existing hardware modules which are available to buy directly from other retailers.  If I were to stock all of the modules used I would need to buy for them for the same price and then add extra (to cover my time, cost of stock etc etc).  I would have to take an existing product, add a markup and sell it on.  Unfortunately I don’t have the time and resources to do this cost effectively, therefore, it would not provide good value for money for people.

The book contains details on the places which stock the items, but let me know if you have difficulty getting a particular item so I can find an alternative and provide details on the website.


 

From the book…Stop-frame Animation!

I learnt so many new things during the course of writing the book, many of which I wanted to share with my kids to enjoy (but due to the tight deadlines this was often not possible).

Now that the mammoth task of the book has been completed it I thought it only fair I spent some doing some of the activities with them.

Early Saturday morning, ready for the workshop!

@Bristol Science Center is an excellent place to visit

As it happens, we visited @Bristol a few weekends ago (readers of previous posts will know this is the home of the Bristol Digi-Makers events, which we attend for the MagPi stand), this time though we were visiting the science center which is its main purpose.

We had a fab time, but it was an ultra busy weekend so we were unable to have a go on the Aardman Animation desks (Aardman amongst other things were responsible for Nick Park’s Wallace and Gromit).

Thankfully, it is something which a Raspberry Pi with a camera module can achieve and one of the things I’ve been wanting to do anyway.

Chapter 8 – Creating Projects with the Raspberry Pi Camera Module – Recipe – “Creating a stop frame animation”

The project was done using “Chapter 8 – Creating Projects with the Raspberry Pi Camera Module” of my Raspberry Pi Cookbook for Python Programmers book, which has a full recipe called “Creating a stop frame animation”.

Find out how we got on at the following page…Ch8…Example: Creating a stop frame animation

PIHWlogoTM

D-Pad / Game Controller Learning Module Hobby/Education Kit for Raspberry Pi

D-Pad

 

This kit is one of the hardware items used in Chapter 6 -Using Python to Drive Hardware of the new book.

For more details, see the product page and visit the PiHardware shop for details on how to purchase it.

D-Pad Controller

This will allow us to cover inputs in some new lessons.  Also, the user manual includes example code to allow you to map keyboard commands to the D-Pad buttons, converting it into a handy little game controller or keypad.

As always, the kit comes with an extensive user manual with clear and detailed instructions, explaining the design and function through to assembly and testing.

So with or without the book the kit should make an excellent project.

For your comfort, a thick foam backing is supplied for those extended gaming sessions!

ALSO:

I would like to add, that it has undergone extensive testing with the Spectrum version of Bruce-Lee (Datasoft/US Gold 1984), via Fuse!  Many an hour spent completing the original game some time ago.

The book was published at the end of last week, and the eBook version is available to purchase and download immediately.

The printed version of the book are also available to order, see the site for delivery details.

Packt Publishing: Raspberry Pi Cookbook for Python Programmers

Purchase links are now available for Amazon.com, Amazon.co.uk, Barnes & Noble, Safari and O’Reilly.

 

The PDF looks great on my Android tablet.

The PDF looks great on my Android tablet.

Support and additional information

I’ve added a new page TAB at the top of this site for the book.

I will add additional information about the book, a sample chapter, provide additional examples and tips, as well as include any support or information on hardware used.

If you have any queries, questions or comments on the book, then please do get in contact, I will be more than happy to help where I can.

If you enjoy the book, then be sure to let everyone know!

 

___________

@pihardware

pihw@hotmail.co.uk

I am pleased to announce that I finished the last edits on the final copy of the book this week and it has been sent off to the publishers.

Raspberry Pi Cookbook for Python Programmers

First of all, I would like to thank the many people who have supported me through the creation of the book, it has been a mammoth task to undertake.  When I first started this project I had no idea how much it would take over everything to achieve it.

At various times the book has impacted on all aspects of my life, writing it while away on family holidays (even when in a tent!), times when I’ve been travelling, at family events, most evenings/weekends week in and week out.  I have been fortunate to have very supportive family, work and friends.  I am incredibly grateful for their support and understanding during this time.

However, having the book complete and being able to look back on all the topics covered, the examples and projects it includes and I wouldn’t have believed when I set out to write “A Raspberry Pi book that I would want to read” that I would be able to produce such a result.

I really hope that everyone will enjoy reading (and using) it as much as I have had writing it.

 

But it is there, an epic road-trip through what the Raspberry Pi represents to me, it has been an amazing journey and I look forward to hearing all about everyone elses adventures as you all take a trip through the land of Raspberry Pi on your own adventure!

Map

Order Now!

I am told that the book will be published in April, including the printed versions.

As a bonus, it will be bigger than advertised, weighing in at a whopping over 390 pages (originally planned around 350!).

http://goo.gl/dmVtsc

 

You can also get it from Amazon, Barnes & Noble, Safari Books, O’Reilly (see the Packt site for details).

http://www.amazon.co.uk/dp/1849696624/?tag=packtpubli-21

A very quick message about the Raspberry Pi Cookbook for Python Programmers book.

It is coming, we are working hard to get it released as soon as possible, hopefully it will be ready very soon.  It is in the final editing stage so really isn’t too far off now.

I’d like to write a longer post (and I will when I can) but I will get back to working on it!  I will say, it still is a labour of love, and I can’t wait for everyone to have a go with all the things I’ve put in there (see my previous post for a full round-up of what it covers).

It is still available pre-order:

http://goo.gl/dmVtsc

And also from Amazon:

http://www.amazon.co.uk/Raspberry-Pi-Cookbook-Python-Programmers/dp/1849696624/

__________________________________________________________

As always, massive thank you for the support and understanding.

Tim Cox.