Thursday, 20 December 2012

More Piery

More fun with Pies today. I've got 8 doing real work, two that I'm waiting for RS to replace, and six more on order. I've held one back to play with. By "play", I mean, experiment to see what else I can make it do.

Last night, I had a bit of an inspiration, and I've ordered something that I think will let me use three of the GPIO pins on the Pi, as a serial (RS232) port. I'm hoping that this will allow the Robotic Arm Pi to control the power to both the lights and the arm. I tried to use the Pi to do that (a USB port connects to a USB-RS232 converter, which talks to the relay box that switches things on and off). But when it does that, the Pi crashes. I tried with several configurations, no luck. So right now I'm using a different computer to do the switching, which works, but isn't elegant. Here's how I plan to do it.

Another thing arrived today - a UBEC, Universal Battery Elimination Circuit. It is a tiny thing, about one inch by half an inch. You give it any old DC voltage, maybe 5 to 30 volts, and it converts it to a steady, smooth five volts. Five volts is, of course, exactly what the Pi wants. From what I can see, UBECs are mostly used by model airplane fliers.

The UBEC is very efficient, you only lose maybe 10% of power in the conversion. And I'm thinking that I can use it to step down the 9 volts from a cheap-and-cheerful power supply (or 12 volts, or whatever they put out) down to the five volts that we want. They cost about £3 each, and will give you 5 amps at 5 volts, which means that one of them could power several Pies, if it is fed by a sufficiently beefy power supply. I have a *lot* of unused power supplies.

Yesterday, I got a 400 gb SATA hard drive connected to that Pi. And it was jolly easy to do. I just connected the data cable via the gizmo to a USB port, connected the power, and the drive was ready for use. Today, I loaded it with data, and put it in a working environment. I'm using an old PC power supply to power the drive, and there's plenty of oomph left in that to power several more drives.

Next, I tried out a couple of wifi USB dongles. They were really cheap, about £4. Both of the ones I just bought showed up as Ralink, the necessary driver was already on the Pi, and getting it working took just a few minutes. So it had two ethernet connections, one to my main network, and another to my Wifi hotspot, and I was able to log into it via Wifi, so I was happy that was working.

But then, I wanted to make the Pi into a Wifi hotspot. And that turned out to be a bit complex, but very easy. I just followed the recipe here and it worked forst time. I have a little Zyxel hotspot finder, and it found my usual hotspot, then it found the Pi. So that's working.

And then I wondered if that Zyxel (which is also a USB wifi dongle) could also work as a wifi dongle to the pi. And it does, using "apt-get install zd1211-firmware" to get the driver. Although I'm not going to use it for that purpose, it's just too useful as a hotspot finder.

The next thing I want to do with this Pi/dongle combination, is to work out how to use it to give static IP addresses instead of the dynamic (meaning, you never know what device is going to have what address). 

While I was doing all this with the Wifi, I found that I don't actually have to give the Pi any power! I have the Wifi dongle plugged into a powered USB hub, and the Pi also, because if I plug the dongle straight into the Pi, it takes so much power that the Pi crashes. And I discovered that if I unplug the power lead to the Pi, it doesn't seem to care. It's taking power from the powered hub, via the USB port that it's plugged in to. And that's very nice, because it means that whenever I use a Pi with a powered USB hub, I dno't also need to have a power supply and cable for the Pi.

Another thing that arrived today, was a box full of 120 ml plastic screw-top containers. That cost me £28 for 100 on Ebay (search for plastic specimen sample jar). That works out at 28p each, which is a very good price for a small waterproof cache container, several times bigger than a 35mm. I've got one totally submerged in water right now; I'll leave it for a while and see if any water gets in. The people I got them from sell smaller sizes also.

And then I decided that the Geocaching Robot Arm is ready to go public, so I'm in the process of getting that approved. When it's approved, it will be GC41V9Q.

No comments:

Post a Comment