Posts with «servo» label

servo

I tried to write a code but the servo would not stay so

Please can someone write a c++ code for arduio for me

read more

Let's Make Robots 04 Dec 19:52

Analog IR Temperature gauge


Introduction:
The IRTEMP module from Freetronics is an infrared remote temperature sensor that can be incorporated into your Arduino / microcontroller projects. It can scan a temperature between -33 to +220 C, and can be operated using a 3.3 to 5V power supply. It can be powered directly from the Arduino 5V pin.  This module can also provide an ambient temperature reading if required.
The Servo used in this project is a SG-5010 standard servo which will be utilised to display the temperature reading from the IRTEMP module.



Parts Required:
Freetronics Eleven or any compatible Arduino.
Freetronics IRTEMP module
MG-995  or SG-5010 Standard servo
Mini Breadboard 4.5cm x 3.5cm
Protoshieldand female header pins (not essential - but makes it more tidy)
9V Battery and Battery Clip
Wiresto connect it all together

Gauge parts:
Paper (to print the face of the gauge), and some glue to stick it to the wood.
MDF Standard panel (3mm width) - for the top and base of the gauge.
Galvanized bracket (25x25x40mm)
Timber screws: Hinge-long threads csk head Phillips drive (4G x 12mm)





The Video:



The Arduino Sketch:



     The above sketch was created using Fritzing.





Arduino Code:
You can download the Arduino IDE from this site.

The IRTemp gauge requires a driver library to be installed into the Arduino IDE.
The latest IRTemp driver library can be found here.

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* -------------------------------------------------------
Analog IR Temperature Gauge: written by ScottC on 1st Dec 2012.
http://arduinobasics.blogspot.com/2012/12/arduino-basics-analog-ir-temperature.html


* Some of the code was adapted from a sketch by Andy Gelme (@geekscape)
* For more information on using the IRTEMP
see www.freetronics.com/irtemp

* IRTemp library uses an Arduino interrupt:
* If PIN_CLOCK = 2, then Arduino interrupt 0 is used
* If PIN_CLOCK = 3, then Arduino interrupt 1 is used
---------------------------------------------------------*/

#include "IRTemp.h"
#include <Servo.h>

Servo servo1;
static const byte PIN_DATA = 2;
static const byte PIN_CLOCK = 3; // Must be either pin 2 or pin 3
static const byte PIN_ACQUIRE = 4;

static const bool SCALE=false; // Celcius: false, Farenheit: true

/* Used to capture the temperature from the IRTEMP sensor */
float irTemperature;
int temp;

/* The minimum and maximum temperatures on the gauge. */
static const int minTemp = -45;
static const int maxTemp = 135;


/* The servo minimum and maximum angle rotation */
static const int minAngle = 0;
static const int maxAngle = 175;
int servoPos;

IRTemp irTemp(PIN_ACQUIRE, PIN_CLOCK, PIN_DATA);



/*----------------------SETUP----------------------*/

void setup(void) {

servo1.attach(9); // turn on servo
}


/*-----------------------LOOP-----------------------*/

void loop(void) {
irTemperature = irTemp.getIRTemperature(SCALE);
printTemperature("IR", irTemperature);

/* If you want the ambient temperature instead - then use the code below. */
//float ambientTemperature = irTemp.getAmbientTemperature(SCALE);
//printTemperature("Ambient", ambientTemperature);

}

/*-----------printTemperature function---------------*/

void printTemperature(char *type, float temperature) {

temp=(int) temperature;
servoPos = constrain(map(temp, minTemp,maxTemp,minAngle,maxAngle),minAngle,maxAngle);

if (isnan(temperature)) {
//is not a number, do nothing
}
else {

/* To test the minimum angle insert the code below */
//servoPos = minAngle;

/*To test the maximum angle, insert the code below */
//servoPos = maxAngle;

/* Rotate servo to the designated position */
servo1.write(servoPos);
}
}

The code above was formatted using hilite.me

Notes:
Ambient temperature: If you want to get the ambient temperature from the IRTEMP module, then have a look at lines 58-59.
Servo Angles: You will notice on line 36, the maximum servo angle used was 175. This value was obtained through trial and error (see below).

