Monthly Archives: August 2010

Arduino and RF(nRF24L01+)

One of the cool things you can do with Arduino is interfacing with RF modules.There are different types of RF boards available in the market. We are going to work with “nrf24L01+”Transceiver chip from NordicSemiconductor
Mounted on a breakout board from
Sparkfun.

Before you start

For this project you need two Arduino boards and two RF modules. Download and install  this library for Arduino program(Mirf). Extract the files and put (the folder) in the Library folder in the Arduino installation path:
Windows: “\arduino-1.0.1\libraries\”
OS X: “/Applications/Arduino.app/Contents/Resources/Java/libraries”
You must restart Arduino Program after installing above libraries.

The Circuit

The project consists of a sender and a receiver . The connections for the nrf 24L01+ for the sender and receiver is as picture below

In the sender circuit you also need to connect a potentiometer to pin A0 as shown here: 

On the receiver side add a LED as shown below:

Now download  the code for the sender and receiver below and upload it to the Arduinos:

Sender

Receiver

By changing the potentiometer on the sender side you see the LED on the receiver side changes intensity.

The code used in this post is slightly changed version of the code from http://www.bajdi.com/playing-with-nrf24l01-modules/

Arduino driving a motor with Pololu MC33887 / Seed Studio L298 Motor Driver

Introduction


There are different approaches to driving a motor when it comes to driving  a motor with Arduino. If a simple relay is used to drive a motor it can only turn the motor on and off. In case a single transistor like TIP120 (BJT) or IRF510 (MOSFE ) is used, it is possible to control the speed of the rotation. There exist smarter DC motor drivers (so called H-bridge) that can control the direction of rotation and even brake.

Seed Studio L298 Motor Driver

H-bridge_2_pot

Use this sketch and schematics above, compile and upload it to your Arduino. By changing the position of the potentiometer you should be able to change the rotation speed and direction of the motor.
Motor driver manual can be found here.

MC33887 Motor Driver

An example of such a driver is Plolu’s MC33887 Motor Driver which is affordable and versatile. This driver can control a single DC motor with maximum consumption of 2.5A and peaks of 5A. Motor voltage can range from 5-28V which makes it an excellent general purpose motor driver.

Table below describes the marking of the pins on the back side of the MC33887 driver board from Pololu:

Interfacing MC33887 Motor Driver with Arduino

In order to drive a motor with Arduino you will need the components below:

  • A DC motor (5-12V)
  • A Breadboard
  • A Pololu MC338870 driver board
  • An Arduino with a USB cable
  • Some wires
  • A DC Jack connector
  • An adapter matching the voltage of your motor (less than 5-12V)
  • 10-50KΩ Potentiometer

Make the circuit shows below:

Your circuit should look like this:

Use this sketch, compile and upload it to your Arduino. By changing the position of the potentiometer you should be able to change the rotation speed and direction of the motor.

More info:

The circuit suggested above is the simplest form of using an MC338870 to drive a motor. By using D1 and D2, Disable1 and Disable2, one can leave the motor pins in tri-state. FS, Fault Signal, pin can be used to determine malfunction of the driver. FB, Feed Back, can aslo be read with the analog inputs to determine the amount of current being consumed by the motors.

How to make a LED bracelet with small 3mm Yellow flat top LEDs and thin brass tubes

Following pictures show different steps of making an LED bracelet with small 3mm yellow LEDs and pieces of brass tube. Hover your mouse on top of each of the pictures to see details about

How to make a LED bracelet with small 3mm Orange flat top LEDs and thin wires

Following pictures show different steps of making an LED bracelet with small 3mm orange LEDs and pieces of thin wire. Hover your mouse on top of each of the pictures to see details about that step and click to have a closer look.

How to make a LED bracelet with small LEDs

Following pictures show different steps of making an LED bracelet with small LEDs and pieces of copper wire. Hover your mouse on top of each of the pictures to see details about that step and click to have a closer look.

RFID(RDM630) and Arduino

RFID is in use all around us. If you have ever chipped your pet with an ID tag or take a look to the plastic tag in your key ring you use to enter your building, you have used RIFD. “Radio-frequency identification (RFID) is the use of an object (typically referred to as an RFID tag) applied to or incorporated into a product, animal, or person for the purpose of identification and tracking using radio waves.” Read more.

You can read RFID tags Using a RFID reader and an Arduino board. Below you can find the schematic for Connecting a RDM630serial RFID reader to an Arduino board.

RDM630 and Arduino

Pinout for RDM630

Here is the sample code that reads RFID tags from RDM630 serial RFID reader and prints them on the serial  port. You can see the results by clicking “Serial Monitor” in Arduino program. The LED blinks when the reader reads a tag.

12V Lamp on Arduino with a reed relay

Intro

Arduino has a limited current sinking/sourcing capability (less than 40 mili Amps) on its pins. Whenever you intend to switch a device which needs high current or high voltage (like a lamp or a motor) an intermediate circuit is needed. In the simplest case this intermediate circuit is a relay.

Relays

Relay acts as a normal switch, but is triggered with a magnet rather than a handle. Here we use a special kind of relay called reed relay. Such relays come in vacuum enclosures and have excellent performance in terms of being an ideal switch. Whenever driving coils there should be a diode connected across the coil in reverse bias, so it will damp the back EMF produced. However, the relay we are using has this diode across its coils internally, so we don’t need to worry about it.

Circuit

Make the circuit below:

Select the Blink sketch (File>Examples>Digital>Blink) from your Arduino software and upload it to your board. The Lamp on the bread and the LED on your Arduino board should light up at the same time.

More info

Note that similar to any other load, relays draw current. This current can be more than what an Arduino can provide. In such cases you cannot connect the relay directly to an Arduino output. Use a transistor for the relay and a diode to protect against back EMF. Here is an example how to drive such a relay with a transistor.

An easier approach for driving high current/voltage relays is to use a relay driver such as ULN2003 or ULN2803. Here is a sample schematic how to do so (taken from this rocket project).