background preloader

Arduino Tutorial - connecting a parallel LCD

Arduino Tutorial - connecting a parallel LCD

Arduino Interrupts Often when working on microcontroller projects you need a background function to run at regular intervals. This is often done by setting up a hardware timer to generate an interrupt. The interrupt triggers an Interrupt Service Routine (ISR) to handle the periodic interrupt. In this article I describe setting up the 8-Bit Timer2 to generate interrupts on an Arduino ATMega168. I walk through steps required for setup and inside the ISR function. If you are following the Arduino sound articles this one will be important to read as well. The Arduino default processor is an ATMega168 (datasheet link). Interrupts? Interrupts Links When a new character arrives the UART system generates an interrupt. If you have lots of interrupts firing or fast timer interrupts your main code will execute slower because the microcontroller is spreading it’s processing time between your main code and all the ISR functions. With an interrupt you don’t have to keep checking to see if a character has arrived.

arduino interfacing with the HD44780 LCD « Adams Bros Blog It became time for me to interface an LCD with my Arduino. I need to generate a handy report of what my various sensors are picking up. The following is an account of my notes on twisting up my HD44780 compatible LCD on the Arduino. I'm staring at my LCD module. #1: Identification On the back of the unit, it says:AMC2004A-B-B6NTDW-SP LOT#000542 A little Googling for "AMC2004A-B" and I find that it's an HD44780 compatible LCD. #2: Figuring The only figuring I need is for the backlight. #3: Wiring A little skimming of the spec sheet helps me understand how to wire this up so here we go: Pin No. #4: Programming The LiquidCrystal Library came with my Arduino 0012 Alpha software package (IDE). #include <LiquidCrystal.h> /* LiquidCrystal display with: LCD 4 (RS) to arduino pin 12 LCD 5 (R/W) to ground (non-existent pin 14 okay?) void loop() { }

Amarino - "Android meets Arduino" - Home Using Relays with Arduino – Turning on the Lights Warning!!! This project deals with AC electricity which is dangerous if you don’t know how to treat it safely. You must treat electricity with caution. Microcontrollers are good at controlling small devices, but frequently we DIY-ers want to use them to control things that aren’t so micro. The first thing you need is a cheap extension core that you are willing to cut in half. I spliced the relay into the black wire on my power cord. The last step and the one that makes this project useful is getting the microcontroller to control this relay. In this circuit the transistor acts as a switch and it allows you to turn on the relay. The cost to build the circuit below should be under $15 dollars and half of that is for a cheap extension cord. The code to run this was amazingly simple since the transistor and relay make turning on the extension cord as simple as turning on or off an LED. Credits

Wiring Tutorials / Using a transistor to control high current loads with an Arduino In this tutorial, you'll learn how to control a high-current DC load such as a DC motor or an incandescent light from a microcontroller. (:toc Table of Contents:) Parts You will need the following parts for this tutorial. Solderless breadboard 22-AWG hookup wire Arduino Microcontroller module 10Kohm potentiometer power diodes (for DC Motor version only) DC power supply TIP120 transistor DC Motor - or - Incandescent lamp and socket (Diagram made with Fritzing) Add a potentiometer Connect a potentiometer to analog in pin 0 of the module: Connect a transistor to the microcontroller The transistor allows you to control a circuit that's carrying higher current and voltage from the microcontroller. Pinout of a TIP-120 transistor, from left to right: base, collector, emitter. Note: you can also use an IRF510 or IRF520 MOSFET transistor for this. The schematic symbol of an NPN transistor where B is the base, C is the collector, and E is the emitter. click the image to enlarge Connect a motor and power supply Notes

Freeduino A Multi-Protocol Infrared Remote Library for the Arduino Do you want to control your Arduino with an IR remote? Do you want to use your Arduino to control your stereo or other devices? This IR remote library lets you both send and receive IR remote codes in multiple protocols. It supports NEC, Sony SIRC, Philips RC5, Philips RC6, and raw protocols. To use the library, download from github and follow the installation instructions in the readme. How to send This infrared remote library consists of two parts: IRsend transmits IR remote packets, while IRrecv receives and decodes an IR message. #include <IRremote.h> IRsend irsend; void setup() { Serial.begin(9600); } void loop() { if (Serial.read() ! This sketch sends a Sony TV power on/off code whenever a character is sent to the serial port, allowing the Arduino to turn the TV on or off. How to receive IRrecv uses an infrared detector connected to any digital input pin. The examples/IRrecvDemo sketch provides a simple example of how to receive codes: Hardware setup Some background on IR codes

