background preloader

Cheap Arduino Wireless Communications

Cheap Arduino Wireless Communications
I was looking for a way to handle wireless communications between two Arduino boards. Other options like Xbee or Bluetooth were going to cost $50 to over $100. Then I found a cheap RF transmitter and receiver at Sparkfun. Here are a few limitations to RF solution: Communications is only one way. The advantages are that it is cheap and it is pretty easy to use. Below are some images showing how I hooked up the receiver and transmitter to two different Arduino boards. Here’s a picture of the my actual bread boarded circuit. Since the receiver is constantly picking up random noise I add a few extra bytes to every data packet. I broke the Arduino code into two files. I did all of my initial testing without any of these improvement and everything worked fine with these devices inside the same room. Add an antenna. I got a lot of help from the transmitter/receiver data sheets, and from this article. I’ll mention an even cheaper idea I had while doing this. Permalink

Arduino Tutorial - Lesson 5 We've done a lot so far, blinking lights, printing messages...all of that stuff is output: signals coming from the Arduino. The next step is to start playing with input, with the Arduino responding to outside events. In this lesson we will begin with the most basic kind of input, a push-button switch! You're probably familiar with switches, there's tons of them in your house. One kind of switch you use every day is a light switch. On the left, the switch is open and no current flows. (thanks wikipedia!) In this photo, you can see the internals of a light switch. Light switches are great but we need something smaller. These little switches are a 1/4" on each side, cost about 25 cents, and can plug directly into a breadboard. Normally, the two wires are disconnected (normally open) but when you press the little button on top, they are mechanically connected. Find 5 things around the house that have switches. Power up the Arduino and try pressing the button. Switch capability Fig 5.2 Fig 5.4

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. 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

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. 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

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

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

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.

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

Related: