Wednesday, 30 August 2017

I2C LCD control with Ardunio.

I2C LCD control with Ardunio.

In this demonstration, I will show you how to write text to an I2C LCD using an Ardunio Uno.

Displaying information from sensors and showing text will be an important requirement of many of your Ardunio based projects. There are a huge selection of screens and displays out there from TFT to OLED but one of the most popular is the simple block LCD. When controlling an LCD, you have two choices. One method is to use a standard LCD. This involves wiring 6 of displays pin outs to pins on the Ardunio. The other method is to use a I2C bus that requires a separate driver PCB but can be controlled via four pins from the Ardunio. Method one featuring a standard LCD uses lots of valuable I/O lines which you may not have if our project involves the use of lots of sensors, whereas method two less of those valuable pins on the Ardunio.

got this LCD from ebay yesterday, tried it with this simple code ...
For this project, you will need a Ardunio Uno, Female to Male jumper leads (x4), A computer with the Ardunio IDE and a USB B to USB A cable.

Firstly, take your jumper leads, flip the LCD over and connect GND to GND, VCC to 5V, SDA to A4 and SCL to A5.

Next, insert the USB A to B cable into the Ardunio and the other end into you computer. Load up the Ardunio IDE and paste the I2C code. Then compile the sketch and open the serial monitor. This will tell you the address of the LCD. If the serial monitor says no I2C devices found, check you have the right SCL and SDA connections and try again. Note the number down it should be something hexadecimal like '0x3F' or '0x27'. Now install the newliquidcrystal library. Next copy and paste the code below into the IDE, changing the address of the LCD you noted earlier.

#include <LiquidCrystal_I2C.h>
#include <Wire.h>

// initialize the library with the numbers of the interface pins

LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); //change the 0x3F if needed

void setup() {

  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");

void loop() {


Finally, marvel at the 'hello world' text. You can change this to whatever you like. Maybe you name.
If nothing shows up, check your jumper connections, your libraries, your I2C address and finally turn the blue potentiometer on the I2C bus until there is enough contrast between the white characters and the blue backlight.

Wednesday, 9 August 2017

Hydroponics // The basics

Hydroponics // The basics
Hydroponics is a subsection of agriculture in which plant are grown without the use of soil. The nutrients, often delivered from the soil, are instead derived from a liquid nutrient diluted in water. Most hydroponics system work on a cycle system. This works by pumping water up to the highest point of the system and letting gravity feed the water back into a tank or reservoir and then the process continues. The plant's roots are suspended in the nutrient water and uptake the desired amount of fluid.

A popular hydroponic system design
You can grow a huge variety of plants with the hydroponic method. Some consist of tomatoes, strawberries , Raspberries, Lettuce, Various salad greens (kale, spinach, rocket, etc), Carrots, Radishes, Cucumbers, Coriander, Basil, Mint and Parsley.

Hydroponics is not just another method of growing vegetation, it offers a wide variety of advantages of traditional soil based methods. As the global population increases, there will be less space for arable based farming to take place. However hydroponics will allow for us to produce crops in greenhouses, underground and anywhere else. Currently, hydroponic systems are being diploid in rooftop cities and deserts where farmland and general space is at a premium.

Underground bomb shelter converted into hydroponic farm in London ...
Hydroponic farm under London
in an old bomb shelter
Furthermore, hydroponics is cheaper than soil based activities as it only uses 1/20th of the water, it does not require pesticides, fertilisers and other chemicals, as there’s no chance of damage because of soil diseases or pests and plants can be grown at any time of the year in less space.

I am currently making a system similar to that in the graphic above. It features a 350mm x 100mm PVC tube that is mounted on to a 9 litre storage box. I am then going to use a 12v washer pump to transport the nutrient water up to the plants. A pump like this can either be bought online or salvaged from an old car a scrapyard. I got mine for £1 and it worked as if new. I will run the pump of the solar power provided from my shed's solar panel for a short time each day.

Overall my system should cost around £20 ($26) and have the ability to run over and over again. For the nutrients, I am using 'plant focus essential nutrients'. With this, I will be growing coriander and basil as a test. I will post updates when the system is running as well as when the plants begin to grow.