Tiny Parts, Brighten Future

Who are We?

UrukTech is the first Iraqi Online Shopping website. It provides Customers a wide range of electronic and electric parts and gadgets.

What We offer You?

Dive into the world of Embedded Systems with different categorizes. With an easy one-click orders a customer may buy the item of choice.

Payment is not a challenge any more, UrukTech accepts payment in variety methods such as; Asia Hawala, Western Union, Bank Transfer and Cash on delivery. Bought items may be collected or delivered anywhere on Iraq map.

You have seen Propellers in Aircrafts or in marine ships, if not in real then in movies for sure. In this session we are going to design a Propeller Display with Arduino, LEDs and a DC motor. In this Propeller Display, text will appear to be rotating in propeller fashion in a circular shape.

The propeller display is in a way like LED Matrix. It contains 8 LEDs (Light Emitting Diodes) which are arranged in the form of an 8*1 matrix (8 rows and 1 column). They are arranged in the form of ladder one over the other. These 8 LED can be made to display any content like text, numbers, symbolsetc. This is achieved by Perception of Vision (POV), in which many still images are moved quickly one by one in a sequence, which gives a perception of animation or a moving image. How this is done is explained in the tutorial given below.

Components Required

Arduino Uno

DC Motor

+3.6V LI-ION battery

LED (8 pieces)

1KΩ resistor (8 pieces)

Construction of Propeller Display:

Support the top of Motor to equate the uneven bumps. I used a dot board over it and used quick glue again to stick it with DC motor.

Attach the LI-ION battery on top. If you don’t have LI-ION battery of same size, just leave it. After that take each LED and test it with button cell or any other source. Then take some resistors and solder them with LEDs as per the picture and circuit diagram shown below.

Connect the soldered LEDs and resistors with Arduino UNO as shown in below figure and circuit diagram.

Mount the UNO on to the top of DC MOTOR and secure it with the help of cello tape to finish the setup. So the final Propeller setup will look like below:

Circuit and Working Explanation:

Circuit of Arduino controlled POV Display is very simple, we simply connected 8 LEDs with Arduino Uno as per circuit diagram below.

PORTD, PIN0 ——————LED8 POSITIVE TERMINAL

PORTD, PIN1 —————— LED7 POSITIVE TERMINAL

PORTD, PIN2 —————— LED6 POSITIVE TERMINAL

PORTD, PIN3 —————— LED5 POSITIVE TERMINAL

PORTD, PIN4 —————— LED4 POSITIVE TERMINAL

PORTD, PIN5 —————— LED3POSITIVE TERMINAL

PORTD, PIN6 —————— LED2 POSITIVE TERMINAL

PORTD, PIN7 —————— LED1POSITIVE TERMINAL

Like we add more columns in 8×8 LED Matrix to extend the display, in the same way instead of adding more LED COLUMNS we move the first LED COLUMN to the second LED COLUMN place by using the motion of DC MOTOR.

In order to understand the whole situation, say we want ‘A’ to be displayed by the propeller display. Consider the LED ‘needle’ is at POSITION1 at first as shown in figure below. LED Needle is the Column of 8 LEDs.

Now we will power the motor and it will start running.

At t=0ms: the needle will be at POSITION 1. At this position all the eight LEDs, from TOP LED (MSB) to BOTTOM LED (LSB), are powered on.

At t=1ms: the needle will be at POSITION 2. Same as Position 1, at this position all the eight LEDs, from TOP LED (MSB) to BOTTOM LED (LSB), are powered on.

At t=2ms: the needle will be at POSITION 3. At this position only LED7, LED6 & LED3 stay ON and remaining LEDs are turned OFF.

At t=3ms: the needle will be at POSITION 4. Same as Position 3, at this position only LED7, LED6 & LED3 stay ON and remaining LEDs are turned OFF.

At t=4ms: the needle will be at POSITION 5. Same as Position 3 & 4, at this position only LED7, LED6 & LED3 stay ON. Remaining LEDs are turned OFF.

At t=5ms: the needle will be at POSITION 6. At this position all the eight LEDs are again powered on, TOP led (MSB) to BOTTOM led (LSB) are turned ON.

