Tag Archives: projects

Maker Faire UK

The Maker Faire UK will be held on April in Newcastle.

maker faire

To publicize the event, they are giving away one of these

maker faire prices

All you have to do is go to their webpage, share the event in Facebook and join the mailing list. Good luck!

KICKSTARTER PROJECT OF THE WEEK (KPW)

The project this week is called Wio, it is a prototyping board for the internet of things. Easy to use and fast to program. No time wasted in protocols or intermediate steps, just build your application.

epow (Experiment project of the Week)

The experiment I want to highlight this week is related to salt concentration in plants and how it is related to electrical signals in the plant: Discovering a salt-induced systemic electrical signal in plants.

This project is relevant to improve plant tracking with several applications like study how a highway affects local plants, how a forest changes its soil over the years, or for instance, how different chemicals enhance the growth or maybe detecting a bug infestation.

satl-induced

KickStarter Project of the Week (KPW)

The next product is marketed only for apple mobile users, however, it’s slim design that is both practical and elegant will soon diffuse and become available to other mobile phones.

This is the STAQ a mobile phone stand with battery and speakers.

epow (Experiment project of the Week)

This week the project I want to highlight is about biohacking. The idea is to create open source processes to fabricate insulin and hence reduce the cost of the drugs.

Once developed, the processes to fabricate insulin will be free available to everybody, so it will be very easy to anybody to produce insulin on demand.

Because this project aims to help improve life and will have a huge impact in millions of people, it deserves to be funded.

insulin

KickStarter Project of the Week (KPW)

The interesting bit of this week’s project is not the product itself, but the idea of fighting insects with a flow of air instead of using chemicals. I wonder how efficient it is, however, if it works, it can be a better alternative for indoors applications, where you have to plug pulverisers to kill mosquitoes.

Say welcome to Wozfans.

epow (Experiment project of the Week)

A few ago a friend pass me a link to experiment and told me “have a look, maybe you can get a new microscope”. Dubious at the beginning, I had a look…

experiment…and I liked what I saw.

Experiment is a web page to help funding smart parts of large research projects. You need to test an idea, buy a specific substance, or need a new equipment? Experiment is the web page for you. Explain what your experiment is about and why more funding is necessary and maybe people interested in it will give you money to achieve it.

Because I think this is a good initiative and I would like to help my fellow colleagues in science, from now own, every week I will select one experiment and let you know about it.

This week we start with…

cad

Arduino +RF Link Transmitter/Receiver (434MHz) + ZUMO shield

A few months ago I create some tutorials about how to use Arduino and the XBee to do radio-frequency.

Python + Arduino + XBee + Zumo robot

XBee 002: radio-chat between PC and Arduino

XBee 001 Basic example: radio-chat between 2 PC

Today I’m going to show you how to do it with the cheap RF link modules.

So, first of all, thanks to Coolcomponents for providing an excellent customer service (basically, even if you order one or two components, they deliver within one or two days at a very low extra cost).

transbluecoolcomplogo4Second, materials. I’m reusing 2 Arduino boards (Duemilanove with chip Atmega 328, and UNO), and the Zumo robot from previous post, plus 2 LEDs, one potentiometer, a few wires, one battery (not in the picture), a small cardboard box, and the RF modules (which I bought from Coolcomponents):

RF Link Transmitter – 434MHz

RF Link Receiver – 4800bps (434MHz)

IMAG2568

Before starting the main project, let’s do a warm up with a basic example on how to work with these RF modules.

Introduction project.

We start by naming the connectors in the RF link modules (spreadsheet for receiver / transmitter). It is good to bend the antenna pins, otherwise when using a breadboard they will be inserted into the breadboard connectors and result in range reduction.

rf-link

Now for the circuit. We basically read an analog value from the variable resistor on the Duemilanove board, transmit it using the RF transmitter to the RF receiver connected to the UNO board, and light red/yellow LED depending on the value.

RF-link

The value of the resistor in the potentiometer is not important as we will convert it to a value between 0 and 5V. For the LEDs, as they are standard ones, it is OK to attach them to digital outputs.

The next step is the code. In order to achieve a good signal (these modules has a lot of noise), we need to get the RadioHead library (Originally it was VirtualWire, but it has been discontinued and now RadioHead is the one being used). You can download the last version, from here. (If you wonder how to connect these circuits to the Arduino, look at the “Detailed description here).

Once you have it, add it to the Arduino IDE.

virtualwire library

Once the library is added to the Arduino library list, everything is ready to upload the code. Here it is the code for the transmitter.

