Monday, November 30, 2015

How to use ESP8266 WiFi Shield for Arduino and other micros-Robomart

This is a simple tutorial for how to use ESP8266 WIFI Shield for Arduino and other micros. This tutorial is very interesting. The step wise processor to use ESP8266 WiFi Shield for Arduino and other micros.



Step 1: Needed Parts
For this Project we will need some parts.This ESP8266-01 WiFi Shield needs the following parts, or similar. 
•36-pin header
Bourns 4606x-101-332LF Resistor Network
•1 off 1N5819 Schottky Diode 
•1 off 330R resistor 
Step 2: Structure


Step 3:Programming the WiFi Shield


   

// =============== start of pfodWifiWebConfig settings ==============

// update this define with the password from your QR code
//http://www.forward.com.au/pfod/secureChallengeResponse/keyGenerator/index.html
#define pfodWifiWebConfigPASSWORD "b0Ux9akSiwKkwCtcnjTnpWp"
You can also set your own configuration Access Point name, if you wish.
Step 4: How to Configur the WiFi Shield




Step 5: Using the WiFi Shield
In a complete project, you would mount a momentary push button on the outside of your project's box connected to the CONFIG_LINK, and instruct the user to press the push button and then power up the device to get into config mode. The code you loaded into the ESP8266-01 also drives the ESP8266's GPIO0 pin LOW when the module is in config mode, so you can connect a 270ohm resistor and LED between the 3.3V rail and GPIO0 and mount the LED on the outside of the box, to indicate to the user that they are in config mode.
As mentioned above any sketch you load into your Arduino, or other micro-processor, needs to a short delay to skip the debug output from the ESP8266 module. Other than that, to receive and send data via WiFi, from your sketch, you just read and write to your serial port (connected to D0,D1) at 9600 baud. So to ignore the ESP8266's debug output add to a short delay at top of the setup() method
void setup() {  
   delay(1000); // wait here for a second let ESP8266 complete powering up 
  // this also skips the WiFi Shield's debug output on power up
  // before starting the Serial connection.
  .... other setup code here
The example here uses an Arduino UNO but you can use any micro-processor, either 5V or 3.3V based that has a UART. If you use a 3.3V micro-processor, you will need to supply 5V to the WiFi Shield's power supply. This 5V will also be connected to the shield's 5V pin, so you need to check that this is acceptable for the micro you are plugging the shield into.


In the whole project , you CONFIG_LINK connected to your project a momentary push button mounted on the outside of the box , and press the push button and then the configuration mode to instruct the device to be powered .
Module Config mode when you load code also ESP8266 ESP8266-01 GPIO0 the drive pin is low , then you connect a 270ohm resistor and 3.3 GPIO0 between rail and led out of the box can mount LED , they indicate that the user is in config mode .
void setup() {  
   delay(1000); // wait here for a second let ESP8266 complete powering up 
  // this also skips the WiFi Shield's debug output on power up
  // before starting the Serial connection.
  .... other setup code here
The example uses an Arduino Uno , but any micro - processor can use , 5V or 3.3V that are based on either a UART . If you use a 3.3 micro - processor , WiFi Shield you will need to supply power to the 5V supply . This is acceptable for micro you are plugging into the hillside that needs to be examined , so it also 5V , 5V pin will be connected to the shield .
Then via WiFi from your Android mobile on and off in turn connect to the leadership of the United Nations .
That's it finished!!
Step 6: Conclusion
This Rev 2 of the ESP8266-01 WiFi Shield uses the cheap and readily available ESP8266-01 module. Other ESP8266 modules can also be used.
Once programmed you never need to program it again to set or change the network settings. They can all be set via a web page on a secure temporary WiFi network.
It is simple to interface to any micro that has a UART and works with on both 5V or 3.3V micro-processors.
No libraries are required to connect to this shield. It runs as a simple Serial to WiFi bridge.

You have completed this project sucessfully and easily. This is a simple tutorial. Feel free to edit this.
Have fun!!!

How to make Arduino Mothbot-Robomart

This is a simple tutorial to make Arduino Mothbot. This is very interesting tutorial for this project. The step wise processer to make Arduino mothbot.

This project aims to design and using an Arduino Duemilanove microcontroller board is to build a simple light following robot. I really build a simple and cheaper robot project. I hope I have succeeded to make this project. It’s a simple tutorial  to make Arduino Mothbot. To make this project you can follow this tutorial and copy the code.
Step 1:Needed Parts and Tools
•Safety Goggles

•Adjustable wrench or 11/32" hex wrench
•1/16", 5/32" and 7/32" drill bits
•Small Phillips (4-sided) screw driver
Saw (optional)
Drill
Step 2:Planning Stage

In my planning phase I did not only looked at hardware and coding but did my electronics homework as well. I wanted to draw up a simple electronics schematic for this project so I could follow what was going on as I made it. You can see in the picture the different components, power lines, and the Arduino pins. Hopefully it's a clear diagram and also illustrate how simple the electronics for this project.
Step 3: Connecting Servos to  Arduino


Below are the steps to connect the motor to the Arduino.
  • Once the ground and power lines are identified connect the ground of the Arduino board to the ground strip on the solderless breadboard. Do not connect the power to the solderless breadboard yet.
  • The first thing to do when setting up the solderless breadboard is to set up the ground (GND) and power (+6V) for the servos. I chose to use the two long strips on the board that would be closest to the Arduino.
  • Attach the jumper wires to the end of the servo wires and then each servo to the solderless breadboard.
  • Each servo has three wires that come out of them. Mine have a black, red, and white wire for each. The black is for ground, the red is for power, and the white is the control wire. Cut three jumper wires for each servo of the same size .
  • Now use jumpers to connect the ground and power from each servo to the ground and power of the solderless breadboard.
  • Now connect the control wires from each servo to the Arduino. Connect the left servo to digital output (PWM) 3 and the right servo to digital output (PWM) 11.
  • Finally, connect the ground and power from the 4AA batteries to the solderless breadboard ground and power. Don't be alarmed if the servos start moving when your Arduino has no power or is not yet programed.
  • Using the code you should now be able to run the motors in the forward, backward, left or right directions using the included functions.
Step 4: Test out the Motors


/* 
* Arduino Mothbot
* Digital Pin Wiring: 
*         pin 11 - Right Servo Signal 
*         pin  3 - Left Servo Signal 
* License: This work is licenced under the Creative Commons 
*          Attribution-Share Alike 3.0 Unported License. To 
*          view a copy of this licence, visit 
*          http://creativecommons.org/licenses/by-sa/3.0/ 
*          or send a letter to Creative Commons, 171 Second 
*          Street, Suite 300, San Francisco, California 94105, 
*          USA. 
*/ 
//------------------------------------------------------------------------ 
// START OF ARDUINO MOTHBOT SETUP 
//--- Library 
#include <Servo.h>
//--- Pin Definitions 
#define LEFTSERVOPIN  3    //The digital pin that the left servo is connected to 
#define RIGHTSERVOPIN  11    //The digital pin that the right servo is connected to 
//--- Servo Setup 
Servo leftServo;         
Servo rightServo; 
//--- Speed Setup 
int robotSpeed = 75;  //set the speed of the robot 
int rightSpeed = 50; 
int leftSpeed = 50; 
//--- Delay Threshold 
int delayParam = 10;  //Supported Times - 0 - 255 (0 to 25.5 Seconds) value * 100 milliseconds 
// END OF ARDUINO MOTHBOT SETUP 
//------------------------------------------------------------------------ 
//------------------------------------------------------------------------ 
//START OF ARDUINO MOTHBOT PROGRAM 
//--- The program setup 
void setup()                
{  
Serial.begin(9600);                //Starts the serial port  
robotSetup();                      //sets the state of all neccesary
                                      //pins and adds servos to your sketch 
//--- The main program code 
void loop()                   
{      
Serial.println("Forward");      
goForward();      
delay(delayParam * 100);      
goStop(); 
//END OF ARDUINO MOTHBOT PROGRAM 
//------------------------------------------------------------------------ 
//------------------------------------------------------------------------
//START OF ARDUINO MOTHBOT FUNCTIONS 
//--- The setup for the robot 
void robotSetup()
{  
//--- Set the speed of the robot  
setSpeed(robotSpeed);  
//--- Set up the servos  
pinMode(LEFTSERVOPIN, OUTPUT);     //sets the left servo signal pin
                                  //to output
pinMode(RIGHTSERVOPIN, OUTPUT);    //sets the right servo signal pin
                                  //to output  
leftServo.attach(LEFTSERVOPIN);    //attaches left servo  
rightServo.attach(RIGHTSERVOPIN);  //attaches right servo  
//--- Tell the robot to stop the servos  
goStop(); 
//--- Set the speed of the robot between 0-(stopped) and 100-(full speed) 
void setSpeed(int newSpeed)
{  
setSpeedLeft(newSpeed);                   //sets left speed  
setSpeedRight(newSpeed);                  //sets right speed 
//--- Set the speed of the left wheel 
void setSpeedLeft(int newSpeed)
{  
if(newSpeed >= 100) {newSpeed = 100;}    //if speed is greater than 100
                                        //make it 100  
if(newSpeed <= 0) {newSpeed = 0;}        //if speed is less than 0 make
                                            //it 0  
leftSpeed = newSpeed * 0.9;              //between 0 and 90 
//--- Set the speed of the right wheel 
void setSpeedRight(int newSpeed)
{  
if(newSpeed >= 100) {newSpeed = 100;}     //if speed is greater than 100
                                             //make it 100  
if(newSpeed <= 0) {newSpeed = 0;}         //if speed is less than 0 make
                                             //it 0  
rightSpeed = newSpeed * 0.9;              //scales the speed to be 
//--- Move the robot forward 
void goForward()
{  
leftServo.write(90 + leftSpeed);  
rightServo.write(90 - rightSpeed); 
//--- Move the robot backward 
void goBackward()
{  
leftServo.write(90 - leftSpeed);  
rightServo.write(90 + rightSpeed); 
//--- Move the robot right 
void goRight()
{  
leftServo.write(90 + leftSpeed);  
rightServo.write(90 + rightSpeed); 
//--- Move the robot left 
void goLeft()
{  
leftServo.write(90 - leftSpeed);  
rightServo.write(90 - rightSpeed); 
//--- Stop the robot 
void goStop()
{  
leftServo.write(90);  
rightServo.write(90); 
//END OF ARDUINO MOTHBOT FUNCTIONS 
//------------------------------------------------------------------------
Step 5: Integrating the On/Off switch


Step 6: How to Integrate the Light Sensors 

Step 7: Make the Mothbot Body


The robot you're building is really no good unless it can hold itself together. For this reason it needs a body. I tried my best to make this as simple a construction project as possible. You are, however, going to have to do a little work on your own to figure out the right measurements. I suggest the age old "measure twice, cut once" method.
Step 8: How to make the wheels

Wheels, It was a difficult problem for me. I actually certified robot wheels but they were realized a very heavy. I have chosen to servos there was no way to attach them . I have a similar project for the high school remembered that when using the jar lids . So it's a great looking robot wheel option was off to the store .
A wheel of a Ziploc Twist ' n Loc lid of the container is made from . Other good peanut butter jar lids or other food items are on . I advocate wasting food but save your eyelids and you can get the right size for your robot project is not . I thought I have collected leftover containers used to hold parts .
Step 9: Complete the Arduino Mothbot
With the body and wheels assembled it's easy to place the Arduino and solderless breadboard just a top the robot body. Make sure you can still reach the USB input on the Arduino in case you need to change the programming. I used some black electrical tape underneath each to stick them to the body. Electrical tape is easy to remove and holds quite well.
  • Tape the Arduino and solderless breadboard to the top of the robot body that you've built.
  • Using tape again it's a good idea to connect the 4AA battery holder and the 9V battery to the body. Make sure the wires reach.
  • Connect the servo wires to the solderless breadboard if you had removed them previously.
  • Connect the Arduino power
  • Connect the servo motor power
  • Now place your robot on the ground and press the on/off switch! It should now come to life and chase the light around the room. 

As a future add-on project I would include a simple bumper or wall sensor. This would be a switch, much like the On/Off button used in this project. However, when the button was pushed it would tell the robot to reverse direction, turn left or right, and continue with the program. Once that is completed this robot would be a great little testing platform for other sensors and devices.
You have done this project sucessfuuly. Have Fun!!!


Saturday, November 28, 2015

How to make Arduino Trumpet-Robomart

This is simple project using the three buttons, emulates a trumpet by playing notes. This is so easy to make and fun to play with, though it can only play one octave and no flats.
Step 1: Code

Load this code into your Arduino:
int speaker = 9; // Hook up speaker to digital pin 9
int sw1 = 15; // Switch hooked to analog pin 1
int sw2 = 16; // Switch hooked to analog pin 2
int sw3 = 17; // Switch hooked to analog pin 3
int valve1; 
int valve2; 
int valve3; 

void c () { // Presets the note "c" to be used later
digitalWrite(speaker, HIGH);
delayMicroseconds(1915);
digitalWrite(speaker, LOW);
delayMicroseconds(1905);
}
void d () {
digitalWrite(speaker, HIGH);
delayMicroseconds(1700);
digitalWrite(speaker, LOW);
delayMicroseconds(1690);
}
void e () {
digitalWrite(speaker, HIGH);
delayMicroseconds(1519);
digitalWrite(speaker, LOW);
delayMicroseconds(1509);
}
void f () {
digitalWrite(speaker, HIGH);
delayMicroseconds(1432);
digitalWrite(speaker, LOW);
delayMicroseconds(1422);
}
void g () {
digitalWrite(speaker, HIGH);
delayMicroseconds(1275);
digitalWrite(speaker, LOW);
delayMicroseconds(1265);
}
void a () {
digitalWrite(speaker, HIGH);
delayMicroseconds(1136);
digitalWrite(speaker, LOW);
delayMicroseconds(1126);
}
void b () {
digitalWrite(speaker, HIGH);
delayMicroseconds(1014);
digitalWrite(speaker, LOW);
delayMicroseconds(1004);
}
void C () {
digitalWrite(speaker, HIGH);
delayMicroseconds(956);
digitalWrite(speaker, LOW);
delayMicroseconds(946);
}

void setup() {
pinMode(speaker, OUTPUT);
pinMode(sw1, INPUT);
digitalWrite(sw1, HIGH);
pinMode(sw2, INPUT);
digitalWrite(sw2, HIGH);
pinMode(sw3, INPUT);
digitalWrite(sw3, HIGH);
// Serial.begin(9600);
}

void loop() {
valve1 = digitalRead(sw1); // Reads switch 1
valve2 = digitalRead(sw2); // Reads switch 2
valve3 = digitalRead(sw3); // Reads switch 3

if ((valve1 == LOW) && (valve2 == LOW) && (valve3 == LOW)) { // If all valves are pressed, then
c(); // It plays a "c"
}
else if ((valve1 == LOW) && (valve2 == HIGH) && (valve3 == LOW)) { // If the first and third valves are pressed, then
d(); // It plays a "d"
}
else if ((valve1 == LOW) && (valve2 == LOW) && (valve3 == HIGH)) { // If the first and second valves are pressed, then
e(); // It plays a "e"
}
else if ((valve1 == LOW) && (valve2 == HIGH) && (valve3 == HIGH)) { // If the first valve is pressed, then
f(); // It plays a "f"
}
else if ((valve1 == HIGH) && (valve2 == HIGH) && (valve3 == HIGH)) { // If no valves are pressed, then
g(); // It plays a "g"
}
else if ((valve1 == HIGH) && (valve2 == HIGH) && (valve3 == LOW)) { // If the third valve is pressed, then
a(); // It plays a "a"
}
else if ((valve1 == HIGH) && (valve2 == LOW) && (valve3 == HIGH)) { // If the second valve is pressed, then
b(); // It plays a "b"
}
else if ((valve1 == HIGH) && (valve2 == LOW) && (valve3 == LOW)) { // If the second and third valves are pressed, then
C(); // It plays a "C"
}
else{
delay(1);
}
}
Step 2: How can hook it up
Each of the three switches go to analog from ground in 1, 2, and 3. The Piezo goes from digital pin 9 to ground. Make sure to have the switches in the right order in order to have the correct fingerings. Afterwords, download the file and upload it to your Arduino.
Step 3: Resources

For this project you will need: 
Project box (4x2x1) 
Drill and 1/4 in bit along with 1/16 in
•3 momentary switches (NO) 
Step 4: Put it Together!!
First of all, open the box and on the outside of the box, mark the center and an inch out from the center. Where you will need to make a 1/4 in hole Now, dremel out the scraps of plastic and used the holders to hold a PC inside.
Step 5: How can I Fit it!



Insert switches and make sure that they fit and screw them . They are situated in the right place and enter the PIN and drill bit to drill holes with a 1/16 mark .
Step 6: Wireing

Now, wire and solder each of the analog input posts and attach the other side to the corresponding switch. Make sure to not get mixed up and solder the wrong switch to the wrong pin. Like before, solder the piezo to pin 9 and ground and the battery clasp to ground and voltage in. 
Step 7: Playing
Fingerings on the trumpet to trumpet a general ' as are' . ' Identical ' I mean , I had to make some changes .


on a normal trumpet its like this:
c..........0pen
d..........1-3
e..........1-2
f ..........1
g..........0pen / 1-3
a..........1-2 / 3
b..........2
C..........0pen / 2-3
________________________________________
On the Arduino Trumpet:
c..........1-2-3
d..........1-3
e..........1-2
f ..........1
g..........0pen
a..........3
b..........2
C..........2-3

I used half-step complicated and changing things and switches can put a octive . It would be awsome , however , it may be more complex and will require a large box .
HAVE FUN!!!!

How to make Bluetooth Controlled Robot arm-Robomart

This is a step wise and simple tutorial to make Bluetooth Controlled Robot arm.

Step 1: Requirements 

2 USB to serial cables
SSC-32
Step 2: Set up

Connect the Arduino and SSC-32 boards.. Also remember to set the baud rate to 9600.
Connect the servos onto the SSC-32 servo controller. Each servo represents a joint on the arduino robot arm. The servo configuration is like this
•Gripper Servo: HS-311 servo motor SSC-32 pin: 7
•Elbow joint Servo: DF15MG high torque SSC-32 pin: 20
•Base joint Servo: DF05BB high torque SSC-32 pin: 16
•Wrist (rotation) Servo: HS-311 servo motor SSC-32 pin: 4
•Shoulder joint Servo: DF15MG high torque SSC-32 pin: 19
•Wrist (y axis) Servo: DF05BB high torque SSC-32 pin: 15

You can use your own configuration. You do not have to connect the servos on the pins I have specified.
Connect the power supply. In this case i am powering both servo channels with a battery and the logic via USB. You can check powering options to see the different powering options you have.
In the end of this tutorial I am upload a sample code you can check it.
Step 3: Arduino arm code
void setup() //initializing serial communication baud rate

{
  Serial.begin(9600);
}

/* Procedures to be used in the Demo. 
   Move the object from the ground onto the platform.
*/

void homes()//returns to initial position
{
  Serial.println("#7 P1000 T500");
  delay(1000);
  Serial.println("#4 P1300 T500");
  delay(1000);
  Serial.println("#15 P2350 T500");
  delay(1000);
  Serial.println("#19 P1000 T500");
  delay(1000);
  Serial.println("#16 P500 T500");
  delay(1000); 
}

void foward()//moves the arm forward
{
  Serial.println("#20 P1200 T1000");
  delay(1000);
  Serial.println("#19 P1300 T1000");
  delay(1000);
  Serial.println("#15 P1800 T1000");
  delay(1000);
}

void back1()//moving the arm backwards 
{
  Serial.println("#19 P1000 T500"); 
  delay(1000);
  Serial.println("#15 P2350 T500");
  delay(1000);
}

void back2()//moving the arm backwards 
{
  Serial.println("#15 P2330 T500");
  delay(500);
  Serial.println("#16 P1500 #19 P1000 #20 P1200 T1000");
  delay(500);
}

void lift()//lifts the robot arm
{
 Serial.println("#16 P2400 #19 P1300 #20 P1700 T1000");
  delay(1000);
}

void grip()//Gripping the object
{
  Serial.println("#7 P1550 T500");
  delay(1000); 
}

void drop()//Drops the object
{
  Serial.println("#15 P1900 T500");//moves wrist servo to position 1900
  delay(1000);
  Serial.println("#7 P1000 T1000");
  delay(500); 
}

void turnC()//turns the arm clockwise
{
  Serial.println("#16 P500 T1000");
  delay(1000);
}

void turnA()//turns the arm anticlockwise
{
  Serial.println("#16 P2400 T1000");
  delay(1000);
}
void halfturn()//turns the arm clockwise
{
  Serial.println("#16 P1500 T1000");
  delay(1000);
}

void loop()
{  
    //Pick the object and place it on platform
    homes();
    delay(1000);
    foward();
    delay(1000);
    grip();
    delay(1000);
    back1();
    delay(1000);
    halfturn();
    delay(500);
    lift();
    delay(2000);
    drop();
    delay(1000);
    back2();
    delay(500);
}

After the wiring and uploading the code this project is successfully complete. Have fun with this project.