At t=6ms: the needle will be at POSITION 7. Same as Position 6, at this position all the eight LEDs remain on.

As explained above, we will turn ON appropriate LEDs at the appropriate Needle Positions to display the necessary character. If the speed of movement of needle is slow we can see each LED column separately. But when the speed of motor is high and needle is moving too fast then the display will be seen as continuously showing “A” character.

Programming Explanation:

We have programmed the Arduino to power the appropriate LED at appropriate times while rotating so that LED column will show the text “CIRCUIT DIGEST” in circular position.

Programming of the Propeller display is easily understandable. A Char Array of 26×8 has been taken as volatile char ALPHA[26][8].This Array consists 8 positions of the needle to display each of the 26 alphabets that makes it array of 26×8. 26 rows in Array represent the 26 alphabets and 8 columns in each row represent the eight position of needle to display the character while rotating. Now each cell consist a binary number which represents the on/off status of 8 LEDs in a particular position of Needle. Remember needle here refers to line of 8 LEDs connected to Arduino as explained above.

Now you just need to rotate the DC motor and use a ‘for loop’ with eight iterations to display a character. Like if you want to display 10 characters then you need to run 10 ‘for loops’ with eight iterations in each. So we have used 13 for loops to display the text CIRCUIT DIGEST. Check the full program code below with a demonstration video.

So this is how you can create a beautiful Persistence of Vision (POV) illusion with Arduino like a Text is rotating like a Propeller.

Using only an Arduino, a few resistors, a buzzer, and some bits of aluminium foil, you can create your own touch-sensor piano keyboard in just a few minutes! Using an Arduino Uno, you can create a piano with up to 18 keys; or with an Arduino Mega, you can get over 60 keys! Other Arduino boards should work with this project with little to no modification to the code.

Step 1: Parts and Material

You’ll first want to collect all of the parts you will need for the project:

• An Arduino (or Arduino-compatible) microcontroller board. • Any Arduino board should work: Uno, Leonardo, Mega, Pro Mini, etc. • Eight 2.2 Megaohm (2.2 MΩ) resistors • Anywhere between 1 MΩ and 4.7 MΩ should work • You need one resistor per piano key • A 2.2 MΩ resistor has a color code of Red-Red-Green or Red-Red-Black-Yellow • A piezo buzzer • Some spare wires or jumper cables • Aluminum foil • A foot or two should do • Tape • A surface to tape your keys to • We used a scrap piece of cardboard, but it can be anything you like, even the tabletop itself!

Equipment that you may need:

• Soldering iron and solder • You can probably get by without an iron by wrapping wires together instead of soldering, but the connection will not be as reliable • Scissors to cut aluminum foil and tape

Step 2: The Idea and Design

The basic principle behind our method of touch sensing is that each piano “key” is sensor that can measure the electrical capacitance of a person’s body. The measurement will change as the user gets closer to the sensor and will spike dramatically when the user touches the sensor. The Arduino will be looking for these spikes in order to detect when the user has touched the key.

We will need to use one pin an the Arduino for each key as an “input pin”, and we’ll need one pin total to be used as the “common send” pin. We will also need one pin for the buzzer that will be used to generate a tone. This means that since an Arduino one has 20 input pins (14 digital and 6 analog), we can have up to 18 keys on our keyboard! If you have an Arduino Mega or any other board with more pins, that number can be even higher!

Step 3: Create Your “Keys”

Out of your aluminum foil, cut a few shapes to be your piano “keys”. Any shape will do, but we took the simple route and made squares. Each key should be somewhere between 2″x2″ and 4″x4″, but most other sizes will work as well.

Step 4: Assemble the Key Circuitry

Each touch-sensitive “key” on the piano is going to require one resistor and two wires/cables. Solder one wire to each leg of the resistor, but make sure to leave part of the leg sticking out. The leg will be used to connect to the foil in the next step. Make as many of these as you plan on having piano keys.

Step 5: Connect the Foil “Key”