// Modified version of ask_transmitter.pde by RadioHead
// -*- mode: C++ -*-
// Simple example of how to use RadioHead to transmit messages
// with a simple ASK transmitter in a very simple way.
// Implements a simplex (one-way) transmitter with an TX-C1 module
#include <RH_ASK.h>
#include <SPI.h> // Not actually used but needed to compile
RH_ASK driver;

void setup()
{   
  //LED indicates message sent.
  pinMode(13,OUTPUT); 
  Serial.begin(9600);
  //For some reason, this is needed to initialize the driver
  if (!driver.init())
  {
    Serial.println("init failed");
  }
}

void loop()
{
  char msg[4];
  //Read the voltage in the potentiometer.
  float voltage= analogRead(0)* (5.0 / 1023.0);
  //Convert it to string
  dtostrf(voltage,1,1,msg);  

  //Send the message and wait to check if it was sent.
  driver.send((uint8_t *)msg, strlen(msg));
  driver.waitPacketSent(); 
        
  //Flash LED to indicate message sent.
  digitalWrite(13,1);
  delay(200);
  digitalWrite(13,0);
  delay(200);
}

This is for the receiver.

//  Modified version of ask_receiver.pde by RadioHead
// -*- mode: C++ -*-
// Simple example of how to use RadioHead to receive messages
// with a simple ASK transmitter in a very simple way.
// Implements a simplex (one-way) receiver with an Rx-B1 module
#include <RH_ASK.h>
#include <SPI.h> // Not actualy used but needed to compile
RH_ASK driver;
float Sensor1Data;
char Sensor1CharMsg[4];
void setup()
{
  //LED indicates message sent.
  pinMode(13, OUTPUT);
  Serial.begin(9600); // Debugging only.
  //For some reason, this is needed to initialize the driver.
  if (!driver.init()) {
    Serial.println("init failed");
  }
  //These are for the LEDs
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);

}
void loop()
{
  uint8_t buf[RH_ASK_MAX_MESSAGE_LEN];
  uint8_t buflen = sizeof(buf);
  if (driver.recv(buf, &buflen)) // Non-blocking
  {
    int i;
    // Message with a good checksum received, dump it.
    for (i = 0; i < buflen; i++) { // Fill Sensor1CharMsg Char array with corresponding // chars from buffer. Sensor1CharMsg[i] = char(buf[i]); } // Null terminate the char array // This needs to be done otherwise problems will occur // when the incoming messages has less digits than the // one before. Sensor1CharMsg[buflen] = '\0'; // Convert Sensor1CharMsg Char array to integer Sensor1Data = atof(Sensor1CharMsg); //Turn on the corresponding LED if (Sensor1Data > 3) {
      digitalWrite(5, HIGH);
      digitalWrite(6, LOW);
    }
    if (Sensor1Data < 2) {

      digitalWrite(5, LOW);
      digitalWrite(6, HIGH);
    }

    //Flash to indicate message received.
    digitalWrite(13, 1);
    delay(200);
    digitalWrite(13, 0);
    delay(200);
  }
}

And Voilà! With this you are able to light the red or the yellow LED just by adjusting the potentiometer.

This very basic example can be used to transmit a signal form a sensor, to do some wireless projects, or for isntance, to control a device like the ZUMO shield.

RF-link and the ZUMO.

First important thing. The ZUMO shield uses most of the timers in the Arduino board, in particular, the timer1 which is also required for the RadioHead library. So, we need to change the RadioHead library to use timer2. In order to do so, we need to edit the RadioHead library. Simply look for the library and open …Documents\Arduino\libraries\RadioHead\RH_ASK.cpp using a text editor. You need to uncomment //#define RH_ASK_ARDUINO_USE_TIMER2

radiohead

This line should be also added into your Arduino code for the receiver.

The circuits for the new project can be seen below. Basically, instead of reading one analog value, we are now reading 2, one for forward/backwards control, and the other for turning left/right. The second Arduino just sits on top of the ZUMO shield and uses a couple of wires to connect to the RF receiver.

RF-link-zumo

The code for the new transmitter is

// Modified version of ask_transmitter.pde by RadioHead
// -*- mode: C++ -*-
// Simple example of how to use RadioHead to transmit messages
// with a simple ASK transmitter in a very simple way.
// Implements a simplex (one-way) transmitter with an TX-C1 module
#include <RH_ASK.h>
#include <SPI.h> // Not actually used but needed to compile
RH_ASK driver;

void setup()
{
  //LED indicates message sent.
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  //For some reason, this is needed to initialize the driver.
  if (!driver.init())
  {
    Serial.println("init failed");
  }
}

