>RGB LED’s and Arduino

>

Quiet on the Arduino front for the last couple of week not helped by hospital visits. I received a week or so ago some RGB LEDs from the wonderful people at Oomlout, you can see them here. Damn cheap (three for two quid), easy to setup and pretty to look at. I was playing with a colour sensor a few weeks back so my next task is to get these lighting up based on the sensor readings.

A lot of my recent time has been spent on reading up on the PIC microprocessors. Played a little more with the Amicus 18 but I’ve ordered a PIC development board which should be arriving shortly and will see what I can do with that.

>PIE

>

We have three children, ages 12, 7 and 4. None of them have ever eaten a savoury pie. Today was the day we ended that.

That is a Marks and Spencers’ roast chicken pie. Selina didn’t like it, Hugo and Alisa said they did but didn’t eat much of it.

We won’t be having another in a hurry.

>Arduino, Servos and SCADA

>

This weekend I was going to play around with servos and motors, but due to a missing diode I only got the servo working, displayed below. Yes, that’s a matchstick attached to it with Blu-Tac.

The processing language is actually very nice to play with. If I squint and pretend it’s Javascript then I can write in it without missing python too much.

The whole purpose of playing around with electronics is deep down I’d like to know a bit more about the factory floor hardware side of things. I’ve written a lot of software for factories but hardware tends to be black box stuff. When I couldn’t find the diode I needed I instead thought I’d see if I could get somewhere with a Direct ICS plugged to an Arduino and SCADA. Turns out you can. You need some modbus client code from here and the Mango M2M system from here.

What was supposed to be hardware time ended up playing around a lot with Java, Tomcat and understanding what modbus is and does. But at the end of the evening (I packed it in early, I was whacked) I saw this on the Mango interface …

That ‘1’, in the Nodes found list, is the sweet smell of success. Next step would be to fit some sensors on the Arduino and get Mango to monitor them.

>Scrolling LED

>

Hardest thing I’ve wired up so far. Not ‘hard’, just tedious. But it works!! Weeeeeeee.

Buy yours here.

>Amicus18 / Netduino / Arduino

>

OK, whilst I am here, there’s another addition. The Amicus18 could be considered an Arduino with a PIC processor. Once again, the Amicus18 homepage at http://www.myamicus.co.uk/ gives the summary:

Amicus is a multifunction development system inspired by the popular Arduino board, however, the Amicus board uses a Microchip PIC®microcontroller instead of an Atmel AVRtm type

For the moment I am going to focus on the Arduino, learn some .NET and do some Netduino and then play with the Amicus18 in any spare time. Would like to do some assembler with that one. So here’s the current family.

Just one more to join – coming soon.

By the way, the breadboards on the Amicus and Arduino come from Oomlout. They make me happy (the company and the board). Also recommended are Cool Components, where the Netduino came from and Proto-Pic who supplied the Amicus18.  Great service from all three of them.

One more I want to pick up …

>Arduino/Netduino

>

My last posting detailed getting my Arduino displaying a temperature sensor on a LCD. That worked fine. Soon after that I took delivery of a Netduino. A Netduino is … well … to quote from http://www.netduino.com/:

Netduino is an open source electronics platform using the .NET Micro Framework. Featuring a 32-bit microcontroller and a rich development environment. Suitable for engineers and hobbyists alike.

It’s basically an Arduino that you program via the .NET language. I’ve not used Microsoft languages for yonks, so why buy one of these things? Well, I’ve not used Microsoft languages for yonks. Might be fun to play with them again. Maybe Smile.

