• Code

    I2C Scanner

    by shedboy71

    This very simple sketch scans the I2C-bus for devices. If a device is found, it is reported to the Arduino serial monitor. Code   [codesyntax lang=”cpp”] #include <Wire.h> void setup() { Wire.begin(); Serial.begin(9600); Serial.println(“\nI2C Scanner”); } void loop() { byte …

  • Code

    Connect a water sensor

    by shedboy71

    This water sensor is fairly easy to connect this to your Arduino, the requirements are simply VCC (5v), GND and then connect the SIG to one of the Analog pins. In our code example this will be Analog 0.   …

  • In this example we look at how to connect an IR Reciever. Generally, they require Vcc(5v), GND and there is a data out which you connect to your Arduino. Here is a typical IR showing the pinout.   Many electronic shops online …

  • Code

    Basic voltmeter

    by shedboy71

    This is a basic LCD voltmeter example YOU SHOULD NOT MEASURE MORE THAN 5v or reverse the polarity, you risk causing permanent damage to your Arduino I tested a 1.5v battery, the reading was 1.50v, using a multimeter I read …

  • Code

    HMC5883L example

    by shedboy71

    The HMC5883L is a 3-axis magnetometer. The most common include usage of the chip is as a digital compass to sense direction or using them to detect ferrous metals. /* Analog input 4 I2C SDA Analog input 5 I2C SCL …

  • Projects

    LCD clock project

    by shedboy71

    In this example we will create a simple clock example using a DS1307 breakout, a keypad/LCD shield and an Arduino Uno The DS1307 real-time clock is a low-power, full binary-coded decimal clock/calendar. Address and data are transferred over the I²C …

  • Code [c] #include <Wire.h> #include <Adafruit_BMP085.h> #include <LiquidCrystal.h> Adafruit_BMP085 bmp; // Connections: Sainsmart LCD/Keypad shield LiquidCrystal lcd(8, 9, 4, 5, 6, 7); void setup() { //Serial.begin(9600); delay(1000); //setup the LCD lcd.begin(16, 2); // start the library lcd.setCursor(0,0); lcd.print(“Temperature”); //debug the …

  • This DS18B20 example we output the temperature to our LCD display. The LCD display we use is the LCD Keypad Shield that is available for sale from various sources. Here is the temperature displayed on the LCD, as you can …

  • Basics

    Transistor example

    by shedboy71

    The circuit shown here uses a NPN transistor connected to a an Arduino output pin to switch an LED pin. In real life you would perhaps switch a relay, lamp , fan or a buzzer. A darlington transistor could be …

  • Ultrasonic transducers or ultrasonic sensors are a type of acoustic sensor divided into three broad categories: transmitters, receivers and transceivers. Transmitters convert electrical signals into ultrasound, receivers convert ultrasound into electrical signals, and transceivers can both transmit and receive ultrasound. …

  • Code

    8×8 LED matrix example

    by shedboy71

    This example switches on all the LEDs on a 8×8 LED matrix, the matrix is controlled by a MAX7219 You will need the Led Control library #include “LedControl.h” /* Max7219_pinCLK = 10; Max7219_pinCS = 9; Max7219_pinDIN = 8; */ LedControl …

  • Basics

    PIR sensor example

    by shedboy71

    In the following example we will demonstrate the HC-SR501 PIR sensor, this sensor has many nice features including the ability to be driven by 5v, low cost (£2 to £3), it has a decent range (7 metres) and a fairly small size. These …