Remember the extra bit of leg we saved? Take it and poke it through a corner or side of one of your aluminum foil squares. Fold the leg over the edge back towards itself to make the connect hold more strongly. Go ahead and assemble all of your keys.

Step 6: Attach the Keys

Using your tape, attach each key to your surface, making sure to leave some of the foil exposed. It’s okay to tape over the resistor, but be sure to remember which wire is attached to the side of the resistor that is touching the foil and which wire is not.

Step 7: Finish the Wiring

After attaching all of your keys to the surface, take the wire that is connected to the resistor (but not on the side connected to the foil) and connect to the the same side of the resistor on the adjacent key. Basically, we want to connect all of the non-foil-sides of the resistors together. These can be soldered are just connected with tape.

You will have one wire left over that is not connected to anything; this will be our “common send” wire.

Step 8: Hook Up the Arduino

Connect the “common send” wire left over from the previous step to Pin 2 on the Arduino. Then, connect the “key” wires to Pins 3-10, starting with the left-most key on Pin 2 and ending with the right-most key on Pin 10.

Take your buzzer and connect the pin marked negative (-) to a ground (GND) pin on the Arduino. Connect the pin marked positive (+) to Pin A4 on the Arduino. (NOTE: Depending on your buzzer, you may need connect a resistor between the A4 Pin and the positive side of the buzzer. This is to prevent the buzzer from drawing too much current from the Arduino pin and possibly damaging it. A 220 Ohm resistor or greater should work fine for most buzzers.)

Step 9: The Code

Before you can start playing your newly-built piano, you will need to obtain and install the CapSense Arduino library if it is not already installed. This can be downloaded from here. If you do not know how to install third-party Arduino libraries in you version of the Arduino IDE, reference this guide on Arduino.cc.

Step 10: Play!

And that’s it! You should now be able to tap on the foil keys and hear the corresponding notes played through the buzzer. If the keys are not very responsive, or are trigger without being touch, you can adjust the CAP_THRESHOLD value in the Arduino sketch to set what value that the keys are triggered at. Lower values will cause the keys to be easier to trigger, and higher values will reduce the number of keys that are mistakenly triggered.

You can also change the scale that is played by uncommenting one of the few scales included, or make your own scale! If you make your own piano, please comment and show us some pictures and videos. We’d love to see some creative instruments!

]]>http://www.uruktech.com/experiments/capacitive-touch-arduino-keyboard-piano/feed/0Controlling a brush-less motor through an ESC and an Arduinohttp://www.uruktech.com/experiments/controlling-brush-less-motor-esc-arduino/
http://www.uruktech.com/experiments/controlling-brush-less-motor-esc-arduino/#respondFri, 03 Mar 2017 16:59:22 +0000http://www.uruktech.com/?p=6536The post Controlling a brush-less motor through an ESC and an Arduino appeared first on UrukTech.
]]>

Electronic speed control (most commonly known as ESC) are nasty beasts: not from the controlling software point of view but for the way they need to be powered up, and because they need to be calibrated.

Especially the calibration is important because otherwise the ESC doesn’t know which are the limits of the transmitter, and it cannot control precisely the speed of the motor.

Before putting a ESC in any complex Arduino project, it is better to get used to how a ESC works using a very simple sketch.

But before seeing the code, let’s see how to wire it up, because care must be taken otherwise nothing will work.

Wiring up the circuit and powering the ESC

Usually ESCs need a voltage higher than the one provided by the Arduino from his 5V pin: typically they need 2 LiPo cells (around 8V). To achieve that all the circuit must be powered from an external power supply connected directly to the ESC and not via the Arduino, which will be powered by the BEC circuit of the ESC. To make that happen it’s enough to connect the red and black of the control connector to the 5V and GDN of the Arduino board.

The rest of the circuit is pretty easy: from pin 9 of the Arduino we have the signal for the ESC, and into pin 0, the voltage reading from the potentiometer comes in.

Code Explanation

A ESC is made to receive inputs from a R/C transmitter, so it works as a servo: to control it you can use the Arduino Servo Library, so the test code is based on the servo library basic example published on the Arduino site.

