background preloader

Using Relays with Arduino – Turning on the Lights

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. There are many books and websites about electrical safety procedures and if you’re not sure how to be safe you should read that information. The most basic advice I can give is always assume any exposed wires are live and touching them will hurt a lot at best and kill at worst. 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. Credits

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

Relay Using GPIO on Raspberry Pi The Internet of Things leads to yet another Growduino We are on the verge of the Internet of Things, where simple devices can now automatically and intelligently trigger an action in the real physical world. It’s going to be a pretty neat transition, as big as the invention of the computer mainframe in the 50's, the PC 30 years ago, and the opening of the Internet to the general public in the 90’s. How big is that? Check out the full Hammersmith report if you like, but if you really want to experience the future of the Internet of Things, begin your search at the Pachube site and maybe pick yourself up an arduino from Lady Ada. Here's my arduino-pachube project - an attempt to grow the spiciest of all peppers, the Bhut Jolokia: An arduino was used to collect information from various plant sensors (lighting level, temperature, soil moisture, and humidity) and control a bank of A/C electrical outlets. Sensors were soldered to the ends of phone cables so they could easily be jacked into the Growduino enclosure.

Tutorial Series for Arduino: It begins. This video was featured on the Adafruit Blog on 01/06/11 This tutorial was featured on the official Arduino blog on 3/9/2011 This video was featured on the DIYFilm Blog on 03/19/11 Thanks to a generous sponsorship from element14, I’m putting together a tutorial series on using the arduino microcontroller platform! The arduino is a platform that I’ve done several projects with, and I think it is the best possible way for beginners to get acquainted with electronics. You can download the files associated with this episode here: Distributed under the GNU General Public (Open-Source) License. Arduino Project Contest! Start thinking about your arduino projects, because element14 will be sponsoring a contest where you can win a prize if your arduino project gets the most votes.

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.

hardware - Can I switch mains devices on/off? There's an American product called a PowerSwitch Tail which is basically an optically isolated relay in a box. They make a complete unit for 120V, but only kits for 240V supplies. The kit assembly looks pretty straightforward (even for a beginner). While it is more expensive ($18) than a cobbled together circuit with a relay, it's a lot more convenient and (most likely) a lot safer too. Growduino smart garden I've been toying with so many ideas of things to automate, but with the long days and an approaching 2-week trip and two young plants at home, I started working in earnest on a garden control project last night. "Growduino" seemed like the obvious name... ;D This is the simplest possible version-- just an automated watering system, with the nutrient solution pumped up from a reservoir in the tub with a submersible pump. Here's a shot on Flickr: from the description: The "growduino" smart garden project will, um, grow to include more sensors and controls, but watering on a schedule seems like a good starting point since I'll be leaving the rig alone for 17 days starting Friday. The program's main parameters are pump period (time between pumps) and pump duration. Note: the "plans" are in (roughly) increasing level of complexity/desirability-- not sure about aiming or CO2 scrubbing (?!)

Arduino Inventor's Kit Cet ensemble prêt à l'emploi, est idéalement conçu pour évaluer, étudier et vous initier à la programmation d'applications sur la base des modules Arduino. Il vous apprendra la base du développement sur microcontrôleur (piloter une led, utiliser un bouton-poussoir, gérer des capteurs, etc...) jusqu'à des montages plus complexes (piloter un servomoteur, un moteur, générer des bruitages, piloter un afficheur LCD, un registre à décalage, etc...) par le biais d'un manuel (en Anglais) décrivant 15 montages simples et didactiques. Cette nouvelle version 3.1 inclus un tournevis et une plaque sans soudure blanche (au lieu de transparente rouge) pour une meilleur visibilité. Montages décrits dans le manuel (avec leur code source) Les montages seront réalisés sur une mini plaque de connexion sans soudure (avec des flexibles straps).

Related: