Search This Blog

Tuesday 17 February 2015

I killed my Arduino!!

Well, yesterday was a bad day because I killed my Arduino Nano... I was really sad but I had to repair it at any cost.

I was playing with my Nano and using 7 LM35 conected to analog inputs and using a USB port as power supply when my Arduino died. It smelled really bad -like plastic burned or something like that- and suddenly, it stopped working. I imagine I've done an accidentally short circuit while working.

I inspected it and I realized that something had burned close to USB input. It's the part D1, a small Shottky diode.





At this point, I had two options... and if you have the same problem, you can choose:


Good Option:

You can buy and replace the diode. An equivalent option is MBR0520LT1 0,5A and 20V, and solder it in parallel with the burned one... but for me and my hands this option was really difficult.


Rude Option:

Well, I admit, I chose this option. You can take a wire and solder it bridging the part B2. It's really easy and the Arduino Nano works perfectly. In fact, my one has been working all the afternoon.


Crazy Arduino!



Saturday 14 September 2013

Easy Datalogger

Hello!

Today I've been working in a easy datalogger with my Arduino Nano. I need to know how a temperature changed along the time (5 hours) and I had a LM35 sensor and the "Nano".

The LM35 series are precision integrated-circuit temperature sensors, with an output voltage linearly proportional to the Centigrade temperature. It's really easy to find and its precision is really good -I evaluated it using a precision termometer and I concluded that I didn't need to gauge my LM35-.





Next step is the wiring. I conected the LM35 to one of the analog input of the Arduino Nano (Pin 2). I used the number 0 (A0) but you can choose whatever you want -We have 8 analog inputs-.


LM35 PIN 1 ------------------------------ 5V OUTPUT ARDUINO NANO
LM35 PIN 2 ------------------------------ ANALOG INPUT 0-7 ARDUINO NANO
LM35 PIN 3 ------------------------------ GND ARDUINO NANO


Arduino Code


float temp1;

const int sensor1 = A0;    
int sensorValue = 0;
int time1
 = 30000;    
float time = 0;

void setup() {
Serial.begin(9600);
}