It just takes the reading of the “throttle”, maps it from 0-1023 to 0-179 (analogue reading to servo “degrees”) and then sends it to the ESC via the Servo library. Even in its extreme simplicity this sketch it very useful when you want to calibrate a new ESC to work with the Servo library of Arduino.

Calibration

Now that everything is setup, chances are that you motor might not rotate, or might rotate only forward, or might rotate only to 80% of the throttle (forward and reverse) and then stop: all these are symptoms of lack of calibration, or a calibration done with a different range of PWM signals.

More or less all ESCs have a similar calibration procedure:

Power up the ESC while the having maximum forward throttle applied

You’ll hear a tone and some beeps and after a while (usually 2 seconds) you’ll hear a confirmation tone and the led will blink a few times with a different colour: this indicates that the ESC has measured the wavelength of max throttle.

At this point apply zero throttle (in a fwd./reverse ESC this means full throttle reverse), wait again few seconds for the tones and led to blink: full reverse measured.

Then move to central (only for fwd./reverse ESCs) and wait again for the tone and blinks.

Have fun with the motors

Another possibility is that even after that procedure, the motor will not turn immediately in reverse, or will only go 50% of forward speed: that’s because ESCs are programmable, and you can change many of their behaviours via either a programming card or via, again as with the calibration, hearing and decoding beeps and blinks.

Are you looking to make your own quadcopter drone or RC plane with Arduino but don’t know how to get the gyro working? Perhaps you already bought some 6 axis MPU6050 modules (on the GY-521 breakout boards) only to find out they weren’t as simple to use as you thought? Try this out!

You’ll learn to wire a simple circuit to test your MPU6050 with an Arduino and simulate the YAW, PITCH and ROLL on a 3D model plane on the screen. This is intended as a learning tool to get you familiar with gyro modules, breakout boards and installing the necessary libraries to your Arduino IDE to allow you to make the best use of your MEMS gyro and save time instead of writing complex code from scratch. Here’s what you need:

1 x Arduino UNO + USB cable

1 x mini prototyping breadboard

1 x GY-521 breakout board (few bucks on eBay)

Some male-to-male jumper cables

Soldering iron + solder.

Step 1: Wire Circuit as Shown Below:

***NOTE: all red cables are VCC (+5V) and black cables are GND, check carefully when wiring up your circuit. The breakout board comes with pins but requires soldering.***

For your own learning:

the gyro module communicates with the Arduino through I2C serial communication via the serial clock (SCL) and data (SDA)

the MPU6050 chip needs 3.3V but a voltage regulator on the GY-521 board allows you to give it up to 5V

Step 2: Install I2Cdev & MPU6050 Libraries

If we were to write the code from scratch, it would take ages and there would be a lot of reverse engineering required to make good use of the module’s proprietary Digital Motion Processing (DMP) engine because Invensense intentionally released minimal data on its MPU6050. Good thing someone has already done the hard work for us; Jeff Rowberg wrote some Arduino libraries to obtain the accelerometer / gyro data and handle all the calculations. They are available as a zip file from here:

Once unzipped, find the Arduino folder within it and copy the two folders “I2Cdev” and “MPU6050” over to your Arduino “libraries” folder in the following directory:

C:\Program Files (x86)\Arduino\libraries

Then open the Arduino IDE and in the examples section, you should find MPU6050_DMP6 within MPU6050. Open it, plug your arduino in, select the appropriate COM Port and upload the sketch. In the Serial Window, select a baud rate of 115200. You should be prompted that the MPU6050 connection was successful. You can test the data collection by typing anything in the text bar and pressing enter, the data should start showing up.

Now we want to set the code to run the teapot demo to show the 3D simulation. Close the serial window, then find and comment out the line #define OUTPUT_READABLE_YAWPITCHROLL and uncomment the line //#define OUTPUT_TEAPOT. Select “save as” and choose where you want to save the modified code. Upload again but don’t open the serial window this time.