So my plan was to take what I’d done before, but this time, put the temperature sensor on the Netduino and transmit the data to the Arduino (using the RF link transmitter and receiver shown at http://is.gd/f4n3Q), and the Arduino LCD would display it. I spent quite a few hours working on it last Friday evening. A lot of pain was caused by learning some basics of .NET and C# (many thanks yellowduino on the #arduino irc channel). I fiddled with it relentlessly Friday evening and bits of Saturday and Sunday. I stopped trying to transmit the temperature and instead just worried about transmitting a set string.  But I just could not communicate from the Netduino to the Arduino.

Not quite true. I could see things ‘changed’ when I switched the Netduino on – the data on the arduino might show signs of seeing something. But what i was actually transmitting from the Netduino was never displayed on the Arduino LCD. I switched anything that could possibly interfere off but nothing. Eventually, Sunday evening, I gave in. I really didn’t mind that much, I learnt a lot and that, rather than the accomplishment, was important. But still …

This Friday evening I switched it all back on again and it worked first time. First time.

>Easy peasy Arduino

>

I’ve dealt with software for a long time, over twenty years. Software is quite simple really when you know the basics but to people totally outside of it, it no doubt looks like magic. I’ve always wanted to learn more about hardware. I remember buying an electronics book whilst in Japan but did nothing with it. A short while ago I picked up a starter Arduino kit.

Arduino is (to quote the site) an

open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It’s intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.

The kit linked to above from oomlout.co.uk contains everything you need although having done the first couple of exercises I let it drop due to pressure of work. I picked it up again recently and made my first real project. It’s actually nothing. It’s an Arduino linked to a LCD (buy that separately from Oomlout) and a temperature sensor. It displays the temperature.

Putting it together was simple using the Oomlout guides for each piece. What was more important for me was understanding how a circuit gets wired up and how to use different components together. In terms of complexity this is very very simple but seeing something in front of me working that I put together has really given me a kick. Hey, little things make me happy!

More importantly it’s made me realise not to think things are complex just because I don’t understand them. That mass of wires looks difficult but they’re all pretty understandable very quickly.

>Chester Zoo

>

Headed to Chester Zoo today, not been there for a year or so. Birthday treat for Alisa (four on Tuesday) and she really enjoyed, as did we all. As a grumpy old man I do wonder why things are so expensive. Five of us meant a family ticket plus another child ticket. And by default they give you the price with a 10% voluntary contribution added came to £67.45. They do ask if that’s OK but the pressure is then on you to decline and feel like a grumpy git.

If you ever go to the Zoo can I recommend the bats and the butterflies. OK, they don’t sound the exciting but both get you close to the action. Exhausted now, time for some cider.

>More code from the pros

>This evening I had the pleasure of looking at a system unconnected with work. The system is critical to the client and put together by a Computer Science graduate and I was asked to give an opinion unofficially for a friend.

Oh my god.

I knew I was in for fun when the schema had tables with mixed upper/lower case – and field names with spaces, percentages, dollar signs and all manner of exciting characters. The system had comments only in what (I presume) was the first part of the system. There was nothing useful in the comments but the programmer declared his genius (not making this up) in taking the work of somebody else and ‘sorting it out’.

Hang on – pain in the eyes.

OK. Back.

The schema seems to have come from the school of “I have an access database and I’m not afraid to use it”. People who think because they know how to use Filemaker Pro or Access or similar revel in their new found status of “Programmer”. No, you are not a programmer. Frankly I’m probably not a programmer any more either but at least I know when code is wrong. if I know how to use Excel does that make me an accountant? No. If I know how to use Paint it doesn’t make me an artist. You have used Access and (I’m sorry) on the evidence shown the only status achieved is “wank stain, second order”. Your exclamations to your poor suffering client (Yes, they showed me the emails), that “Enabling numeric analysis of this data will require some days work in installing the necessary mathematical modules” is wonderful. Your problem is you only knew how to use a varchar (strange, I’ve seen that a few times before) and you’re now realising why data has types.

But take heart. You may not have a clue what you’re doing. And you may struggle to put your trousers on the right way. But you have a degree in IT. Virtually everyone I know will therefore trust you and your future is assured.

Unfortunately, you’re still a wank stain. C’est la vie.

>Snow Leopard and 32bit 64bit Psycopg woes

>

Ah yes, let’s quickly do some work this morning. How soon that turns into watching multiple parts of your development environment fail.

I want to pull some data from a Microsoft SQL Server and into Postgres using Python/Django. The ODBC drivers come from http://www.actualtechnologies.com and I paid 30 quid for a small license that allows 5 concurrent users. It’s only me using it so I only need one so that’s cool. I say 30 quid -that’s for  Mac. If you want to use their Linux version it will be somewhere around 600 quid. Hey ho. Well ok – I’ll just do this on a Mac then.

Now the problems start. Basically, the ODBC drivers won’t work with 64 bit apps. OK, So I’ll force my Snow Leopard python into 32 bit mode using.

jlp:~ icottee$ defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

Now psycopg2 won’t work. And I spend some time faffing around. Eventually I discover to get psycopg2 to work you’ll need to get yourself a 32 bit version of postgres. So the magic rule is download the code for postgres, configure and make install it AFTER you have done:

export CC="gcc -arch i386"

Now you reinstall psycopg2 and wahey you can at last get on with what you were supposed to be doing.