Tuesday, January 31, 2012

Ever decreasing circles.

I have resurrected my old buggy from several years ago, removed the OOPIC boards from it and temporarily fitted the Mega 2560 Arduino board complete with breadboard in order to evaluate the two servo motors and my sketch writing for future use. The idea is to run this buggy on servos and the other one on motors and try to work out which is the better for my project. The servos may be more powerful than the motors but they are also more expensive as well. On the other hand, the servos will work directly from the data pins and the motors will need a controller board as well. Plus, of course, the servos will be reporting their position back all the time and the motors won't. All of these factors will have a bearing on which system is chosen. My current roadmap is to build one two wheel trundle to the chosen method and gradually work up to a system using two of them on either end of a long-ish beam. The trundles will steer by way of their two wheels and the front and rear sets will both be autonomous  in some ways. Parallel to this, I will be developing a remote control system using Bluetooth in order to run the non autonomous stuff. Currently though, my buggy is running around in circles as I have not yet got my sketch correct for the servos and they are both running anti-clockwise. As one faces east and the other faces west, you can probably see where there might be a problem.
Arduino Mega 2560
Image by Snootlab via Flickr
Servomotor (Servomechanism)
Image via Wikipedia
Diagram of a Solderless Prototyping Board (Bre...
Image via Wikipedia



Sunday, January 29, 2012

Breathing again

I have just received a reply from the Hong Kong supplier I am waiting for goods from. She has checked my order and the goodies were sent to the correct address and so on but although her company sent them last December, the Hong Kong post office has been experiencing some major delays due to new year. No serious problems fortunately so they should arrive within the next couple of weeks. In the meantime, I have ordered a Duemilanove from a UK seller at an extremely good price for further experimentation.

Friday, January 27, 2012

Goodies, goodies everywhere........

but not the ones I need. (With apologies to The Ancient Mariner).

Some arrivals yesterday but, whilst very welcome, not the parts I need for my next test. I have sent an email to the supplier but, as it is still the Chinese New Year in Hong Kong, I don't expect a swift reply. What did arrive was the LAN shield and the small sensor shield. My major concern is that the company who's goods have not shown up is also the cheapest and most prolific supplier.

Thursday, January 26, 2012

A sideways leap.....

I took another look at the problem with the couplings on the buggy yesterday. Suddenly had a brainwave, file a flat on the dam' thing and so let the grub screw dig deeper into the coupler itself. Instant joy and, now, a working buggy. Or it will be when the other bits finally arrive................

Monday, January 23, 2012

Oh pooh!

I ordered some couplers on Friday and was gob-smacked to find the cost was over twelve quid for just two. But I needed them so I did the order. Then on Sunday, I discovered a supplier selling much the same for about six quid for four..................Pooh!
The two sets of link cables arrived this morning and they look pretty good, I am now just waiting for one firm to come up with the rest of the goods.

Thursday, January 19, 2012

Little buggy!

I spent a happy hour yesterday assembling the buggy only to find that I had fitted the central gears on the wrong side of the plate. So, tonight, I will be disassembling the buggy and starting again. Sigh.

Well I did it and I have to admit it, it looks terrific.I am, however, not 100% happy with the in line couplings for the drive train so I will be buying a new set in the UK in order to match the quality of the rest of the kit.

Wednesday, January 18, 2012

New stuff!

I received, this very morning, the little buggy chassis for me to assemble and make self reliant. It's a very well made piece of kit and should be a solid platform for the bits I want to hang on it. We shall see.........

Friday, January 13, 2012

Arduino 128x64 display TM12864L-2

Remember, these details only  refer to the TM12864L-2 display interfaced to the Arduino Mega2560

Connections used in my setup
The connections for the potentiometer must be set this way as the normal ground to 5volt method will blow the chip. The reset connection on pin 17 of the display must not be connected to reset on the Arduino as it will inhibit the loading of sketches. The connections marked in red must be checked as making a mistake here will, at best, result in the display not working. Getting pins 1 and 2 wrong could blow the display.
Be warned!


In addition to the standard libraries, you will also need the GLCD and Time libraries from here and here.

I finally managed to get my syntax correct yesterday evening and my sketch now works the way I wanted it to. The code is a bit big for posting here so I shall only post the relevant part in order to demonstrate the method used.

void loop() {
    // set the cursor to column 0, line 0
  // (note: line 1 is the second row, since counting begins with 0):
  GLCD.CursorTo(0, 0);
  // print from 0 to 9:
  for (int thisChar = 0; thisChar < 10; thisChar++)
  GLCD.print(thisChar);
  delay(500);
  GLCD.print("  ");
  // print the number of seconds since reset:
  GLCD.print(millis()/1000);

  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  GLCD.CursorTo(0, 1);
  // print from 0 to 9:
  for (int thisChar = 0; thisChar < 10; thisChar++)
  GLCD.print(thisChar);
  delay(500);
  GLCD.print("  ");
  // print the number of seconds since reset:
  GLCD.print(millis()/1000);
  // and so on up to .CursorTo (0, 7);

The intent is to write a line to each row on the GLCD screen of a count to ten followed by two spaces and then  the number of seconds since the last reset on a constantly updating screen.
Enhanced by Zemanta

Thursday, January 12, 2012

And another boiled egg...

Well, I did it again whilst still awake and it now works properly. I am able to run the full range of demo software on it and it looks great. I will attempt to provide a circuit soon and a link to the code. Going to bed now!

Bags under the eyes

this morning.
I managed to lose two hours of my life yesterday evening and didn't even notice. I took some bits up to the attic and decided to have a quick look at interfacing the larger 128x64 LCD panel. WRONG! I got it working but couldn't persuade the sketches to compile. Then I found the newer and working sketches and library and installed them. Magic, I had a display working. But not quite. It was fairly obvious that I had, somewhere, swapped two data leads around as I was getting a half sized image with a repeat on the other half of the screen. So I started checking and moving them. WRONG! I was very tired by then and I lost the plot completely, now the data is running and the screen displaying but it's just garbage. I will have to redo from the start again tonight. DOH!

memo to self, don't try to work when you are knackered!

Monday, January 9, 2012

Arduino 2x16 LCD display.

I have just refined my code for the first LCD exercise down to this;

 // include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
}
void loop() {

  lcd.setCursor(3, 0);
  lcd.print("Hello world");
  delay(1000);
  lcd.clear();
  delay(1000);
  lcd.setCursor(3, 1);
  lcd.print("Hello Russ");
  delay(1000);
  lcd.clear();
  delay(1000);
  }

Fairly simple stuff, my input in blue, just looks good on the display.

The circuit is also slightly different from most of the published designs, I have also laid it out to be somewhat clearer than them. The use of colour is for information purposes and is not compulsory although the red and black for the power and ground rails is fairly important. The display is a lie! The code would never produce this, I just rewrote it to show positions.

Sunday, January 8, 2012

More success

English: This is a general-purpose alphanumeri...
Image via Wikipedia
Just finished a working LCD display. It took me two evenings to get it the way I wanted it but all is now working to my design and sketch. I had trouble at the beginning due to having to solder a set of connections on to the LCD panel. Once past that, it was a fairly swift progress to the "Hello world" message on the screen. Whoopee!

The code for this is very simple and just writes to the first line on screen, then writes to the same place with blanks and repeats to the second line with a different message and blanks that. Then the whole thing loops back and starts again. The hardware is connected in the simplest method and just works.

Friday, January 6, 2012

Fritzing

I have just taken a much closer look at the Fritzing site and I am very impressed. It's well worth installing the Fritzing software too. 

Thursday, January 5, 2012

WOW!

English: 4 wire stepper motor
Image via Wikipedia
I couldn't go to bed without recording the tests I've just completed. I wired up a stepper motor and had full control right away. I have instantly learnt more about how to run a stepper motor than I could have by any other method. I am so impressed.
Enhanced by Zemanta
The second kit of stuff arrived this morning. Ian and I have both inspected it and it looks good. Certainly very good value for money. The previous kit had a very nice, but non standard, LCD display which looks to be a bit head scratching to use the first time.






This kit has the bog standard one that has both instructions and script in the main software, huzzah!

Wednesday, January 4, 2012

The eyes have had it!

Arduino mega 2560
I spent a fair bit of time yesterday evening just playing with the LED capabilities of the Mega. It was loads of fun and I only gave up when my eyes began to give out on me. Serves me right for having LED lighting in my attic. I have, at odd moments, added a few more links to the site and have also done some more research into the various interface options.

Tuesday, January 3, 2012

And this is number one.

Well every blog has to start somewhere so this one begins now.
Just before Christmas, I saw a seller in Hong Kong with very cheap stepper motors complete with control boards. As I have been keen to play with a stepper motor for some time, I immediately bought two. Shortly after, I spotted an Arduino 2560 mega for £16.00 on ebay and bought that too. When it arrived, I had a quick play and realised the awesome potential of the system. Over the holiday, I have ordered a few items to expand my capabilities and I will be having some fun for the next two months or so finding out just what I can achieve.

Kardoma:

fills the stage with flags!
Free counters!