Friday, April 24, 2015

Getting Started with Electronics

Electronics is a fun and rewarding hobby, but how do you begin? You have taken the first step just by searching.
There is so much information available it can be really hard to know which tutorial to follow, which resource to use, and even where to buy the parts.
When I first started, back in the 1970's, I took anything and everything apart, I was a bit of a nightmare for my Mum. It was a few years before I started to learn how to put those things back together. In those early days, it wasn't easy to get much knowledge, Especially as I wasn't old enough to get a library card, thankfully things have moved on a little.
There has never been a more exciting time to be involved with electronics.

Finding out, how to begin

I would like to offer some advice to anyone looking to get into electronics.
  • Join a club or after-school class
Ok, not available for everyone, but if it is available to you, do it. Having someone with you as you take your first steps is the easiest way possible, but if you can't, there are lots of online tutorials available. Here are some of my recommendations;
Or try the introduction to electronics pages on the Right hand side of this blog.

There is also the good old fashioned book, such as Make:Electronics by Charles Platt

  "Our Absolute favourite, possibly one of the best introductions to electronics ever written
Simple, clear instructions will take you on a journey with 24 practical experiments to work through"

Getting the Components

So now you want to get going, where do you buy the parts?
  • Maplin, quite high prices, but they are nationwide with stores No Longer has High street stores
  • Farnell, again, quite high prices, online, or from the counter in Leeds, mainly aimed at commercial users
  • CPC, the "hobbyists" side of Farnell, worth a look
  • Rapid, Online, with next day delivery, postage costs are high unless you reach a minimum spend
  • eBay, lots of small sellers offering parts, but be careful, lots of not great parts for the unwary. That being said, it is a fantastic source of low cost components.
  • Amazon, recent changes mean that low price parts can now be bought from third party sellers of this site, use the same caution you would for ebay.
The other cool way of getting hold of components is by recycling! Most redundant electronics can be harvested for their bits.

Working at Home

Electronics can be a messy hobby, bits of wire generally tend to not be a healthy thing for hoovers to suck up. Grab yourself a box to keep everything in, a table to work at, and try and stay tidy as best you can. As you get further along, you might consider having a dedicated space for your projects.

Last Words!

BE SAFE


Stay away from using mains voltage until you are competent, it can and does kill! Using a 9v battery will be safe, the worst you are likely to do is destroy some components when things go wrong. I highly recommend that you wear safety glasses. Components can suffer critical failure, and then they will explode. You can replace LED's, you can't replace your eyes.


Tuesday, April 21, 2015

Arduino LCD

Arduino LCD

This quick tutorial will show you how to integrate an Arduino and an LCD Screen
To follow along, you will need an Arduino, we will be using a Uno
You will also need
  • 16x2 LCD (16 pin type)
  • A strip of 16 Header pins
  • A breadboard
  • A 10k Trimmer
  • Some Jumper wires
Building the Circuit

This should be straight forward, the pins are detailed in the software too.
The screen will need the header pins soldering in, so you can connect it to the breadboard. If you don't have headers, you can solder wire jumpers to the LCD instead.
The Software
Add the code to your Arduino IDE, plug the Arduino in via USB, and flash the code across
Here is the code;
/*
 This Block is not used by the Arduino, it is detail of how to build the circuit
 The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 * LCD A to +5v
 * LCD K to 0v
 */


#include <LiquidCrystal.h> // This tells Arduino we want to use a Library, this one is a standard library, included with the software
// <- This means "comment" and lets the Arduino know text after these is for "Human" use only

// 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(0,0);  //Cursor to 1st position of top row
  lcd.print("   Mallinson     ");  // Place your own text inside the brackets and inside double quotes
  lcd.setCursor(0,1); //Cursor to 1st position on bottom row
  lcd.print("   16 x 2 LCD");
 
}

Some Notes
  • Some screens won't have a backlight, and some need an external resistor. The screens we sell have an internal resistor and are lit by putting +5v on pin 15,and connecting pin 16 to 0v
  • The 10k trimmer is used to adjust "Contrast". If you can't see your message straight away, turn the middle of the trimmer until you can.
  • If this is the first time you have connected an Arduino, your computer will install drivers, let this stage finish before flashing the software
  • You will need to solder pins onto the LCD, or you could solder cables instead, for a remote screen
Blue LCD   Green LCD