Monday, June 18, 2018

Bluino Loader - How to program Arduino via Bluetooth

In this post I've found an interesting project to use with Arduino. This is a project where you can upload Arduino Sketches to your Arduino board via Bluetooth connection only.


This means that you only need to connect Arduino board to your PC or Laptop only once for first time programming and configuration and then use your Android Phone to write code, compile and then upload sketches to your Arduino directly via Bluetooth.

Cover art

Success Story

The maker  sure has a very successful story of making and designing. The concept is all built around the powerful Android application that does it all.
The maker is so smart as he took the hardware open source approach with his concept. He has even designed his own Arduino Shield that made the same function and compatible with his application.
The maker offers the application for free on Google Play Store with the availability to buy the Pro version of the app.

Materials

Picture of Materials and Tools

Hardware :
Software :
  • Bluino Loader from the Google Play store

Steps

Program using PC or Laptop

void setup() {
  Serial.begin(38400);
  delay(500);   
  Serial.println("AT+NAME=Bluino#00");
  delay(500);
  Serial.println("AT+UART=115200,0,0"); // Use this baudrate if using for Arduino Uno, Bluino and Mega2560
//Serial.println("AT+UART=57600,0,0");  // Use this baudrate if using for Arduino Nano, Leonardo, Micro, Pro Mini 3V3/5V and Duemilanove
  delay(500);
  Serial.println("AT+POLAR=1,0")
  delay(500);
}

void loop() {
}

This step comes first to configure Arduino and Bluetooth module for the process.
You need to upload the code to Arduino.
This code contains several functions to change the parameters of Bluetooth HC-05 :
  • AT+NAME=Bluino#00 : Change name of bluetooth module, default name is "HC-05".
  • AT+BAUD=115200,0,0 : Change baud rate to 115200 (Arduino Uno, Bluino and Mega2560)
  • AT+BAUD=57600,0,0 : Change baud rate to 57600 (Arduino Nano, Leonardo, Micro, Pro Mini 3V3/5V and Duemilanove)
  • AT+POLAR=1,0 : Change state pin conditio
  • For additional you can change password to use not standard password while pairing, AT+PSWD=xxxx.
Note

Name of bluetooth must "Bluino#00-9999", if you want custom name you should use the paid version of Bluino Loader App.

Connection

Picture of Hook Up Like Schematic

Note the capacitor and resistor connected between Arduino and Bluetooth. Those components are important for resetting Arduino after sketch upload finishes.
Picture of Hook Up Like Schematic

Setup Bluetooth HC-05

This is the step where you will run the code you uploaded to Arduino while the Bluetooth module is connected to Arduino.
Picture of Time to Setup Bluetooth HC-05
Note this carefully. You need to force the Bluetooth module into AT command mode using these steps.
Press and hold KEY button
• Plug USB cable for powering Arduino
• Wait about 5 second (still hold KEY button)
• Unplug and re plug USB for reset from AT command mode


Install and run the application

The application looks like Arduino IDE

Picture of Try Upload Sample Sketch Blink.ino Into Arduino Using Android Device Over Bluetooth

Here you can write, compile and then upload sketches to your Arduino project without having troubles connecting it to PC or Laptop.

Of course the first program that comes in mind when trying this method is the Blink example.

  • After installing the app you can open example sketch BluinoLoader/examples/02.Basic/Blink/Blink.ino
  • Tap on "upload" button (Arrow in the circle icon)
  • After done compiling no error, tap button "Scan Bluino Hardware" to search active bluetooth
  • Pick bluetooth hardware with name "Bluino#00"
  • Enter pairing code standard "1234", then OK
  • Wait until process uploading done
After all steps your Arduino will blink on led 13, and you can repeat all the steps to upload another sketch.
Congratulations ..  You have made your Bluetooth Programmable Ready Arduino project.
Now you can write any code and then compile it and then upload it all using your smart Android.
Thanks  mansurkamsur. Keep going.

Source: instructables

Saturday, June 16, 2018

Arduino Tug - Arduino Aircraft Towing Machine

Towing an aircraft has been there for a long time without any change. Only when you see larger aircraft you can notice how those towing and push-back machines (Tugs) are getting bigger.

Tugs are those machines powered by traditional fossil fuel to move aircrafts on the ground to save highly priced Jet Fuel on the ground in an operation known as Aircraft Taxiing.



