HTE - Potentiometer

Overview

For Fullscreen: https://www.youtube.com/watch?v=YyeQvT8Dsno

This tutorial will show you how to use a potentiometer, connect it to the Quantum system, and create a simple demo using it.


What is a Potentiometer?

A potentiometer is a three terminal resistor with a sliding or rotation contact that forms an adjustable voltage divider. They can be used to control speed, voltage and frequency. A potentiometer includes a knob to control the variable.

The knob can be turned to move the wiper across the resistive element and adjust the resistance used. This will then control the amount of voltage that can pass through. Typically you have three pins at potentiometer which you have to connect to your circuit. 1 is the gnd pin, 2 the singal pin and third is the power pin.2


Assemble the Circuit

Picture

Name

Quantity

Link

Picture

Name

Quantity

Link

Motion Sensor

1

You can purchase it here

Male to Male and Male to Female jumper wires

3

Included in Component Kit

Or you can purchase it here

Q-Client Builder Base

1

Q-Client

If you have all the parts listed above, we can go ahead and build the circuit. It should look like this:

Connect the pins of the potentiometer as we mentioned before. You can also use a breadboard like we did but it is not necessary.


Pair the Builder Base

Now we want to pair the Builder Base with our Q-Server. In order to do so, go to the Homescreen of your Q-Server.

Next click on the lift side symbol labeled “Clients”. Switch to the “Unpaired” tab at the top middle of the screen.

You should see your unpaired Builder Base. If not, check if you have plugged in the power supply for the Builder Base. Now move to the three dots below “Actions” and click “Pair”.

Once your Client is paired, click the “Setup” button.

Now you can edit your Client. Give him a Name you want and also a location where you are going to use it. Hit “Save” when you finished.


Build the Firmware

So once the Builder Base is paired and set up, we can start building our firmware. Move to the “Firmware” tab on the left side of your Q-Server interface. Hit “+ Create New”.

You will be prompted to give your new firmware a name. We named ours “Potentiometer”.

Once you created the new firmware, hit the “+ Add Hardware” button on the top, next to the “Actions” button.

We are going to search for a potentiometer. You can use the search bar or scroll down till you find it. After this, you can give it a name and then click on “Add Hardware”. We named ours “Potentiometer”. Next we need to configure the firmware. Click on the “Potentiometer” bar:

For the “Driver” we choose GPIO, for the “Pin” we choose the GP6 and as the Granularity we leave it at 50. Granularity means that the analog signal of the knob needs to be turned into a digital signal. So at a change of 50 the system will be notified.

Next we have to upload the firmware file to our Builder Base. Click on the three dots below “Actions” and click on “Upload”:

Choose the correct Builder Base and hit “Upload”. You should see a progress bar pop up at the right side of your screen.


Build the App

While the firmware is uploading, we can build the application for our Button. Move to the “Apps” tab on the left side. Click on “Create New” and give it a name you want. We named ours again “Potentiometer”. Hit “Create”.

You will find yourself on the Canvas.

For this tutorial we will need a “Potentiometer” hardware object and a “Text” interface objects.

The value of the Potentiometer will be displayed as an analog value in the “Text” interface object.

Click “Save App” on the top right. You will return to the first screen of the “Apps” tab. Now click the play button on the bar located at the right side.

Now we have to map the hardware and interface objects we have put together before to the actual hardware of the circuit. Click on the “Potentiometer” tab and choose the Client, which is connected to the motion sensor.

Once you done click “Save + Run”.


Run the App!

Click on the “Dashboard” icon in the top right corner.

You should see a displayed Value.

If you turn the knob in a direction the analog value should change.


DC motor

In the next demo we are going to use this potentiometer to control a dc motor with a fan at the end of it. It is connected to another Builder Base. So at the end we will be able to control the speed of the dc motor with the potentiometer.

If you want to know how to build the dc motor circuit have a look at .

First you have to pair the client with the dc motor connected. Make sure to give it a name and a location.

The firmware is already uploaded. Now we need to edit the app.

We need to add a “Motor” hardware object and connect the “Speed” and “Clockwise” mode to the “Potentiometer” hardware object. Save the app.

Next we are going to map the app.

Make sure to select the client which is connected to the dc motor and hit “Save + Run”.

Go back to the dashboard and start the app.

So at low voltages the motor wont spin but if you increase the value by turning the knob of the potentiometer clockwise the speed of the fan will increase and start to spin.

This is how you connect and use a potentiometer with the Quantum System. We also learned how to practically use the potentiometer with a dc motor to control a fan.

Happy Making!