Tuesday, 9 April 2013

FIRST Lego League South Africa 2013

FIRST Lego League - South AfricaThe +FIRST Lego League South Africa (FLL-SA G+ page - click here for the home page) have sent out the following information via email and it seems the competition is growing in leaps and bounds and Robotics in South Africa continues to reach wider circles.  Soon FIRST Tech Challenge South Africa will be a reality.

*  This year the Society of Automation Instrumentation Measurement and Control (SAIMC) have sponsored an exhibition space for FLL-SA at the Process-Expo.  It takes place 21 – 31 May in Johannesburg.

Society for Instrumentation, Automation, Measurement and Control
*  On 21 July the National Robotics Olympiad (NRO) takes place at Tswane University of Technology (TUT) in Pretoria.
*  The weekend after that (28 July/31 August) the NRO Finals takes place at TUT (dates to be confirmed).

*  Then on 31 August the FLL Launch for 2013 will rock TUT Pretoria campus and the season will kick off with a bang after that.
*  Six short weeks later , on 12 October,  FLL Eastern Cape Regional will take place in PE.
University Of South Africa
*  On 19 October: FLL Northern Free State Regional in Sasolburg AND FLL Mpumalanga Regional at TUT Nelspruit.
*  26 October: FLL Gauteng North Regional, UNISA Pretoria
*  2 November:  FLL Western Cape Regional at the Cape Town Science Centre
Inspired toward Science Engineering and Technology*  9 November: FLL KZN Regional, KZN Science Centre
*  16 November: FLL Gauteng South Regional, Sci-Bono
*  23 November: FLL Zimbabwe, Harare
*  7 December: FLL Nationals, Johannesburg, Sci-Bono

With the program so full from May right through to December, 2013 promises to be an exciting year for robotics in South Africa.