Now electric tugs are beginning to be popular and gain more attention from airliners.
To save conventional fuel and to save the planet from harmful fossil fuel emissions, transforming to electric power is the better solution in all transformation means.

There are some different versions and inventions implementing the idea of electric towing and push-back. Here are tow of them.

  • WheelTug

WheelTug is an electrical system which enables an aircraft to push-back and taxi without using its own engines or an external tug. WheelTug reduces the time an airplane spends on the ground, allowing it to spend more time in the air. It saves time, money and fuel consumption.



  • Mototok

Mototok provides a family of innovative solutions for aircraft towing and hangar management.
The company provides state of the art series of innovative electric tugs that can be used with aircrafts of up to 195 tons of weight.
Mototok products can be remotely controlled by a single person operation.

It's available for a wide range of Military, Commercial Airliners and Helicopter aircrafts with different models.






Arduino Controlled Aircraft Tug



Anthony DiPilato wanted to make his own aircraft tug that can be controlled from his iPhone. So he decided to use Arduino Mega and an  HC-08 Bluetooth module to build it.

Wrote the software for Arduino and an iPhone interface to control it.

This little device looks like a little tank and can move light aircrafts.

But it's capable of pulling a Cessna 310 with an estimated weight of 5,200 lbs.



Design and Bill of Material










Device Testing





Tug in Action






Sources:
Author website

Arduino Website

























Tuesday, May 15, 2018

Meet Pinguino - PIC based Arduino compatible DIY board

If you came to this post then you probably are an Arduino enthusiast and you want to make your own Arduino.


There are many Arduino compatible boards out there.


In this list you can find many Arduino compatible circuits and projects that are Atmel and Non-Atmel based.

In this post, I'll show you an Arduino code compatible project that is based on PIC Microcontroller.

Pinguino is a project based on PIC Microcontroller from Microchip Manufacturer.


I'm a big fan of PIC microcontroller long before I knew Arduino. So once I knew about Pinguino I got excited to build it.


It supports a wide range of Microcontrollers including 8 and 32 Bits.

It has its own IDE but it's code compatible with Arduino.

This means that you can use the code written for Arduino in your own Pinguino projects.

Components


Connections




Circuit

Steps

You can find detailed instructions of how to build this circuit step-by-step on my instructables page and on my blog.

https://www.instructables.com/id/Pinguino-Egypt-PIC-Based-Arduino/ 

http://embedded-egypt.blogspot.com.eg/2014/02/pinguino-egypt-do-it-yourself-pic.html







Source: My Instructables Page


Sunday, May 13, 2018

Arduino IR Heart Rate Monitor - How to measure your heart rate using Arduino and simple electronics

Today I found a simple circuit that uses Arduino and simple electronic components to measure and visualize heart rate.



There are many circuits out there that uses Arduino boards and a special heart rate sensor.

Although I don't yet know the idea behind that heart rate sensor but I think it could be simple.

That's why I searched further until I could find this simple circuit in this post.

This circuit is so simple that it only contains Arduino board and IR transmitter and receiver as the heart rate sensor.

I know this is very simple and primitive, but it's efficient.

You can find many circuits with expensive sensors or larger circuits that use many amplifiers and OP-AMPs.

But this one is fairly simple and enough for the job.


Theory of operation
The IR (infrared) transmitter and receiver are used to measure the blood flow which corresponds to the heart rate.

The Arduino processor then processes the received signal and filters it to get a cleaner indication of the heart rate based on the blood flow in your finger.



Components
Arduino Uno 
IR emitter and detector
100 Ohm resistor
10K Ohm resistor



Connections



Circuit


Code

Arduino Code

#include
#include
#include
#include
#include
#include

float amplifiedSignal;
float filteredSignal;

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


// filter out frequencies below 1 Hz.
float highFilterFrequency = 1;  

// create a highpass filter that only keeps frequencies above highFilterFrequency
FilterOnePole filterOneHighpass( HIGHPASS, highFilterFrequency );  

// filters out frequenceies greater than 3 Hz.
float lowFilterFrequency = 3;  

// create a lowpass filter that only keeps frequencies below lowFilterFrequency
FilterOnePole filterOneLowpass(LOWPASS, lowFilterFrequency);  


