Tag Archives: Arduino

Verbalizer – Google voice search with Arduino

The Verbalizer connects wirelessly to a personal computer via Bluetooth. When you trigger it, it opens google.com in a new tab and activates Voice Search. An audio notification is played, signaling when google is ready for your queryYou speak into the mic, and the query starts. Breakfast released all the plans and firmware appropriately, and left some I/O pins open for those who want to play with it.

Read here

LASER scanners for vector projection

I made a LASER projector with DC motors. This can display only circular forms. I wanted to make one that can display vector graphics. There is an instructable to make these from speakers. I am also trying that but my setup has a lot of distortion.

In this alternative I have used the read head of the CD ROMs to move the mirrors and bounce the LASERS to make figures

What you need

Junk CD drives, screw driver star head, small round mirrors, glue and lot of patience.

You need to open the CD drives part by part till you reach the actual lens mechanism.

cd drive

What we need is a the actual read head with all the mechanism built around it.

lens mechanism

This is actually a set of two coils in between two very powerful magnets and it is used to focus the laser and read the CD. One of the coils moves the lens up and down and the other coil moves it left and right.

My concept was as follows.

Apply a constant voltage to push up the lens. Attach a mirror to it. and use the varying High, Low voltage at both ends to move the mirror left and right.

Following are the pictures that I have taken for my setup.

2012-02-05 22.38.59 2012-02-05 22.38.39

2012-02-05 22.46.51 2012-02-05 23.40.45

2012-02-05 22.38.23

The pictures show different views of the lens mechanisms. Wires have been soldered to the coil ends for the ease of connecting it to the microcontroller board. Mirrors have been glued on the lens and the mirror moves with the lens. Following is the video that shows these in action.

Following pictures have been taken after the setup was done and the microcontroller was programmed to move the mirrors.

I am able to draw something but one of the heads seems to be having some issues as it is creating a lot of distortion.

2012-02-06 00.21.08  2012-02-06 00.21.37

2012-02-06 00.12.43  2012-02-06 00.15.23

2012-02-06 00.55.21  2012-02-06 00.56.44

The pictures show the setup on a cardboard box wit the LASER. A small paper screen has been setup to have a look at the drawing. I was successful in drawing a horizontal and vertical lines. Slanted lines have some distortion and a lot more distortion is noticed when drawing characters.

I will be working on a more stable version and will post all the updates when it is done.

Arduino–breadboard hookup

I have been facing lot of issues with so many hookup wires running between the breadboard and the controller board. A small shake at times dislodges the cables and things stop to work. This inspired me to make hookup cables which do not get dislodged with small shakes and movements.

This is what it looks like

2012-02-06 15.43.08

This is a nice rugged setup when a lot of cables need to run between the arduino and the breadboard.

I made these because I could not find male to male jumper with headers for cheap. This works good for me and was made from the spares that I had lying around.

These can be made in a couple of minutes.

Parts needed are: ribbon cable, male headers, solder wire and soldering iron.

2012-02-06 15.39.15

Cut out desired length of ribbon cable in group of 6. Arduino has output in group of six. This will work for any other board too just the number of wires that are to be kept together will be different.

Clip the make header pins in group of 6 and solder to each end.

And you are good to go.

To make the soldered ends more secure i taped the solder joints with foam tape from both ends. This way the solder points dont hurt the fingers and also the joints are kept intact and are insulated too.

2012-02-06 15.40.21 2012-02-06 15.43.23

LASER Projector

laser circleI was fascinated by LASERs when I first went to IIT Kanpur during my school days. Since then I have been reading / playing a lot with LASERs. My first one was a LASER trip wire and then a LASER pattern generator. It all was around 10 years back. Having recently acquired an Arduino UNO a plethora of options have opened up. I have started to learn from the beginning and this time I have the power of a microcontroller with me. !0 years back these things were hard to find and were freaking expensive and I didn’t have a sponsor 😛

Now I play around with stuff and fund my own projects. I have recently made a dice and a digital thermometer just to learn the new way of doing it.

Next was this LASER Projector (pattern generator to be precise). It involves two DC motors and L293D as a motor driver.

I customized the Motor driver circuit for speed control with Arduino PWM.

The table shows the connection details.

image

Two push buttons were added to control the speed of one motor. The other one rotated with a constant speed. One PWM pin was used to control the LASER as it gets too hot when switched on continuously.

The photo below shows the setup (Not very neat though)

Video

Source code

//LASER SHOW//

int motor1pin1 = 5;  //define digital output pin no.

int laser = 12;  //define the pin for laser output PWM.
int motor1pin2 = 6;    //define digital output pin no.

int speedpin1 = 3;     // define analog output pin no.

int motor2pin1 = 9;                  //define digital output pin no.

int motor2pin2 = 10;    //define digital output pin no.

