c4di Hardware Group
/Another good night of discussion at the c4di hardware group. I always leave the meetups with lots of ideas of things to do. We'd love to see you too. Find out about the next meetup here.
Rob Miles on the web. Also available in Real Life (tm)
Another good night of discussion at the c4di hardware group. I always leave the meetups with lots of ideas of things to do. We'd love to see you too. Find out about the next meetup here.
We had another really excellent Hardware meetup tonight at c4di. What surprises me about the events is that we get people walking in with awesome projects and things they've built. Last time we met up Andrew was showing us the thing he'd built above. Just because he'd only got one of his two robot motors hadn't stopped him from building something really neat.
The two "eyes" at the front are a distance sensor. You can place Andrew's device in the middle of the room and it will spin round and generate a polar plot of the distance of objects around it, measured by the ultra-sonic distance sensor and transmitted via WiFi to a web page hosted out of the device itself. The leds are to show the motors being driven, and just to look awesome.
Tonight we also had Brian showing off how he was using Blink to wirelessly connect sensors together and also provide remove monitoring via an iPhone app. And Steve demonstrating a really neat Raspberry Pi powered wildlife camera which automatically converted it's camera from infra-red to normal during daylight hours.
Great stuff. If you want to come along and show us what you're up to (or just find out how you can build something awesome) you can sign up for our next event here, or just come along to c4di and say hello at our next Meetup on Thursday 6th of April.
I went to the Hardware Meetup with a bunch of things to do. Didn't get to do any of them because there was too much interesting chat. Which was great.
A few new folks turned up too and they were asking what to do to get started. Here's "Rob's Handy List of Hardware Fun Things to Do"
The clue's in the name. We play with bits of hardware. This doesn't mean that you need to spend a lot of cash though. You can start with just an Arduino and a few leds and switches. The Arduino is the embedded device that we like to start with. It's easy to program and cheap to buy.
The best place to buy an Arduino is probably eBay. The one you want to gets started is an Arduino Uno (or compatible). Search for "Arduino Uno". You should be able to pick one up for less than a fiver.
An Arduino on it's own can't do much (although you can flash a light on it) so you might want to take a look at one of the kits that are available. You could start with one that contains a bunch of lights and switches and a few more advanced components. These are also on eBay; I quite like the ones branded Sintron, although others are quite good.
You program your Adruino using a PC, Mac or Linux device. The Arduino software is a free download from here.
There are some getting started tutorials here that you might find useful. You can also search YouTube for Arduino videos; these are especially useful if you want to know how to use some of the more exotic devices in the kits.
Once you've got the examples working, have a go at something of your own.
If you end up making something impressive, bring it along and show us. If you try to make something and get stuck, bring it along and we'll try to help out. We meet up approximately every two weeks at c4di in Hull. You can find the agenda for the meetups (and lots of other things) here.
I've been working on the HullPixelbot hardware today. I want to use an HC-SR04 distance sensor so that a robot can detect when it is getting close to something. These devices are not perfect, but they are very cheap (less than a pound from China). Snag is they are 5 volt devices (i.e. they are powered by, and produce signals at, a 5 volt level).
The Arduino Pro-Mini that I'm using to control the motors and sensors is a 3.3 volt device. Directly connecting a distance sensor to it would not end well. It might actually break the Arduino. There are special converter chips thatyou can buy to addressthis, but they are expensive and need to be wired up. Fortunately the only signals you need to worry about are those going into the Arduino, and the only input signal is the echo pulse. So I just have to adjust the level of that signal.
The way that the sensor works is that you give it a signal to say "please measure the distance". The sensor then makes an ultrasonic "squeak" and times how long it takes for the squeak to bounce back. It generates a pulse, called the echo signal that represents this time. The longer the echo pulse, the longer it took for the sound to bounce back, and the further away the target is from the sensor.
The echo signal provided by the distance sensor is either at 0 volts or 5 volts. We want to convert the 5 volt value to 3.3. I've used a potential divider to do this. This uses the principle that the voltages in a circuit are distributed according to the resistances in each element. The higher the resistance of one part of the circuit, the more volts are "dropped" across this part. This probably doesn't seem sensible, but it is how a lot of electronic devices work.
In the old days we used to use lots of low voltage bulbs in our Christmas lights. The mains voltage of 240 volts would be spread over, say 20 bulbs, each designed to work with 12 volts. All the bulbs were connected in a chain, so the voltage dropped across each bulb was 12 volts (a twentieth of 240). Bad news, if one of the bulbs fail the whole chain goes out.
Worse news, if a human being (who has a resistance a lot higher than a 12 volt bulb) puts themselves into the circuit trying to fix this they will find that nearly all the voltage is dropped across them, which is how until recently Christmas was always accompanied by grisly stories of people electrocuted when they were fixing the lights on their tree.
Anyhoo, back to the robot circuit. The total resistance of our two resistors is around 3K. The voltage dropped across the 1K resistor will be around the third of the 5 volt input. These are the volts I don't want. The voltage across the 2K resistor will be around two thirds of 5 volts, which is as near 3.3 volts as makes no difference. And it works, which is nice.
If you think about it, what I've made is a machine that can divide by 3 at close to the speed of light. Any signal going into the potential divider will be divided by 3 on the output because physics. The speed of these two resistors massively outperforms even the most powerful of digital computer, and so-called "analogue" computers like this were much used in the past.
It turns out you can have a lot of fun failing to get something to work. Number one son has bought an RC2014 homebrew Z80 kit. At the moment it is not doing much, so we had a go at finding out what the problem might be. The kit has a backplane board that brings out all the signals from the processor and then you can plug in a processor board, clock, RAM board, ROM board and serial port. It really took me back to the days when you could print out the entire circuit for your computer on a single sheet of paper.
If you really want to discover how a computer works you could do a lot worse than get one of these. Although in our case what we discovered was that it doesn't work just at the moment.
Fixing problems like these is always a matter of working through each part of the system, checking it and moving on. By the end of our session we'd proved that the serial data was getting from our terminal into the UART, the processor clock was running and the Z80 was trying to load things from the bus. It still wasn't working, but we had a great time anyway.
So, last night we had another meeting of the C4DI hardware group. It was great to spend a while just seeing what people were doing.
You really should come along. Sign up here.
We'll be giving away some more HullPixelBot kits and making more plans involving rampaging robots.
James thinks I should get one of these. It is a kind of "everything meter". The idea is that you can just connect an electronic device and it will tell you what kind of device it is. It can detect and measure resistors, capacitors, coils, diodes and a few different types of transistor. For around fourteen pounds I reckon it is a bit of a steal. Very tempting. If you've not already got yourself a multimeter I reckon one of these would be at least as useful.
This is completely awesome. I'm so going to build one:
At the C4DI Meetup on Wednesday we are going all Christmassy with coloured lights. I've been soldering up some kits for folk to play with. Should be fun. You can sign up (if you havn't already) here.
I like Simon Monk. He writes the kind of books that I wish I'd written. They are sensible, instructive and above all practical. I've read some of his Arduino texts and found them very useful. He's also written the a book that you'll find useful if you want to get into electronics.
Hacking Electronics is a great guide to getting started with components and computers. It gives you a good grounding in the basics, teaches you how to solder and then gets you making genuinely useful/fun things. Some of them have computers in (usually the Arduino). Others are just circuits. This is very nice to see. I think of electronics as "programming with hardware". You can write a program to make a light flash, or you can make a circuit that does it.
In software you change what happens by adjusting the value of variables inside the program. In hardware you change what happens by altering things like the resistance or capacitance of the components themselves.
If you are looking for a book to give an inquisitive 11 year old (and then have fun together burning your fingers and "letting the smoke out" of devices) then I reckon this would be a very good one to go for.
While I was up town recently I noticed these rather stylish boxes in Tesco that you can get for a reasonable price.
I'd been looking for some way of storing my increasing collection of electrical components. I have this worrying (but, fortunately not very expensive) habit of searching ebay for the word Arduino and then being completely unable to resist buying things I find at amazing prices, post free from China.
My plan was to fill each box with envelopes containing particular components. I stole the idea from the excellent Arachnid Labs blog.
It works really well. When I want something I just have to flick through the envelopes to find it. The Computer Scientist in me will probably sort the envelopes into alphabetic order at some point, but for now I've not got enough devices to really make it necessary.I don't have any anti-static envelopes, so I just used ordinary stationary ones.
Some days (not many it is true) you suddenly have a strong need for an eprom programmer.
For me, today was that day.
Lots of thanks go to Ian for happening to have one.....
I spent a very happy afternoon making up an ArachnidLabs MiniShift that I got a while back. At least I was very happy until I got to the point in the instructions where it said "Now, take one of the spacers and fit it to the circuit board..."
Of course I'd lost mine.
However, the good news is that I happen to have a 3D printer. And so I was able to design and print a set in a rather attractive blue colour and then continue the build. I've not tried firing them up yet. That's for next week.
The lawn needs mowing. The upstairs is covered in discarded music CDs. And the kitchen tap has been dripping for ages. A perfect time to start building a computer controlled led display for downstairs. Or perhaps not.
At least I've fixed the tap now. Modern taps are strange. When it started to drip I went up town and bought every sized tap washer that I could find and then set to.
As soon as I took a proper look at the tap I discovered that it doesn't use a standard washer, it uses some strange right angled tap device. A quick search on the internets revealed that a lot of people solve this problem by purchasing new taps. Which wasn't entirely helpful.
So I did a more careful search and came up with these beauties. They dropped in as a direct replacement and work a treat. A little tip though. Make sure that you put them on the correct sides otherwise you'll end up on Amazon complaining that the replacement taps work fine but their action has reversed and the up position is now on rather than off....
I'm going to tidy upstairs and mow the lawn later. And the lights and controller boards are in stock. I love having a project on the go...
There is a wonderful exchange in the film "Ten Things I Hate About You"* where one of the characters poses the question "You can be overwhelmed. And underwhelmed. But can you ever be just 'whelmed'?". I think you can be. And I've just found the thing that does it. I've been playing with an Intel Galileo board. And I must admit that I'm totally whelmed by it.
It looks like an Arduino that has been eating all the pies. It has all the connections that an Arduino has, but they are subtly less useful (more of that in a minute). It is based on the Intel Quark architecture which is a complete system on a chip. The Quark is the tiny thing right in the middle of the Galileo device. The Quark chip provides serious amounts of processing grunt, and it is coupled to 512 megabytes of memory. It runs a flavour of Linux and you can put bigger versions of that operating system, plus a lot of data, on the micro-sd card.
Flip the board over and you can find a PCI Express socket which could take all kinds of high speed devices. You can also connect the Galileo to a wired network and it will work a treat, and you can run Python and lots of other stuff. And you can plug Arduino shields into the board and directly interface to hardware. That cat-flap that sends you an email each time the cat goes in or out is well within your grasp.
So far, so neat. But it is expensive, at over fifty pounds it is around five times the price of a single Arduino clone. And the Arduino hardware ports are limited. While they are electrically the same as the ones on your trusty Uno they can't be updated at more than 230 or so Hz. This rules out driving things like NeoPixels from the Galileo. It supports USB hosting, but you have to have an extra connector, and you need a really funky cable if you want to do serial communication with it.
If you really want to have Arduino compatibility and some unix power round the back you should probably get a Yun device. This is cheaper, smaller, lower power and you get WiFi thrown in. If you want to do proper unix with a bit of interfacing then the Raspberry Pi might be more up your street. And you can plug a monitor directly into that.
The Galileo is not a bad device. It is just not anything other than whelming at the moment. That could change though, remember that Quark computer on a chip. It really is tiny. If Intel release a slew of properly small and properly cheap Quark based platforms, then the Galileo would be a fantastic place to prototype the next generation of "internet of things" gizmos.
Update: The review above is all about the Galileo that I paid money for, arrived in a box last week, and I've just had a play with. It is not about the Galileo that Microsoft have been giving away as part of their Internet of Things effort. I signed up for that, but nothing has come through yet. Thanks to leonellive for pointing that out.
As far as I can tell the IOT device is the same, but it comes with an SD card containing a different operating system that is Windows based and you can write programs using Visual Studio. Now that might be a lot more than just whelming. (Does anyone know where I can get an SD card image?).
* If you've not seen the film, or you have and you want to relive the magic, head over to this fantastic essay all about it from Bim.
We got the Hexapod robot going today. He sort of walks, but has bother doing a straight line. And as for floor mats, forget them.
We are working on an appropriate name at the moment. Any suggestions appreciated.
One of the things I love about the Arduino platform is the huge number of different form factors that are available. This has got to be the smallest I've seen so far. It is TinyDuino.
The picture above shows some of the boards and a Starburst to give an idea of scale. The devices are, clockwise from the Starburst, processor, Bluetooth BLE, Accelerometer and programmer. The boards stack on top of each other using the tiny connectors.
When you want to program your device you put the programmer board into the stack and plug it into a USB port in your PC. It appears as an Arduino Pro-Mini clocked at 8Mhz (use the 3.3 volt option). It has all the pins of a standard Arduino uno and you can stack a tiny prototyping board onto the end of the stack if you want to directly access the signals. Once you've programmed your processor you can remove the programmer board to make your device even tinier.
There's a lovely little 16 LED array you can put on the end of the stack, and also a circular row of leds you can program up for a super-tiny cylon effect. There are also wifi, Bluetooth and even motor control boards you can add. The BLE device is a bit longer than the other ones, but you can still create really tiny devices with this platform. One version of the processor board has a clip for a lithium battery so you can easily create self-powered devices.
They work a treat and I strongly recommend them. However I would mention one word of warning. The manufacturer has recently changed their website and so all their documentation for the devices has moved around and is now very hard to find. If you need any help with the platform you are mostly on your own. Having said that though, most of the boards are based on very standard technology and so once you install the appropriate Arduino libraries they will work just fine.
I've been trying to get the Bluetooth BLE device to work with Windows 8.1 and not having a lot of success so far. I think this is down to my not understanding the way Bluetooth BLE works. The idea is to make a "ring of power" that I can wear so that I can send commands to my devices just by waving my hands. We shall see....
Last night we had our monthly Arduino hardware hacking session at C4DI. Lots of the regulars were there and one person even brought her long-bow along. Which was a highly impressive piece of wood.
The theme of the evening was Sci-Fi movie effects, using programs to make whooshes beeps and all kinds of space age noises. You can find out what we got up to (and even have a go yourself) by grabbing the lab sheet from here). Great fun was had.
I brought along my latest purchase, an Arduino powered pen pushing robot that you can pick up from RoboSavvy for the amazing sum of 18 pounds. Peter and I had enormous fun building it, particularly when we (or more accurate I) wired the motors the wrong way round and had the robot printing perfectly - but from right to left). However, with a bit of adjustment we got it out of "arabic mode" and managed to get it printing properly.
I've finally finished it. I was going to write an article about my Windows Phone Controlled Wedding Lights. But instead I thought I'd do something different. So I fired up Adobe Premier and I made a video about them instead. It only lasts a couple of minutes, but boy was it complicated to make. Anyhoo, feel free to take a look and let me know what you think.
I've done something else I've not done before (and I feel a bit guilty about this one). I've put the Bluetooth code for Windows Phone 8.1 and Windows 8.1 up on Codeplex. I'm ashamed to admit that this is the first code that I've ever posted there. I really should have been posting stuff up there earlier. I'm determined to post more stuff as I come up with it.
You can find a sample project (my Bluetooth Printer) and the BluetoothManager class that I used to communicate with the embedded Bluetooth controller. There are also details of how to configure the Bluetooth device and send and receive data.
What happens when you strap three motors, a battery and some bits of electronics to some lumps of wood? You get something that flies, that's what. After overcoming our initial nerves from a while back we managed to get some quality flying time in on Sunday morning. The amazing thing is that it all worked.
Number one son now has a fully working tri-copter. It seems to be happy to hover on around a third power, which means that it should be up for camera lifting duties quite soon.
Rob Miles is technology author and educator who spent many years as a lecturer in Computer Science at the University of Hull. He is also a Microsoft Developer Technologies MVP. He is into technology, teaching and photography. He is the author of the World Famous C# Yellow Book and almost as handsome as he thinks he is.
Make your own programming language. Find out more here.