void loop() {
  
//The next line applies a band pass filter to the signal

  amplifiedSignal = 100*analogRead(A0);
  filteredSignal = filterOneHighpass.input(filterOneLowpass.input(amplifiedSignal));

  Serial.println(filteredSignal);



}


Processing code

import processing.serial.*;

Serial myPort;        // The serial porthe
int xPos = 1;         // horizontal position of the graph 

//int xPos = millis()/1000;

//Variables to draw a continuous line.
int lastxPos=1;
int lastheight=0;

int screenWidth = 600;
int screenHeight = 400;

int pulseNumber = 0;
boolean pulseHigh = false;
int startTime;
int stopTime;
int heartRate;

void makeGrid(int screenWidth, int screenHeight){
  stroke(0,255,0);
  strokeWeight(0.5);
  line(0, screenHeight/2, screenWidth, screenHeight/2);
  
  for (int i = 0; i <= 10; i = i+1) {
    line(i*screenWidth/10, 0, i*screenWidth/10, screenHeight);
    line(0, i*screenHeight/10, screenWidth, i*screenHeight/10);
  }
}

void setup () {
  // set the window size:
  size(screenWidth, screenHeight);        

  // List all the available serial ports
  println(Serial.list());
  // Check the listed serial ports in your machine
  // and use the correct index number in Serial.list()[].

  myPort = new Serial(this, Serial.list()[0], 9600);  //

  // A serialEvent() is generated when a newline character is received :
  myPort.bufferUntil('\n');
  background(0);      // set inital background:
  
  makeGrid(screenWidth, screenHeight);
   
  
}
void draw () {
  // everything happens in the serialEvent()
}



void serialEvent (Serial myPort) {
  // get the ASCII string:
  String inString = myPort.readStringUntil('\n');
  if (inString != null) {
    inString = trim(inString);                // trim off whitespaces.
    float inByte = float(inString);           // convert to a number.
    
    if (inByte >= 0 && pulseHigh == false){
      if (pulseNumber == 0){
        startTime = millis();
        //println("first");
      }
      else{
        stopTime = millis();
      }
      pulseNumber = pulseNumber + 1;
      //println("next");
      pulseHigh = true;
    }
    
    else if (inByte <= 0 && pulseHigh == true){
      pulseHigh = false;
    }

    
    
    inByte = map(inByte, -1023, 1023, 0, height); //map to the screen height.
    
    //Drawing a line from Last inByte to the new one.
    stroke(255,0,0);     //stroke color
    strokeWeight(4);        //stroke wider
    line(lastxPos, lastheight, xPos, height - inByte); 
    lastxPos= xPos;
    lastheight= int(height-inByte);
    

    // at the edge of the window, go back to the beginning:
    if (xPos >= width) {
      xPos = 0;
      lastxPos= 0;
      background(0);  //Clear the screen.
      makeGrid(screenWidth, screenHeight);
      
      heartRate = 60*1000*(pulseNumber-1)/(stopTime-startTime);
      textSize(16);
      //text("This is your heart beat. Your heart rate is " + str(heartRate) + " bpm.", 10, 30); 
      //fill(0, 102, 153);
      
      pulseNumber = 0;
    } 
    else {
      // increment the horizontal position:
      xPos++;
    }
  }

}



Results






Source: Instructables


















Arduino Permanent Memory - How to use Arduino EEPROM Memory

Have you ever built an embedded system and wanted to store memory that lasts after you switch off the power of the system?

Arduino boards is based around the AVR microcontroller that has built in EEPROM memory which is not volatile after you switch off the power of the circuit.

This means that you don't need any external hardware or ICs when you need to store some small amount of data or system settings.

Circuit

When you test this code you only need Arduino UNO board as your circuit.


Code

#include

void setup()
{
  for (int i = 0; i < 255; i++)
    EEPROM.write(i, i);
}

void loop()
{
}

Source: Arduino Website

Friday, May 11, 2018

How to make an Arduino Tide Clock for Marine Life Simulation

Tide clock is a clock that displays times to/past high and low tides instead of displaying real time.

Image result for Tide clock


Inspired by the marine life, today I found a project that uses Arduino to simulate high and low tides into an artificial environment for marine life simulation.

The project has both electronic and mechanical parts.

The electronic part features Arduino and a real time clock to calculate tide times.

The three components of my simple tide clock from left to right: Arduino Pro Mini 3.3V (red), Real Time Clock (blue), SSD1306 OLED display.



While the mechanical part features parts that control water flow and level into the artificial marine life environment.

Functional diagram and illustration of the tide height control system.




Source: PeerJ


Saturday, May 5, 2018

Arduino Train - How to make an Arduino Controlled Model Train

In this post I found this instructable that makes a beautiful yet easy useful toy for your kids.

Today I found an Arduino controlled model train that you can move using your phone.




We have seen how it's so easy to control devices using Arduino and Bluetooth module.





This projects implements that idea.

It uses Arduino Nano as a controller and HC-06 Bluetooth module to connect to the smartphone.

Then the train is driver by the L293D H-Bridge.





Components
Arduino Nano
HC-06 Bluetooth Module
L293D H-Bridge

Connections


Picture of Simple Start
Circuit
Picture of Simple Start








Code

// ARDUINORAILMAKET.RU
// SimpleСmdStation.ino
// 05.02.2017
// Author: Steve Massikker

//// GPIO PINS ////

// L298
#define ENA_PIN 3
#define IN1_PIN 4
#define IN2_PIN 5

//// VARIABLES ////
boolean stringComplete = false;
String inputString = "";


void setup() {
  
  // Initialize Serial
  Serial.begin(9600);
  inputString.reserve(16);
  
  // Initialize Motor Driver
  pinMode(ENA_PIN, OUTPUT);
  pinMode(IN1_PIN, OUTPUT);
  pinMode(IN2_PIN, OUTPUT);

}

void loop() {

  if (stringComplete) {

    // ----------- START COMMAND PARSING ----------- //
    
    //THROTTLE
    
    if (inputString.charAt(0) =='t') {
      if (inputString.charAt(1) =='0') {
        analogWrite(ENA_PIN, 0);
      }
      if (inputString.charAt(1) =='1') {
        analogWrite(ENA_PIN, 80);
      }
      if (inputString.charAt(1) =='2') {
        analogWrite(ENA_PIN, 100);
      }
      if (inputString.charAt(1) =='3') {
        analogWrite(ENA_PIN, 150);
      }
      if (inputString.charAt(1) =='4') {
        analogWrite(ENA_PIN, 200);
      }
      if (inputString.charAt(1) =='5') {
        analogWrite(ENA_PIN, 255);
      }
    }

    // DIRECTION

    if (inputString.charAt(0) =='d') {
      if (inputString.charAt(1) =='r') {
        digitalWrite(IN1_PIN, HIGH);
        digitalWrite(IN2_PIN, LOW);
      }
      if (inputString.charAt(1) =='f') {
        digitalWrite(IN1_PIN, LOW);
        digitalWrite(IN2_PIN, HIGH);
      }
      if (inputString.charAt(1) =='s') {
        digitalWrite(IN1_PIN, LOW);
        digitalWrite(IN2_PIN, LOW);
        analogWrite(ENA_PIN, 0);
      }
    }

    //TEST

    if (inputString.charAt(0) =='j') {
      if (inputString.charAt(1) =='a') {
        digitalWrite(LED_BUILTIN, HIGH);
      }
      if (inputString.charAt(1) =='b') {
        digitalWrite(LED_BUILTIN, LOW);
      }
    }

// ----------- END COMMAND PARSING ----------- //

inputString = "";
stringComplete = false;

  }
}

// ----------- FUNCTIONS ----------- //

void serialEvent() {
  while (Serial.available() ) {
    char inChar = (char)Serial.read();
    inputString += inChar;
      if (inChar == 'z') {
      stringComplete = true;
    }
  }
}








Source : Instructables

Thursday, May 3, 2018

Arduino standalone Audio generation - How to play Audio Signals from Arduino without modules using PCM signals

In this post we'll see how to generate audio signals from Arduino without using any shields or modules.

PCM (Pulse Code Modulation)



Using Arduino and a speaker, you can generate audio signals as if they were coming out from an MP3 player.


Components
Arduino Uno
8 ohm Speaker
TIP 120 Resistor to be used as an amplifier.

Circuit

Picture of Connections



Just connect the amplifier transistor to Arduino and then connect them to the speaker.

Software
Download Audacity and then download software encoder from here.


Arduino code is included in this file.








Source: Instructables