My adventures with a Raspberry Pi and Arduino programming

Archive for the ‘Modifications’ Category

LCD breadboard and cunning headers…

So I’ve been struggling with wires everywhere in my projects. I’ve determined now that I suck so bad at soldering tonnes of plain wires that I need a better solution!

What I’ve done is solder the wire to female (yes, female) breakaway headers.

Idea being that male 90 degree bend headers are easiest to get, so I should be able to put these on the underside of my solderable breadboards. If I use a couple of pins in rather than the outermost ones I can even hide part of the female headers, so not taking up any extra space in my projects.

All also means that if one component is faulty I can easily replace them. I can also use them across projects, or plug them straight in to a breadboard for prototyping.

This arrangement is shown in the below image. This shows a basic LCD circuit. The top rail (j 1-6) are the IO pins pins going to the Arduino. The bottom rail shows two sets of 6 headers (only one shown plugged in for visibility).

LCD attached to breadboard via female headers

LCD attached to breadboard via female headers

I’ve kept the same numbers on the breadboard as on the LCD (left to right pins on top of the LCD). Thus it’s easier to remember. This also allowed me to get my resistor in there too.

The blue square on the left is a small breadboard potentiometer (variable resistor). Note I’ve put the LCD backlight pin (a 16) to ground, as I’m not using the backlight.

The circuit shown was taken from a PighiXXX ABC diagram.

This now gives me a low cost and re-usable way to plug various components in and transfer them between projects. I can do the same to SMD components, like a female USB A socket, like below:-

Female USB A with headers

Female USB A with headers

Pretty cool… Not bad for a few minutes work!

Recent purchases…

I’ve made a couple of recent purchases after considering the full scope of my project.

Firstly I’ve bought another SparkFun 16×2 LCD module, and this time I won’t ruin it with a soldering iron by accident!!!

This LCD will be used in the D of E supervisor’s receiver module. I’ve also developed a user interface and set of menus so you can navigate through and track multiple teams, find your own position, edit settings, and even navigate to a selected team. (distance, bearing).

In order to drive this though I had to use some sort of interface. Several small buttons seemed a bit fiddly to add to the box, so I’ve opted for a PlayStation controller like Joystick! I can mount this on the project box next to the LCD. If you push this joystick down it also acts like a selection button, so I have left to right, and up to down navigation, and a selection button. Just like a standard modern GPS unit (but at a fraction of the cost).

Interestingly, SparkFun have stopped selling the black project box, now instead selling a clear one. That’s pretty awesome from a show-and-tell perspective! I can now show off the project, and see the power LEDs through the case. No need to drill LED holes that may leak in water.

I’ve also decided to buy a couple of micro SD interface cards – a ArduLogger device from a local supplier, but with the SparkFun OpenLogger software installed. This software is a bit more flexible, allowing you to name multiple files and either replace their content or append new content. Perfect for a receiver tracking multiple teams – you can have a GPX file for each day for each team. Great! I’ll also fit this on the transmitter so I can check the teams actual route later if they go out of signal line of sight. Not that I don’t trust them…

I also decided against bluetooth for a couple of reasons. Firstly, more complexity, space, and power usage for a very limited ‘download’ mode at the end of a walk. Also because I have a whopping 433MHz module already with a high baud rate! May as well re-use that to request and force an upload of an entire set of logs. They’re only a few KB for a day, so won’t take long at all to transmit.

Having two transceivers also brings the tantalising prospect of sending and receiving messages. A future ‘posh’ version of the transmitter may be a bigger battery, and LCD screen, and another joystick – so the team can send progress reports and receive information from their supervisors. E.g. ‘get off the mountain – crazy weather coming!’

I’ve also found a cheap supplier in Singapore for my Arduino Mega boards. More on that in another post. They’re approx GBP 1.80 each! Great if you want to make a lot of modules.

For my next trick I’ll use a Dremel to cut holes in my project case so I can mount the components. More to follow!…

Arduino Pro Mini power saving modes

There are many ways to save power on the Arduino board itself. I summarise these with power consumption numbers…


GPS power savings tests

Turns out you can save a hulluva lot of power by carefully using a GPS unit…


Raspberry Pi working with UBlox 6M and HMC5883l digital compass board from Airbot!…

I’ve managed to get serial comms to my airbot ublox 6M GPS unit, and I2C comms to the onboard 3D compass! Here I talk over the code…


GPS Module working with Raspberry Pi and Gertboard!…

Just a quick update to say that my teenage electronics dunderhead brain is now well and truly fixed!!!

Managed to get an Airbot provided U-Blox 6M GPS unit connected to my Gertboard and Raspberry Pi – and I can see NMEA messages fine over minicom!!!

Here is a pic of the data received:-


I did this with a Raspberry Pi V2 connected directly to a Gertboard, with the following procedure:-

  1. Connect jumper on top two pins of J7 on Gertboard to send 3.3V to components on board (may not need this, but I didn’t want to risk frying the GPS chip) (This will also light your Gertboard up like a Christmas Tree!)
  2. Connect GP14 (TXD or Transmit) pin on Gertboard to Breadboard row 14
  3. Connect GP15 (RXD or Receive) pin on Gertboard to Breadboard row 15
  4. Connect provided cable to GPS unit – this gives you a 5 pin (4 connected) output, and a 2 pin output
  5. Connect cable PIN 3-black (TXD or Transmit) to Gertboard row 15 (yes 15 – TX of GPS needs to go to RX of Gertboard)
  6. Connect cable PIN 2-orange (RXD or Receive) to Gertboard row 14
  7. Connect cable PIN 5-white (GND or Ground) to GND row on breadboard
  8. Connect cable PIN 1-yellow (VCC or Voltage) to V3 row on breadboard
  9. Connect breadboard GND row to any GND pin on Gertboard (I used left hand of board column 2 (GND), top PIN
  10. Connect breadboard Voltage 3 row to first 3.3V pin on top left of Gertboard

Now install minicom by doing:-

sudo apt-get install minicom

And execute the command:-

sudo minicom -b 9600 -o -D /dev/ttyAMA0

You will see the NMEA messages like the ones in the image above!!!

Below is a picture of my setup:-


Note I’ve used a mixture of the leads that come with the Gertboard and simple breadboard jumpers to connect all the components. A bit hacky, but works great!

Components I’m using:-

  • Raspberry Pi V2
  • Gertboard V 21 Oct 2012
  • Airbot UBlox 6M GPS unit with built in digital compass –
  • Minicom software on Raspberry Pi (Raspbian)
  • Generic breadboard from Maplin

UPDATE 25/Jun/14

I’ve used the great and free Fritzing tool to diagram my basic connections. Hopefully more clear than the above text and picture:-


Finally got Robot Operating System built on Raspberry Pi…

Challenging to say the least. In fact that’s far too polite…


Initial development configuration…

I’ve not found a good single source of config information, so thought I’d start saving my own…


Happy Birthday Ralph!!!

I took delivery of Ralph yesterday (well, earlier today). Just introduced him to the world…