int speedpin2 = 11;   // define analog output pin no.
int up = 1;  // define pushbutton pin no.
int down =2; // define pushbutton pin no.
int factor =32; //define speed control variable

void setup () {
pinMode(motor1pin1,OUTPUT);        //set pin 3 as output

pinMode(motor1pin2,OUTPUT);        // set pin 4 as output

pinMode(motor2pin1,OUTPUT);        //set pin 3 as output

pinMode(motor2pin2,OUTPUT);        // set pin 4 as output

pinMode(speedpin1,OUTPUT);
pinMode(speedpin2,OUTPUT);
pinMode(laser,OUTPUT);
pinMode(up,INPUT);
pinMode(down,INPUT);
Serial.begin(9600);

}

void loop () {
analogWrite(laser,228);

analogWrite(speedpin1,32);
digitalWrite(motor1pin1,LOW);
digitalWrite(motor1pin2,HIGH);
analogWrite(speedpin2,factor
);
digitalWrite(motor2pin1,HIGH);
digitalWrite(motor2pin2,LOW);
if(digitalRead(up)==LOW)
{
factor++;
}
if(digitalRead(down)==LOW)
{
factor–;
}
Serial.println(factor);
delay(500);

}

Arduino – 7 segment Dice

I have been waiting to play with embedded programming since and recently ordered an Arduino. I tested the spare LCD and displays with the normal tutorial commands and went step by step remeber the thing about slow and steady!

I want to build a vector LASER projector and a quadrocopter someday but that is too far. It is kind of my VISION. My Mission is to learn embedded programming via arduino.

It is one hell of a kit.

My very first experiment was a 7 segment dice.

It is a very simple project. Doenst require much and all the thing were in the kit that I ordered.

Still following is the list of what I used:-

  1. Arduino Uno
  2. 7 segment display RED
  3. Breadboard
  4. Jumper wires
  5. Push Button switch

The schematics for the display and Arduino I/O used by me are as follows

http://www.hacktronics.com/images/stories/led-diagram-3.jpghttp://www.hacktronics.com/images/stories/7seg-2.gifhttp://www.hacktronics.com/images/stories/seven_segment_led_pins.jpg

Arduino Pin 7 Segment Pin Connection
2 7 (A)
3 6 (B)
4 4 (C)
5 2 (D)
6 1 (E)
7 9 (F)
8 10 (G)
9 5 (DP)

I used a normal routine from one of the websites to cycle through the numbers 0 to 9.

Then I reduced the delay to have the numbers roll faster and faster.

Then I reduced the count from 9 to 6 (a dice has only till 6 and 0 was left just for fun).

Then I added a push button and added in the code to detect the state of the button.

When the button is pressed the state of the pin goes LOW and at that point I had programmed the loop to display the dot and pause for 2 seconds.

CATCH: The numbers scroll so fast that all we see is scrolling segment. And when the button is pressed the current number just paused for 2 seconds and then it starts again.

No random number generation 🙂

Video of the thing in action

source code (modification of sample code)
[code]
// Arduino 7 segment display example software
// http://www.hacktronics.com/Tutorials/arduino-and-7-segment-led.html
// License: http://www.opensource.org/licenses/mit-license.php (Go crazy)

// Define the LED digit patters, from 0 – 9
// Note that these patterns are for common cathode displays
// For common anode displays, change the 1’s to 0’s and 0’s to 1’s
// 1 = LED on, 0 = LED off, in this order:

//                                    Arduino pin: 2,3,4,5,6,7,8
int inPin = 1;
int val = 0;
byte seven_seg_digits[10][7] = { { 1,1,1,1,1,1,0 },  // = 0
{ 0,1,1,0,0,0,0 },  // = 1
{ 1,1,0,1,1,0,1 },  // = 2
{ 1,1,1,1,0,0,1 },  // = 3
{ 0,1,1,0,0,1,1 },  // = 4
{ 1,0,1,1,0,1,1 },  // = 5
{ 1,0,1,1,1,1,1 },  // = 6
//{ 1,1,1,0,0,0,0 },  // = 7
//{ 1,1,1,1,1,1,1 },  // = 8
//{ 1,1,1,0,0,1,1 }   // = 9
};

void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(inPin, INPUT);    // declare pushbutton as input
writeDot(0);  // start with the “dot” off
}

void writeDot(byte dot) {
digitalWrite(9, dot);
}

void sevenSegWrite(byte digit) {
byte pin = 2;
for (byte segCount = 0; segCount < 7; ++segCount) {
digitalWrite(pin, seven_seg_digits[digit][segCount]);
++pin;
}
}

void loop() {
for (byte count = 6; count > 0; –count) {
delay(10);
val = digitalRead(inPin);
if (val == LOW)
{
writeDot(1);
delay(2000);
writeDot(0);
}
sevenSegWrite(count – 1);
}
delay(0);
}
[/code]

Arduino