Tutorials New! Getting Started with LTspice LTspice is a high performance SPICE simulator, schematic capture and waveform viewer with an impressive library of passive devices. Over 1000 models are included in the download but you can also add third party models. RFID Basics An overview of Radio Frequency Identification (RFID) technology. LIS3DH Hookup Guide A guide to connecting the LIS3DH to a microcontroller and using the Arduino library. Lessons in Algorithms Learn techniques on how to use Finite Impulse Response (FIR) filters and other data-processing tools to turn data into information. Illuminated Mask Use LilyPad LEDs, a switched battery holder, and coin cell battery to make a fun light up mask for your next costume party. Glowing Pin Create a quick and easy piece of e-textile art using a LilyPad LED, battery holder, conductive thread, and coin cell battery. Light-Up Plush Craft a light-up plush with LilyPad LEDs controlled by pressing a button and sliding a switch in the creature's hands.

Martijn Thé – iPhone & iPad Development & Interaction Design » Interfacing an optical mouse sensor to your Arduino In this tutorial I’ll describe how you can connect the optical sensor inside a cheap mouse to your Arduino and have it read out the x- and y-movements. This will enable your Arduino to handle mouse input, detect surface movements, measure surface speed, etc. Materials This is what you need: Arduino board (any *duino will do) and the Arduino IDE.Optical mouse containing the PAN3101, ADNS-2610, ADNS-2083 or ADNS-2051 optical sensor. Step 1 – Open up your mouse! The optical sensor and LED were covered with the black protective cap. Step 2 –Take a look at the datasheets Check out the datasheet of the sensor you’re dealing with (Google).We only need to connect 4 pins of the sensor to the Arduino, of which two are used for data and two for the power supply. Step 3 – Cutting the controller wires (optional) To make sure the mouse’s own controller does not interfere with the Arduino, I had cut the SDIO and SCLK wires running to the chip in the mouse. Step 4 – Connecting wires Step 5 – Example sketch

Arduino Astronomical Clock for Automatic Light Control Arduino Astronomical Clock for Automatic Light Control There are many ways to automatically control these lights. The gadget I was using (until I completed this project, that is) was a simple mechanical timer. This product allows you to set separate turn-on and turn-off times and those repeat every day. Figure 1 - Sunset time variation at my location (note: time axis is "DST time" a.k.a "summer time") Another approach to this problem, and one that you often find in many beginner elecronics projects, is to turn the lights ON/OFF based on some photo-sensitive device; a LDR or a photo-transistor for example. My objective with this project was to build a system that, given my latitude and longitude coordinates and the current time/day of the year, automatically calculates the sunrise and sunset times, controlling the lights accordingly. So here are the features/objectives for this project: - Automatic sunrise and sunset relay control to turn lights (or some other AC load) on/off respectively

Arduino Tutorial: An Introductory Guide Update! Don’t miss our famous article:Â Top 40 Arduino Projects of the Web. Previously we introduced you to the Arduino and it’s awe-inspiring incredibleness. Arduino Tutorials: As usual, Instructables has plenty of tutorials also.If you’ve ever thought, “Can the arduino do…?” The Arduino uses the ATmega168. Labs / DC Motor Control Using an H-Bridge Overview In this tutorial, you'll learn how to control a DC motor's direction using an H-bridge. To reverse a DC motor, you need to be able to reverse the direction of the current in the motor. If you simply want to turn a motor on and off, and don't need to reverse it, for example if you're controlling a fan, try the tutorial on controlling high current loads with transistors. (:toc Table of Contents:) Parts For this lab you'll need: Solderless breadboard 22-AWG hookup wire Arduino Microcontroller module Light Emiting Diodes, LED 10Kohm resistors Switch L293NE or SN754410 H-bridge 12V DC power supply DC Motor Prepare the breadboard Connect power and ground on the breadboard to power and ground from the microcontroller. (Diagram made with Fritzing) Add a Digital Input (a switch) Connect a switch to digital input 2 on the Arduino. (Diagram made with Fritzing ) Find a motor Find yourself a DC motor that runs on low DC voltage within the range of 5 - 15V. Solder leads to the motor's terminals. Get creative

DIY Projects, Inspiration, How-tos, Hacks, Mods & More @ Makezine.com - Tweak Technology to Your Will The format of this book is very different from the regular O'Reilly books. It is written by a geek for geeks. So it doesn't start with a smooth introduction about the basics. It seems to have a rocky start since a lot of assumptions is made about the reader. The diagrams also seem to be hand-drawn on napkins. Chapters 1 and 2 contain a bit of what the author self-admittedly confession to be "fluff". Chapter 4 really rocks. Overall the book is excellent for getting started with Arduino.

Related: