Posts with «arduino» label

433 MHz RF module with Arduino Tutorial 1




If you are looking for a way to communicate between Arduinos, but don't have much cash at your disposal, then look no further. These RF modules are not only affordable, but easy to use. They are much easier to set up than an XBee, plus you can use them without the need of a special shield. Before you rush out and buy a ton of these modules, make sure that you are not breaking any radio transmission laws in your country. Do your research, and buy them only if you are allowed to use them in your area. There are a few [OPTIONAL] libraries that can be used to help you and your particular project.


I will mention at this point however, that I did NOT use any libraries in this particular tutorial. That's right. I will show how easy it is to transmit data from one arduino to another using these RF modules WITHOUT libraries.

Also if you are looking for an easy way to record the signals and play them back without a computer - then jump to this tutorial.

Video





Project 1- RF Blink


Firstly we need to test if the RF modules are working. So we will design a very simple transmit and receive sketch to test their functionality. We will use the Arduino's onboard LED to show when the transmitter is transmitting, and when the other Arduino is receiving. There will be a slight delay between the two Arduinos. You can solder an antenna onto these modules, however I did not do this, I just kept the modules close together (1-2cm apart). I also found that I was getting better accuracy when I used 3V instead of 5V to power the receiver. While using 5V for VCC on the receiver, I would get a lot of interference, however with 3V, I hardly got any noise. If you find you are getting unpredictable results, I would suggest you switch to 3V on the receiver and move the transmitter and receiver modules right next to each other. Remember this is just a check... you can experiment with an antenna or a greater distance afterwards.

Here are the parts that you will need to carry out this project:
 

Parts Required



 

The Transmitter and Receiver Fritzing Sketch






The Transmitter

The transmitter has 3 pins,
Notice the pin called "ATAD". It took me a while to figure out what ATAD stood for, when I suddenly realised that this was just a word reversed. It should be DATA (not ATAD). Nevertheless, this is the pin responsible for transmitting the signal. We will make the Arduino's onboard LED illuminate when the transmitter pin is HIGH, and go off when LOW as described in the following table.

 

And this is the Arduino Sketch to carry out the data transmission.

Arduino sketch - Transmitter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 /* 
RF Blink - Transmit sketch 
    Written by ScottC 17 Jun 2014
    Arduino IDE version 1.0.5
    Website: http://arduinobasics.blogspot.com
    Transmitter: FS1000A/XY-FST
    Description: A simple sketch used to test RF transmission.          
------------------------------------------------------------- */

#define rfTransmitPin 4  //RF Transmitter pin = digital pin 4
#define ledPin 13        //Onboard LED = digital pin 13