void loop() {
  float sensorValue = analogRead(sensor1);
  temperatura1 = (5 * sensorValue * 100.0)/1024.0;

  Serial.print(time);
  Serial.print("\t");
  Serial.println(temp1);
  delay (tiempo);
  time = (time + ((time1/1000));
}


Notes:


  1. Measuring period: 30000ms (time1 variable).
  2. Our data will be showed in "Serial Monitor". ---> Tools -> Serial Monitor.



And finally, I copy&paste all the data compiled in a Excel... to make graphs or calculations. It's really easy and useful. I recomend try it.


See you!

Tuesday 20 November 2012

Software Serial Arduino

Hello!

In the previous post I have spoken about the JY MCU Bluetooth Module, wiring using the Serial Port of our Arduino and a basic example but, how about if you want to use the Serial Port to another thing and you want to continue using the JY MCU? Can we emulate a Serial Port with digital I/O of our Arduino?. Of course, Yes!.

It's very easy. We only need to connect our JY MCU Bt following this schematic:


TX BT Module ------------------> Digital Pin 10 Arduino
RX BT Module ------------------> Digital Pin 11 Arduino
VCC BT Module <---------------> 3,3V Pin Arduino
GND BT Module <---------------> GND Pin Arduino

Note: Of course, you can choose the Digital I/O which you prefer. Then, in the code source, we configure them.



 Code:


#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX
char lecturaSerie = Serial.read();
int led = 13;

void setup()  
{
   Serial.begin(9600); // Open serial communications and wait for port to open:
  
  mySerial.begin(9600); // set the data rate for the SoftwareSerial port
}

void loop() // run over and over
{
  if (mySerial.available())

   {
     if (mySerial.read() == '1')
      digitalWrite(led, HIGH);   // set the LED on
      Serial.println("LED ON");        
   }
   {
     if (mySerial.read() == '2')
      digitalWrite(led, LOW);   // set the LED on
      Serial.println("LED OFF");      
   }
  delay(100);                    // wait 100ms for next reading
}



In this code source, We use the library SoftwareSerial.h to emulate a Serial Port in the digital ports 10 and 11... and then, if Arduino receives de conditions "1" or "2", it switchs on or switchs off a Led and sends a message through the original Serial Port.


See you!!

Saturday 17 November 2012

JY MCU Bluetooth Module

Hello!!

Today I'm speaking about the JY MCU Bluetooth Module which I bought several days ago in Deal Extreme. It's a good and cheap option and almost a plug and play device to play with wireless connections using your Arduino.


JY MCU Bluetooth Module

Wiring:

It's very easy. You only have to connect four pins (TX, RX, VCC and GND) in this way:

TX BT Module ------------------> RX Pin Arduino
RX BT Module ------------------> TX Pin Arduino
VCC BT Module <---------------> 3,3V Pin Arduino
GND BT Module <---------------> GND Pin Arduino

JY MCU Bluetooth Module Test Assembly



Testing:

Well, we have our Arduino and our BT Module connected. Remember, I didn't configure anything in our BT Module (the Settings can be configured but now we are going to work with default settings)... but Now we need another device that will connect with our Arduino Nano. In this case, I have used my Android Mobile running a classic BT App (this make it possible to connect and send/receive basic strings that will be interpreted by the embedded software of our Arduino).

The App is Amarino 2.0:



Here, we can send and receive basic strings to our connected device (it connects directly, the default PIN Code is 1234, and de baudrate is 9600)... but We need to do something with de data sent by the mobile, so we need the Arduino Code.


Code:

I have done a basic programme with the following features:

  • If I send the number "1" the led switchs on.
  • If I send the number "2" the led switchs off.
  • If I send the number "3" the led blinks once.

And the code is:


char lecturaSerie = Serial.read();
int led = 13;

void setup() {                

  pinMode(led, OUTPUT);  
  Serial.begin(9600);
}

void loop() {
  if( Serial.available() )       // if data is available to read
  {
    lecturaSerie = Serial.read();         // read it and store it in 'val'
  }
  if ( lecturaSerie == '1' )
  {
  digitalWrite(led, HIGH);   // set the LED on
  }
  if ( lecturaSerie == '2' )
  {
  digitalWrite(led, LOW);   // set the LED on
  }
  if ( lecturaSerie == '3' )
  {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
  }
  
  delay(100);                    // wait 100ms for next reading
}



Note: To upload the code to the Arduino you need to disconnect the BT Module. 
Note2: When your BT Device isn't connected, a red led will be blinking, and if it's "pair" this led will be swiched on.




See you!!


Android Apps: Arduino Companion

Hello!

If you are beginning with Arduino you need a reference and Android gives us some possibilities, for example this app: Arduino Companion by Jens C Brynildsen.



This App is very useful if you need an off-line reference about functions, libraries, control structures... and with a lot of basic examples which help us to learn more about the Arduino Programming. 

Some caps: 
App Caps. Google Play Store.


See you!

Friday 16 November 2012

Arduino Nano Compatible

Hello!

Arduino project is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and sofware. It's very nice to see how an open-source projetc is so important and has a lot of data and users on the Internet.

Today I am going to tell you something about the Arduino Nano. This is the little child of the Arduino's family, but it offers a lot of options and very interesting features.


If you want to know more about Arduino Nano you can visit this page:



But in this post I don't want tell you more things about the features and data of the Arduino Nano (it's boring and you have the web of Arduino to read about the specifications of this device). In this post I want to talk about the Arduino Compatible Nano V3.0 of Deal Extreme.



This isn't the real and authentic Arduino, but this is a very cheap option with the same features and specifications and it's very good to begin in Arduino's World. Three weeks ago I ordered it and now I have it in my hands. It's perfect to test your electronic projets using Arduino's platform and if you have a protoboard you will be able to probe it quickly.

For example, the classic Hello World: A led blinking.

/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, LOW); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}



Verify... Compiling... Upload (simply conect your USB to the mini-USB port of your Nano, Select on Tools --> Board --> Arduino nano w/ AtMega328 and go on!).




See you in the next chapter :)

Hello World!


I admit it, it isn't my first time, other blog projects died on the way, but I think that this is the definitive blog... The most important blog in my life because it's about one of my passions: Electronics... and crazy geek ideas.

Welcome and I hope it is useful to everybody... and sorry for my English, I'm trying to improve it :)