One of the things that attracted me to the Raspberry Pi (apart from the price and philosophy behind the development of the device) was the fact that it can be used for hardware projects, not just software development. It has a set of GPIO pins along one edge which, in theory, can be connected to external sensors that can influence code running on the Raspberry Pi as well as motors, lights etc. which can in turn be controlled by the code. There are, however, a couple of things stopping me from experimenting with this though. Firstly I'm sure it would be easy to brick the Raspberry Pi if I got something wrong in the hardware and I'm not willing to risk that. Secondly because the Raspberry Pi is so new there aren't, as yet, lots of examples I could learn from. The second point is important. Last time I tried controlling hardware (an undergraduate course) I managed to accidentally switch around two pins which caused the model lift I was controlling to try and drive itself through the floor! I'm sure that in time plenty of examples (both hardware and software) will appear and I'll make some use of the GPIO pins on the Raspberry Pi, but until that time....
Probably the most common platform (at the moment at least) for playing around with hardware/software ideas is the Ardunio. What you can see to the left is an Arduino Uno board, which is the current reference board. Essentially an Arduino is a small board containing an 8 bit microcontroller (in the case of the Arduino Uno it's an ATmega328) which can be connected to a computer via a USB cable and which has the GPIO pins broken out to easily accessible headers. You program the microcontroller using C/C++, but once programmed an Arduino doesn't have to be connected to a computer to be used, which makes them ideal for embedding in all sorts of hardware projects. There is also a large community surrounding Arduino with plenty of example programs (they are called sketches for some reason) as well as numerous hardware extensions, known as shields, which can easily add new functionality.
So I've bought an Arduino Uno (for slightly less than the price of a Raspberry Pi) partly to play with the hardware side of things, but also as a good excuse for improving my C/C++ skills (I've never really used either language in anger for anything larger than a single function DLL or command line application). I don't have any firm plans yet, but I'm sure that when I do there will be a blog post or two.
This looks to have the potential for both endless entertainment and frustration.
ReplyDeleteI suspect the latter. Would they make a controller for stepping motors, interval timers?
A project for this winter.
Hi Adrian, nice to see you back commenting as well as posting!
DeleteI'm sure there could easily be endless frustration, but so far it's been entertaining! The nice thing about Arduino is that there are so many add-on boards for it you can almost guarantee there will be something helpful available for any project. And if not then there is a board which is essentially a breadboard for assembling your own components. For example, Arduino have their own motor shield, and if that doesn't do the trick then there is bound to be something in this list.
Ta Mark. I'm switching from Olympus to Cannon. So it should plug in okay. Back to relearning 'C'. Not that I learnt that much the first time round.
Delete