Calibrating the servo angles
You may need to calibrate your servo in order to move through an angle of 0 to 180 degrees without straining the motor.Change the minAngle on line 35to a safe value (for example: 10), and the maxAngle on line 36 to a value like 170. Remove the comment tag (//) on line 76, and then run the sketch. Lower the minAngle until it reaches the minimum value on the gauge, making sure that the servo doesn't sound like it is straining to keep it in position.

Add the comment tag (//) back in, and then take out the comment tag for line 79. And follow a similar process, until you reach the maximum value on the gauge. Once again, make sure that the servo is not making a straining noise to hold it at that value. Make sure to add the comment tag back in, when you have finished the calibration.

In this example, the servo's minAngle value was 0, and maxAngle value was 175 after calibration, however, as you can see from the video, the physical range of the servo turned out to be 0 to 180 degrees.




The Temperature Gauge Picture

The following gauge was created in Microsoft Excel using an X-Y chart.  Data labels were manually repositioned in order to get the desired numerical effect.




Pixar-style lamp project is a huge animatronics win

Even with the added hardware that lamp still looks relatively normal. But its behavior is more than remarkable. The lamp interacts with people in an incredibly lifelike way. This is of course inspired by the lamp from Pixar’s Luxo Jr. short film. But there’s a little bit of most useless machine added just for fun. If you try to shut it off the lamp shade is used to flip that switch on the base back on.

[Shanshan Zhou], [Adam Ben-Dror], and [Joss Doggett] developed the little robot as a class project at the Victoria University of Wellington. It uses six servo motors driven by an Arduino to give the inanimate object the ability to move as if it’s alive. There is no light in the lamp as the bulb has been replaced by a webcam. The image is monitored using OpenCV to include face tracking as one of the behaviors. All of the animations are procedural, making use of Processing to convey movement instructions to the Arduino board.

Do not miss seeing the video embedded after the break.

[via Gizmodo]


Filed under: robots hacks

How to contol servo speed from serial

Hello all

I have  renbotics ServoShield and I have made a code on arduino where from serialport I can send commads to servos and it happens with that way... S01P1200,S14P2300etc..I mean that  Servo 1 to 1200 posion and servo 14 to 2300 posion

read more

How to contol servo speed from serial

Hello all

I have  renbotics ServoShield and I have made a code on arduino where from serialport I can send commads to servos and it happens with that way... S01P1200,S14P2300etc..I mean that  Servo 1 to 1200 posion and servo 14 to 2300 posion

read more

Arduino powered Lucky Cat as physical webcounter

Rebuilt my lucky cat: whenever a page of my website is loaded, the cat will be waving its arm. There’s a light sensor so when its dark, the cats RGB-LED is changing the color instead of waving the arm. Changing the color of the LED is also possible with one of the buttons on the cats ears. The other one is the reset button. Used an arduino ethernet, a servo, two buttons, an RGB LED and two small yellow LEDs. The seven segment display is one that I harvested from an old stereo. It’s driven by the arduino and two shift registers. unfortunately I’ve soldered that one together for an older project, so that it doesn’t fit into the cat too. It shows the number of pageviews of the website.

via [instructables] visit the page of [Janwil]

12 DOF hexapod kit now sold by SparkFun

The 12 DOF hexapod kit from DAGU is one of the simplest hexapod kits ever!

Quick and easy to assemble, the body only consist of 12 leg segments, 12 foam rubber feet, 12 servos and a base plate with a hole pattern that allows controllers and sensors to be easily mounted.

read more

Let's Make Robots 26 Oct 18:09
12  advertising  arduino  dagu  dof  fun  hexapod  servo  spark  sparkfun  

Small Quadruped Robot

Primary image

What does it do?

Navigate around via ultrasound

Hi, I'm new to LMR as a member. But I've been browsing around LMR to learn robotics. First, sorry for my bad English. I finished making my quadruped robot a couple weeks ago. It was my first robotic project using microcontroller. In fact, it was my first microcontroller project. Unfortunately it wasn't well documented during the making process since I didn't plan to publish it before. :( So here is what I can collect from scattered file in my PC..

 

 

Cost to build

$150,00

Embedded video

Finished project

Complete

Number

Time to build

Type

URL to more information

Weight

read more

Crystal doorbell helps class up the joint

Even if you live in a dump this quick build will make your doorbell sound high-class. The new rig uses a crystal goblet to alter you of guests at the door. We suppose the room-silencing sound of flatware on a wine glass does make a great attention getter.

For [Tobias] the hardest part of the build was getting his wife to sign off on it. But he says the 1970′s era original was looking pretty shabby, which kind of made his argument for him. It took just two hours to develop and install the replacement. It uses a servo motor with an articulated striker to ping the glass which is hanging inverted between two pegs. The original AC transformer (which are most often 16V) was used to power the Arduino. He built a simple rectifier along with a big smoothing capacitor to make sure the Arduino doesn’t reset when voltage dips. Although it’s not mentioned in his comments, we’d bet the doorbell wire has been rerouted to connect directly to the Arduino, rather than remain patched into the power loop.

Don’t miss the clip after the break to hear how great this thing really does sound.


Filed under: arduino hacks, home hacks
Hack a Day 26 Sep 17:01

Arduino quadruped robot

Primary image

What does it do?

Walk forward and backword

Hi all,

I’ve been working on my first real robot last week-end and wanted to share it. It’s a simple quadruped arduino robot controlled by serial (via USB). Videos can be viewed on my blog : http://blog.joomun.org/2012/09/09/arduino-quadruped-robot/

The robot structure has been created with cheap mecanno clone

IR control has been added, i'll update the blog later.

Cost to build

$66,00

Embedded video

Finished project

Number

Time to build

10 hours

Type

legs

URL to more information

Weight

300 grams