To run a 3D simulation of the yaw / pitch / roll values on an airplane on the screen, we’ll be running the teapot demo from the MPU6050_DMP6 example from Jeff Rowberg’s MPU6050 libary. However the Arduino IDE will only be acquiring the data, to display the 3D simulation we’ll need additional software: Processing. Download Processing from here, then unzip to wherever you like:

Click the play button and the system should calibrate for about 20-30 seconds, leave the gyro stationary during that period.

Now pick up the gyro and test out the yaw / pitch / roll. Once you’re happy that it all works properly you can begin experimenting with it for your own projects. If you want to make full use of the I2Cdev or MPU6050 libraries and their functions, consult their header files.

This project is about using a data logger with an Arduino platform to record the brightness and the temperature and display the temperature and the light value on a LCD, then saving the data to the SD card.

Step 1: Parts

Data logger shield.

Stackable Header pins.

LCD display.

Arduino UNO.

Photo cell.

Analogue temperature sensor.

Step 2: modifying the data logger

If the used data logger does include stackable header pins then this step could be skipped. These are the pins that are needed for the SD card to work.

Step 3: Wiring Diagram

Figure above shows the wiring diagram for the data logger project. Arduino Pins that the data logger uses are marked in blue.

Step 4: Libraries

For each code in the next step to work you will need some libraries added to the Arduino folder, which are:

Step 5: The Code

This is hopefully the last step. The code should read the temperature sensor and the photo cell then display the values on the LCD and save them to the SD card. These are few trouble shooting codes that might display on the serial terminal if something is wrong. When the temperature is hotter the back light should turn red. When the room is brighter the back light should turn blue, if it is hot and bright it should be purple. Cold and dark should be black.

This tutorial will explain a simple way to make a password protected Bluetooth door lock using your Arduino, which can be unlocked by sending a four-digit pin from your Android phone! The hardware setup is quite simple, and the programming side of it is a bit tricky, but should be no problem for any Arduino amateur.

Step 1: Parts Needed

2. Electric Door Strike.

3. Bluetooth Module.

4. Power Supply (Required voltage and amperage differs among different door strikes/locks)

5. TIP120 Transistor

6. 1N4001 Diode

7. Hook-up Wire

8. Solderless Breadboard

9. An Android phone (optional, considering that there are lots of devices you could use to send serial data to our Bluetooth modem including IPhone, computers, and other Bluetooth devices).

Step 2: About The Transistor

We’ll start by focusing on one of the main components of the circuit, the transistor. Our transistor will allow us to control a device that requires more current than our Arduino can supply, by sending the transistor different values. The type of transistor we are using (the TIP120) has a base, collector, and an emitter which are labelled here. We will send the signal from pin 9 on the Arduino to the base of the transistor, and depending on the value sent, current will increase or decrease.

Step 3: Assemble The Circuit

The diagram shows how the transistor is wired up in our circuit. As you can see, we have a diode pointed away from ground that is connected to the collector of the transistor as well as the ground of the lock itself. This diode will protect our electronics from any back voltage that might be created when our lock is turned off. At this point you could set pin 9 to high or low to control the lock.

Step 4: Adding Bluetooth

Adding a Bluetooth module to our project is very easy. Simply connect RX on the Bluetooth module to TX on our Arduino board, TX on the module is then connected to RX on the Arduino, GND is obviously connected to ground, and lastly VCC is connected to 3.3 volts or 5 volts depending on your Bluetooth module.

Step 5: Final Product (without the code)

Here is a look at what everything should look like. It’s a bit difficult to see everything, but this is just the completed circuit on the breadboard.

Step 6: The Code

The coding is a little tricky as I said in the intro, but I am a bit of a beginner with the Arduino so it should not be difficult for anyone to understand. Basically the Arduino will check to see if anything is being received through serial. If it is, it will read those chars into an array and from that point verify that what was received matches the password we defined. In my example the password defined is ABCD.

Step 7: Implementing Your Android Phone