void setup(){
  pinMode(rfTransmitPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
}

void loop(){
  for(int i=4000; i>5; i=i-(i/3)){
    digitalWrite(rfTransmitPin, HIGH); //Transmit a HIGH signal
    digitalWrite(ledPin, HIGH); //Turn the LED on
    delay(2000); //Wait for 1 second
    
    digitalWrite(rfTransmitPin,LOW); //Transmit a LOW signal
    digitalWrite(ledPin, LOW); //Turn the LED off
    delay(i); //Variable delay
  }
}




 

The Receiver



If all goes to plan, the onboard LED on this Arduino should light up (and go off) at the same time as the onboard LED on the transmitting Arduino. There is a chance that the receiver may pick up stray signals from other transmitting devices using that specific frequency. So you may need to play around with the threshold value to eliminate the "noise". But don't make it too big, or you will eliminate the signal in this experiment. You will also notice a small delay between the two Arduinos.


 

Arduino sketch - Receiver

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 /* 
 RF Blink - Receiver sketch 
    Written by ScottC 17 Jun 2014
    Arduino IDE version 1.0.5
    Website: http://arduinobasics.blogspot.com
    Receiver: XY-MK-5V
    Description: A simple sketch used to test RF transmission/receiver.          
------------------------------------------------------------- */

#define rfReceivePin A0  //RF Receiver pin = Analog pin 0
#define ledPin 13        //Onboard LED = digital pin 13

unsigned int data = 0; // variable used to store received data
const unsigned int upperThreshold = 70; //upper threshold value
const unsigned int lowerThreshold = 50; //lower threshold value

void setup(){
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop(){
  data=analogRead(rfReceivePin); //listen for data on Analog pin 0
  
  if(data>upperThreshold){
    digitalWrite(ledPin, LOW); //If a LOW signal is received, turn LED OFF
    Serial.println(data);
  }
  
  if(data<lowerThreshold){
    digitalWrite(ledPin, HIGH); //If a HIGH signal is received, turn LED ON
    Serial.println(data);
  }
}




When a HIGH signal is transmitted to the other Arduino. It will produce an AnalogRead = 0.
When a LOW signal is transmitted, it will produce an AnalogRead = 400.
This may vary depending on on your module, and voltage used.
The signals received can be viewed using the Serial Monitor, and can be copied into a spreadsheet to create a chart like this:




You will notice that the HIGH signal (H) is constant, whereas the LOW signal (L) is getting smaller with each cycle. I am not sure why the HIGH signal produces a Analog reading of "0". I would have thought it would have been the other way around. But you can see from the results that a HIGH signal produces a 0 result and a LOW signal produces a value of 400 (roughly).





Tutorial 2

In tutorial 2, we will receive and display a signal from a Mercator RF Remote Controller for Fan/Light.


Tutorial 3

In tutorial 3 - we use the signal acquired from tutorial 2, and transmit the signal to the fan/light to turn the light on and off.


Tutorial 4

In tutorial 4 - we use the information gathered in the first 3 tutorials and do away with the need for a computer. We will listen for a signal, store the signal, and then play it back by pressing a button. Similar to a universal remote ! No libraries, no sound cards, no computer. Just record signal and play it back. Awesome !!


 
 



If you like this page, please do me a favour and show your appreciation :

  Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
Have a look at my videos on my YouTube channel.


 
 

 
 
 



However, if you do not have a google profile...
Feel free to share this page with your friends in any way you see fit.

© Copyright by ScottC

Glo-Mo: Designing a High Tech Dance

“To me, the lights were artwork of themselves. There were the dancers dancing under art, with art on their bodies, so it just brought the whole picture together,” said Danielle Sampson, a dance teacher at Grand Center Arts Academy. I attend Grand Center Arts Academy, a school for the fine […]

Read more on MAKE

Infrared Controlled Remote Firework Igniter

With Independence Day just around the corner, American hackers are likely to find themselves blowing things up in the name of Independence. It’s all great fun but it can also be dangerous. The standard ignition method of “use a lighter and run away really fast” is not exactly safe. Instead of lighting your fireworks the old-fashioned way, why not follow [Facelesstech's] example and build your own infrared controlled remote igniter?

The first step was to decide how to actually ignite the firework fuse. [Facelesstech] had seen others use a car cigarette lighter for this purpose and he decided to follow in their footsteps. He started by removing the cigarette lighter from his own car and pulling it apart. Only one component was needed for this hack. The main heating element is a small disk with a “stem” on the end. If you apply 12V to the stem and attach the outer edge of the disk to ground, the igniter will quickly become hot.

[Facelesstech] originally thought he could just solder some wires to the device. However, the heating element gets so hot that the solder just melts every time it’s turned on. He then got creative and drilled a hole in a small block of wood that fits the heating element. The element is bolted into the wood and the bolt is used as a conductor for the electrical power.

The heating element is powered via a 12V relay. The relay is controlled by an Arduino Nano. The Nano allows two modes of operation. With the first mode, you simply press a button and the Nano will start a five second timer. The idea is to give you enough time to run to a safe distance before the firework is ignited. This isn’t much different from the old-fashioned method, but it does give you a slightly extended fuse. The second mode is where the project really shines. The Nano is also hooked up to an infrared receiver. This allows [Facelesstech] to press a button on an old television infrared remote control to active the igniter. This is a clever solution because it allows you to get to a safe distance without having to run a long wire. It’s also simple and inexpensive. Be sure to watch the video test of the system below.

[Thanks Dale]


Filed under: Arduino Hacks, Holiday Hacks

Meet the WIDGEDUINO

Arduino has made a name for itself by being easy to use and has become an excellent tool for rapid prototyping of an idea. If one wakes up in the middle of the night in a eureka moment and hammers out a contraption – using an Arduino as the brains is about as fast and easy as it gets.

With that said, the WIDGEDUINO aims at making this process even faster and easier. Bristling with an array of meters, graphs and data entry widgets, the WIDGEDUINO is sure to be a hit with hackers, makers and engineers alike.

It’s based on the .NET framework and was designed with Visual Studio Windows Presentation Foundation. The user simply writes a sketch using the WIDGEDUINO library, and connects to a PC via serial or Ethernet to gain access to the assortment of awesome widgets.

You can find a few examples here. We hope the creators will keep us updated on the progress of this impressive project. Be sure to stick around after the break for a video demonstrating what the WIDGEUINO can do.


Filed under: Arduino Hacks, Microcontrollers, news

Hands on with the Light Blue Bean

We took an initial look at Punch Through Design's Light Blue Bean when they opened for pre-orders. Now we have our hands on the hardware it's time to take a closer look.

Read more on MAKE

Scan any object and instantly view the color with Nix Color Sensor


It’s time to announce a new partner in the Arduino At Heart program!

Nix, The Diamond Standard In Color Measurement, is a unique device capable of determining the exact color of any object or surface in RGB, CMYK, HTML, Lab, and even specific paint from your favorite brand. Imagine a Photoshop eyedropper in real life: Nix is a small, durable, buttonless tool that can easily fit in your pocket or bag.

It’s a useful device especially for graphic designers, interior designers, artists, photographers, hobbyists, anyone who wants to become a colour expert. It utilizes Bluetooth 4.0 technology to display the exact color on your iOS or Android device. Once scanned, you can keep palettes of your favorite colors, match the color to real life pigments, and even receive directions to the nearest store where you can purchase the color.

On top of that Nix is ultra hackable. You can easily reprogram it with all the familiar tools available in the Arduino IDE.

Take a look at their successful kickstarter campaign page and at the video below to learn more :

 

Nix Color Sensor is designed and assembled in Hamilton, Ontario, Canada by Nix Sensor Ltd and its CEO Matt Sheridan (info@nixsensor.com) is available to answer all your questions. If you want to make it yours, visit the webesite nixsensor.com .

Arduino Blog 19 Jun 15:45

A Nation of Makers at Maker Faire White House today

To celebrate America’s students and entrepreneurs who are inventing the future with new technologies and techniques, today the President Of United States, Barack Obama is hosting the first-ever White House Maker Faire , and has proclaimed June 18 as National Day of Making. The event is featuring Makers, innovators, and entrepreneurs of all ages who are using cutting-edge tools to bring their ideas to life.

We are also happy to announce  that Arduino was invited to participate and Massimo Banzi is right now in Washington.
Follow the streaming in the video below! More news soon!

Arduino Blog 18 Jun 15:53

Internet of Everything – Flip the Switch and Get Going

Our friends at Temboo are releasing more cool stuff for your Internet of Everything. Here’s some news from their blog.

———————————-

Now you can connect even more Arduinos with the power of Temboo by simply flipping our IoT Mode on. This new feature opens up a whole new world of possibilities for the Internet of Things.

What is IoT mode, you ask?

It’s a new way to access our 2,000+ Choreos on any of your Arduino or Arduino-compatible boards. By just hitting a switch at the top right of any Choreo page, you “got the power” to call that Choreo with a sketch tailored specifically for the device you pick from our drop down menu. Previously, this feature was only available for the Yún, but now it is open to the larger Arduino family. All you have to do is select the type of shield your board uses and the code will generate accordingly.

So how do I begin using this amazing IoT feature?

Select a Choreo from our vast Library and turn on IoT Mode. In the example below, we chose the Data.gov API and the GetCensusIdByCoordinates Choreo. Data.gov is a cool way to access APIs from a number of US governmet agencies and to query government datasets, including the US Census!

The “Arduino” option encompasses compatible boards that lack the Yún’s built-in wifi capabilities, but can connect to the internet with a shield. Fill out your shield’s specifics when the popup appears and save for future use. Run your Choreo and scroll down to retrieve the code for the sketch, ready to be pasted into your Arduino IDE. You can even plug this into a sketch generated by our nifty Device Coder to start mixing and matching!

We are thrilled just thinking of all of the possibilities this unlocks for the Internet of Things. We want to hear all about what you cook up with this new capability, so if you are working on an interesting project, reach out to us at hey@temboo.com!

Find out more on their blog!

Arduino Blog 17 Jun 14:00
arduino  iot  temboo  yún  

Reflow Oven Controller with Graphic LCD

A reflow oven is one of the most useful tools you will ever have, and if you haven’t built one yet, now is as good a time as any. [0xPIT's] Arduino based reflow oven controller with a graphic LCD is one of the nicest reflow controllers we’ve seen.

Having a reflow oven opens up a world of possibilities. All of those impossible to solder surface mount devices are now easier than ever. Built around the Arduino Pro Micro and an Adafruit TFT color LCD, this project is very straight forward. You can either make your own controller PCB, or use [0xPIT's] design. His design is built around two solid state relays, one for the heating elements and one for the convection fan. “The software uses PID control of the heater and fan output for improved temperature stability.” The project write-up is also on github, so be sure to scroll down and take a look at the README.

All you need to do is build any of the laser cutters and pick and place machines that we have featured over the years, and you too can have a complete surface mount assembly line!


Filed under: Arduino Hacks, tool hacks

Arduino At Heart EZ Control for home automation goes wireless – 8 days left

 

We’re happy to share with you the update of the Indiegogo campaign of the Arduino At Heart for home automation we presented some time ago. Ez Control goes wireless!

———————————–

We have been silent for most of the time of this campaign, but this doesn’t means that we were sleeping. Not at all!

We were listening and interacting. We have received your comments, we have followed the topic on Reddit, we have exchanged ideas with many of you and we spent all this time improving our product.

Some of you was concerned about the relay, maybe too small. Some other concern was related to the position of the temperature sensor, that could offer false reading caused by the heat from other components.

We have upgraded the relay with a new one, rated 5A, and we have also improved the physical insulation for the high voltage circuit. We have then improved the insulation of the temperature sensor.

Sure all interesting, but those where not the main doubts about our hardware.

The most requested upgrade was related to the connectivity.

Why in 2014 do we use wires?

We admit that going wireless it was in our plans for the future. We wanted to start with an easy to use board, affordable and based on well known technologies, open to most of the users.

Reading and listening all your comments, we have understood that we should change our plan, and we did it.

Yes! We spent the past month with design, engineering, prototyping and testing of the brand new and immediately available EZboard WiFi!

This means that every perk and everyone will receive NOT the old board based on the cables and 10Mbit Ethernet controller, but this new, fantastic, WiFi development board.

And the price will not change!!!

Andrea & the EZBoard team

————–

Read all the info on Indiegogo and support them now!