For more information about FIRST Lego League South Africa, contact +Johannes De Vries  (South Africa's FLL Operational Partner) on his email - click here
National Robot Olympiad - South Africa

Monday, 8 April 2013

LEGO learning experience - Robotics Training

Engenius Toys are a LEGO stores and they are situated in the Fourways Mall (Johannesburg) and in the Garden Route Mall (George).  They send out a regular newsletter, for which you can subscribe on their website, if you wish to have direct access to the information in this blog post.  Below is the schedule they have for Term 2 2013.

Engenius Toys - Lego Learning

Thank you for visiting my blog.  To find out more about me, click here, or click on the 'Contact' tab at the top of the page.

Thursday, 4 April 2013

PC volt meter with a real time software and USB mi...

I came across +Yaghiyah Brenner 's blog via G+ and I am glad to have found another South African that shares my passion for tinkering with electronics and DIY embedded projects.  On top of all that - HE ALSO BLOGS ABOUT IT!

Below is an quick extract and link to one of his posts about a PC volt meter.  He will share the firmware and schematics if there is enough interest.

Yaghiyah Brenner (Cape Town Developer): PC volt meter with a real time software and USB mi...: PC volt meter with a real time software and  USB  microcontroller  interface  Project summary:  This project came about one day when...

Monday, 1 April 2013

Micro controller basics (refresher for line follower project)

I had to take a break from building and designing my line follower robot, because I ran into a brick wall when I realised  I have forgotten EVERYTHING I knew about c-programming.

To get up to speed from the beginning to now, check out the previous posts:

Part 1 - The design statement
Part 2 - Basic design guidelines
Part 3 - Build and test chassis and drive platform

In the previous posts, I said that I was going to use the PIC18F45K20, but I am going to go with the +Atmel Microcontroller ATMEGA328P instead for two simple reasons:
        -  it is easier to come by than the PIC
        -  and the programming kit is half the price of the PICKit3.

Atmel Microcotroller
Now we have to design and build the electronics around the microcontroller.  This will be determined by many factors, so some applications will have differently designed circuits than others.  So it is a good idea to look at the datasheet for he microcontroller you choose, to be able to know what components you will need.  Click here for the full datasheet.

Since micro's all work more or less the same, check out Newbie Hack for a fantastic tutorial series on the ATMEGA32, from the basics, right through to some pretty cool projects.

Here is a pinout diagram for the ATMEGA328P (note that it is the same mirco used on the +Arduino board:

ATMEGA328 Pin Mapping
The datasheet will have detailed explanations about everything.  Here are the descriptions of each pin abbreviation (extracts from datasheet):
  • Vcc indicates the pin where the positive terminal for the power supply or battery must be connected (around 3 - 5.5Vdc)
  • GND is the "ground" terminal and this is where the negative terminal of the power supply or battery gets connected.
  • PB#, PC#, PD# indicates PORT B/C/D and the bit number.  Each port has 8-bits from bit 0 (least significant bit) to bit 7 (most significant bit).
  • AVcc - supply voltage pin for the ADC (Analog to Digital Converter).  It should be connected externally to Vcc even if the ADC is not used.  If the ADC is used, it should be connected to Vcc through a low-pass filter.
ATmega328 Port B Pins Alternate Functions
  • SPI - Serial Peripheral Interface
 ATmega328 Port C Pins Alternate Functions 

ATmega328 Port D Pins Alternate Functions
  • USART - Universal Synchronous/Asynchronous  Receiver/Transmitter - used to facilitate serial communication using the RS232 protocol

ATmega328 Electrical Characteristics  
Note the DC current per I/O pin since that will determine the size of the resistor you will need to connect in series with a LED for example.  I will use a 680ohm resistor which limits the current to about 7mA, which is well within the limit.  (By the way another useful app I have on my phone is ElectroDroid. It does everything from Ohm's law to resistor colour bands, inductor colour codes, communication port and micro controller pin outs).

ATmega328 Common DC Characteristics

Now, I have not programmed any microprocessor in years and this is my first time to do a project with and +Atmel Microcontroller - Using AVR Studio 5 and 6 I had to figure out some things from the word go:
  • I had written/copied a couple of simple programs to refresh my C-programming skills and when I wanted to compile all of them under the same project with AVR Studio, it reported that "make: no rules to build...".  I fixed this by making a new project for each example since they were not at all related. Here is one example program using a switch and an LED as demonstrated by +Android Apps - AVR Control:
 //Example using 1 pin as input for a switch and 1 as output for LED
//on the same port
#include <avr/io.h>

void main()
    //set PA0  as output
    DDRA |= (1<<PA0);    //DDR = Data Direct Register for PORTA
    //set PA5 as input
    DDRA  &=~ (1<<PA5);
        //check if switch is pressed
        if (!(PORTA & (1<<PA5)))
        //if true – switch LED on
        PORTA &=~(1<<PA0);

This type of examples can be found by simply searching for simple C-tutorials, but it is quite handy to have it immediately available on you phone or tablet.  The app also explains the electronic circuitry used for each example and gives a detailed explanation of the registers used and how they work.
  • I also had trouble when I wanted to flash/program/transfer the chip using the AVRISPmk2 (AVR In System Programmer version 2).  It kept on reporting that "the target seems to have lost power or ISP is disconnected".  As stated above, AVcc should be connected to Vcc even though the ADC is not being used, so that was my mistake.  If the problem persists click here for a possible solution, though I am sure there must other simpler reasons for this error.  Let me know if you experience any problems in this regard.
After refreshing my C-programming skills on all the examples in the 'AVR control' app, which covers basic examples for all the following features, I will continue with my "Designing a line follower robot" posts:
  • PORT (i/o control)
  • ADC
  • Analog Comparitor
  • External interrupts
  • EEPROM control
  • IIC/I2C/TWI (two wire interface)
  • SPI
  • Timers
 Thank you for visiting my blog, please correct me if I have slipped up, leave a comment and visit again for progress on my line follower project.