On the app market, you can search for Bluetooth SPP (Serial Port Profile). There are many apps that have been made to send serial data through Bluetooth on your phone. Mine is called Bluetooth SPP just like 4 or 5 other apps that are similar and can be found by going to the link below. After you install one of these Bluetooth SPP apps, you can pair with your Bluetooth modem connected to the Arduino. If it asks for a key, it will usually be by default “1234” (without quotes of course). After that, you should be able to send ABCD and the door strike will unlock for around 5 and 1/2 seconds, and then lock itself again. This concludes my tutorial on making a Bluetooth enabled door lock. If you have any questions or corrections for my project let me know!

STORY

In this article we will make a two wheeled robot using Arduino, motor shield and 1Sheeld uses Bluetooth as its communication channel. This will be a two wheeled robot that will be controlled using the game pad in the 1Sheeld application to control the robot.

is a great layer of abstraction to make you use almost all the sensors in your mobile phone to interface with the Arduino.

The code will be so simple as we’ll use the Adafruit library to help us more in reducing our code and circuit wiring using Adafruit shield.

We’ll begin by listing the components then we’ll start off.

Throughout the tutorial I’ll show you the way around how to get the required applications either for your phones or for your PCs.

The 1Sheeld

1Sheeld is an open-source product that simplifies the interfaces between your android phone (and soon iPhone) sensors, and the Arduino using Bluetooth technology.

You can literally use all the sensors in your phone to interact with the Arduino and even more than your phone’s sensors. 1Sheeld’s main page can be found here.

The pages explains the shield thoroughly so I’ll let you explore its details and will just mentions the common catches and the starting tips. A direct link to the download section is here. You must download the library and add it to Arduino IDE to start using it. If you’re wondering how to add a library check this link.

Preparing the shield

Download the 1Sheeld app using Google play

Connect the shield to the Arduino -push it gently with equal force on both sides

The Motor Shield

The Adafruit motor shield can supply power up to 4 motors,it will be placed on the top of 1Sheeld,if the motor shield doesn’t block the pinsunlike the one in the image, the order doesn’t matter and I prefer placing the 1Sheeld on the top so it’s easier for you to switch between upload mode and operating mode on 1Sheeld.

In this tutorial we’ll use only 2, themotors are numbered according to this image, those numbers will be used in the coding process.

The +M (positive terminal -red-) and GND (negative terminal -black-) terminals will be connected to the battery or the power supply (12v ) which is fine by the Arduino, It also provides power for the Arduino.

Connecting the motors to the motor shield

It’s so simple as you’ll choose a terminal and connect the 2 motor wires, you also should follow a standard connection for each motor, just the same as the wiring example.

Software Part

The Motor Shield

You’ll need Adafruit library for the motor shield, try the following steps:

Rename the uncompressed folder AFMotor. Be sure that there are the AFMotor.cpp and the AFMotor.h files in the AFMotor folder.

Add the library to the Arduino IDE as mentioned in step 1-3

The 1Sheeld App

We’ll use the game pad shield from the application. before using the mobile as a shield you need to find your 1Sheeld and connect to it, if you’re being asked to enter a PIN code enter 1234.

After selecting your 1Sheeld board, you’ll turn on the game pad shield

Then open the shields menu by tapping on the rectangle and stay on the game pad shield screen.

The Code

So, Basically we want the robot to move according to the game pad keys, and in the following directions.

Up – Forward

Down – Backward

Left – Steer Left

Right – Steer Right

using two wheeled motors is called differential drive

The library makes our lives easier by providing a simple way to run the motor (this image is from AFMotor.h code file.

The main difference between the brake condition and the release condition is that in the brake condition the motor is forced to stop at its place, but in the release condition the motor is free to move a little bit according to its inertia.

If you don’t have Adafruit motor shield, you can use any motor driver/shield in the same manner, the code will just differ a little bit as you’ll set the pins yourself but that follows the same concepts here.

I just edited the game pad shield example from the 1Sheeld library,the code is below. the code for version 2.3 is also added and it was written by Garry Gerwer

If all your connections follow one standard, this code will work perfectly, if the directions seem to be flipped all what you’ll do is just flip the wires of a motor and check if it goes well.

Now you’ll just upload the code to the Arduino (don’t forget to turn the switch on the 1Sheeld to upload mode and switch it to operating mode after uploading the code).