Tag Archives: potentiometers

ledfeatured

Using Arduino, a servo and a potentiometer

This is a guide showing you how to wire up and control a servo with a potentiometer.

Servos

servo

They have 3 wires.

POWER, GROUND and a CONTROL wire. They can either rotate continuously or they go to a fixed position between 0 and 180 degrees.

Potentiometer

Basically this is a variable resistor. As you turn the knob, the resistance changes and this can be measured on the Arduino.

Wiring it up

Wire the servo. The CONTROL wire can go to any digital pin.

POTIMAGE1

Then add the potentiometer. The wiper (middle wire) can go to any ANALOG input pin.

potless2

 

This is the circuit appearance.

potfizz

You will see that as you turn the knob round, the reading goes between 0 and 655.

However, the servo only needs a number between 0 and 180.

So you need to figure out:

a) A reading of 0 makes the servo go to 0 degrees.

b) A reading of 326 (half of 655 – half way on the knob) goes to 90 degrees.

c) A reading of 655 (all the way around) goes to 180 degrees.

 

 

 

 

ledfeatured

Using Arduino and a switch

This is a guide showing you how to wire up and read a basic switch. Any switch works – once a connection has been made, the switch reading changes – there is LOW and HIGH,

sw1

You now need to connect the components. The position of the components in the breadboard is very important. Make sure you are following the pictures.

Then – connect the wires to the Arduino. Use the 3.3 volt on the Arduino.

sw2

The 2 wires go to the switch – any switch works. When the switch is closed, the resistance changes and is detected on the INPUT.

 

 

ledfeatured

Using Scratch for Arduino and sensors

This is a guide showing you how to wire up and read a light sensor using Scratch for Arduino. You can also use it for other sensors such as force sensors and thermistors.

LDR1

You now need to connect the components. The position of the components in the breadboard is very important. Make sure you are following the pictures.

Now add the wires.

LDR2

The power input can be 3.3v or 5v. The ANALOG output can go to any of the Arduino analog inputs.

The circuit works by measuring the resistance in the circuit through the ANALOG input. If the light alters, then the LDR will alter the resistance and the sensor reading will alter.

 

ledfeatured

Using Scratch for Arduino to control an LED

This is a guide showing you how to wire up and light a single LED using Scratch for Arduino.

p1components

You now need to connect the components. The position of the components in the breadboard is very important. Make sure you are following the pictures.

p2led

Make sure you put the legs in the right way. These are diodes so current can only flow one way.

Now add the resistor

p3resist

The role of the resistor is to reduce the current flowing through the LED.

Finally connect the wires.

 

 

completed

The OUTPUT pin can be 5V – this will check you’ve made a connection. If it’s all ok, the LED should glow.

Then put the OUTPUT wire to an OUTPUT pin on the Arduino.

Once lit up – watch this video for how to use S4A