void loop()
{
  char msg[8];
  //Read the voltage in the potentiometer.
  //This one encodes forward/neutral/backwards
  float voltage1 = analogRead(0) * (5.0 / 1023.0);
  //Read the voltage in the potentiometer.
  //This one encodes left/neutral/rigth
  float voltage2 = analogRead(1) * (5.0 / 1023.0);
  if (voltage1 > 2.6) {
    msg[0] = 'f';
  } else if (voltage1 < 2.4) { msg[0] = 'b'; } else { msg[0] = 'n'; } if (voltage2 > 2.6) {

    msg[1] = 'r';
  } else if (voltage2 < 2.4) {
    msg[1] = 'l';
  }
  else {
    msg[1] = 'n';
  }

  //Send the message and wait to check if it was sent.
  driver.send((uint8_t *)msg, strlen(msg));
  driver.waitPacketSent();

  //Flash LED to indicate message sent.
  digitalWrite(13, 1);
  delay(20);
  digitalWrite(13, 0);
  delay(20);
}

This time, just to make this example more general, we transmit characters. F for forward, b for backwards, n for neutral, l for left and r for right. The code for the receiver is

//  Modified version of ask_receiver.pde by RadioHead
// -*- mode: C++ -*-
// Simple example of how to use RadioHead to receive messages
// with a simple ASK transmitter in a very simple way.
// Implements a simplex (one-way) receiver with an Rx-B1 module
#include <RH_ASK.h>
#include <SPI.h> // Not actualy used but needed to compile
//Enable timmer2 instead of timmer1
#define RH_ASK_ARDUINO_USE_TIMER2
RH_ASK driver(2000, 11, 12, 13, false);;
#include <ZumoMotors.h>
ZumoMotors motors;
float Sensor1Data;
char Sensor1CharMsg[4];
int left_speed, right_speed;
void setup()
{
  //LED indicates message sent.
  pinMode(13, OUTPUT);
  Serial.begin(9600); // Debugging only.
  //For some reason, this is needed to initialize the driver.
  if (!driver.init()) {
    Serial.println("init failed");
  }
}
void loop()
{
  uint8_t buf[RH_ASK_MAX_MESSAGE_LEN];
  uint8_t buflen = sizeof(buf);
  if (driver.recv(buf, &buflen)) // Non-blocking
  {
    int i;
    // Message with a good checksum received, dump it.
    for (i = 0; i < buflen; i++)
    {
      // Fill Sensor1CharMsg Char array with corresponding
      // chars from buffer.
      Sensor1CharMsg[i] = char(buf[i]);
    }
    // Null terminate the char array
    // This needs to be done otherwise problems will occur
    // when the incoming messages has less digits than the
    // one before.
    Sensor1CharMsg[buflen] = '\0';
    // Convert Sensor1CharMsg Char array to integer
    Sensor1Data = atof(Sensor1CharMsg);    

    //Choose the correct speeds depending on the command
    if (Sensor1CharMsg[0] == 'f') {
      left_speed = 200;
      right_speed = 200;
    }
    if (Sensor1CharMsg[0] == 'b') {
      left_speed = -200;
      right_speed = -200;
    }
    if (Sensor1CharMsg[0] == 'n') {
      left_speed = 0;
      right_speed = 0;
    }
    if (Sensor1CharMsg[1] == 'l') {
      left_speed = left_speed + 100;
      right_speed = right_speed - 100;
    }
    if (Sensor1CharMsg[1] == 'r') {
      left_speed = left_speed - 100;
      right_speed = right_speed + 100;
    }
    if (Sensor1CharMsg[1] == 'n') {
      left_speed = left_speed;
      right_speed = right_speed;
    }

    //Activate motors
    ZumoMotors::setSpeeds(left_speed, right_speed);

    //Flash to indicate message received.
    digitalWrite(13, 1);
    delay(200);
    digitalWrite(13, 0);
    delay(200);

  }
}

Now it is a matter of uploading the code to the Arduinos and pack things inside the cardboard box…

IMAG3170

…and you are ready to have some fun with the ZUMO shield.

Compared with the XBee the range is not great, but these modules are by far cheaper than the XBee, and they can be improved by adding antennas.

KICKSTARTER PROJECT OF THE WEEK (KPW)

Advances in terms of beds are in most cases in terms of materials, and hence silent. This makes it difficult to distinguish between good and bad quality. However, we spend so much time in bed that it is important to dedicate some time and money into improve it. The next project might not be ready yet for the market, but it is a good way of thinking and hopefully it will impulse others. Say hello to bedjet.