Posts with «fun» label

Matrix and Joystick

For the original tutorial, please visit: https://arduinobasics.blogspot.com

 
 

Project Description

In this project, we will use a little joystick to move a pixel around an 8x8 LED matrix. The joystick has a built-in button, such that when you press down onto the joystick, the colour of the pixel will change from red to blue to green. This is a very simple project, however, controlling the matrix adds a certain level of complexity. You will need to understand binary notation and bit-shifting techniques to grasp the concept of this tutorial.

All of the parts used in this project can be obtained from digitspace.com

 
 
 
 

Libraries

The SPI library is required for this project. However, this library is built into the current version of the Arduino IDE. No additional download is required. Just make sure to include it at the top of the sketch.

 
 

Arduino Code

The Arduino IDE can be downloaded from the official Arduino website: here.
Copy and paste the following code into your Arduino IDE and upload it to the Arduino UNO.

 
 

Connections

 
 

Project Video

As you can see from the video above, the pixel changes colour when the button is pressed. The position of the pixel relates to the position of the joystick. The lag between the joystick movement and pixel movement is minimal, and very satisfying.

 
 

Conclusion

This was a very fun and satisfying project that showcases the interaction between a joystick and a 8x8 LED matrix with the help of an Arduino UNO. This project was sponsored by the kind people at digitspace. Without their sponsorship, this tutorial would not have been possible. Please visit their website for some nice deals on Arduino related products.

If you found this tutorial helpful, please consider supporting me by buying me a virtual coffee/beer.

$3.00 AUD only

Social Media

You can find me on various social networks:

Follow me on Twitter: ScottC @ArduinoBasics.
I can also be found on Instagram, Pinterest, and YouTube.
And if all else fails, I have a server on Discord.


ScottC 09 Mar 07:41
8x8  arduino  ce  clk  fun  joystick  led  matrix  module  mosi  pixel  programming  spi  sw  tutorial  uno  x  y  

Digital Rain Cloud

 
 

Description

This is a very simple project that turns a Rainbow Cube Kit from Seeedstudio, into a digital rain cloud. It features a relaxing rain animation which is ruined by a not-so-relaxing yet somewhat realistic lightning effect. The animation has a very random pattern, and is quite satisfying to watch. The strategically placed cotton wool on the top of the cube makes all the difference to the project, and is sure to impress all of your friends. Luckily, I have done all of the hard work for you. You will find the full source code for the animation sequence below. You just have to provide the Rainbow Cube Kit and the cotton wool. Have fun !!

 
 

Cellular Automata Explorer

Well all know cellular automata from Conway’s Game of Life which simulates cellular evolution using rules based on the state of all eight adjacent cells. [Gavin] has been having fun playing with elementary cellular automata in his spare time. Unlike Conway’s Game, elementary automata uses just the left and right neighbors of a cell to determine the next cell ahead in the row. Despite this comparative simplicity, some really complex patterns emerge, including a Turing-complete one.

[Gavin] started off doing the calculations by hand for fun. He made some nice worksheets for this. As we can easily imagine, doing the calculations by hand got boring fast. It wasn’t long before his thoughts turned to automating his cellular automata. So, he put together an automatic cellular automator. (We admit, we are having a bit of fun with this.)

This could have been a quick software project but half the fun is seeing the simulations on a purpose-built ecosystem. The files to build the device are hosted on Thingiverse. Like other cellular automata projects, it uses LED matrices to display the data. An Arduino acts as the brain and some really cool retro switches from the world’s most ridiculously organized electronics collection finish the look of the project.

To use, enter the starting condition with the switches at the bottom. The code on the Arduino then computes and displays the pattern on the matrix. Pretty cool and way faster than doing it by hand.


Filed under: Arduino Hacks, misc hacks

MT8870 DTMF - Dual Tone Multi Frequency Decoder

Project Description

We will be using an MT8870 DTMF module with an Arduino UNO to control a small servo motor in this project. The DTMF module gives the Arduino super-powers and allows you to control the Servo motor in so many ways. For example, this tutorial will show you how to control the servo motor using:
  • a YouTube Video
  • a voice recorder
  • A web application (Online tone generator)
  • A smart phone app (DTMF Pad)
  • A touch-tone phone to cell-phone call
All of these control methods will take advantage of the same exact Arduino code/sketch. But how???
The MT8870 DTMF decoder is quite a neat little module that allows you incorporate DTMF technology into your arduino projects. DTMF stands for Dual-Tone Multi-Frequency. DTMF tones are commonly associated with touch-tone phones and other telecommunication systems. When you press the number "1" on a touch-tone phone, two sine waves with frequencies: 697Hz and 1209Hz are combined to produce a unique DTMF signal which can be transmitted through the phone line. The MT8870 DTMF module can take this signal as an input, and decode it to produce a binary output.
 
 

 
The DTMF module does not care how you produce the DTMF tone. However, if it receives this tone, it will decode it. We can take advantage of this feature to supply the module with tones from different sources. The module has a 3.5mm port for line input. Providing you can connect your DTMF source to this line input in some way, it should work. I must warn you, however that this is a line input and NOT a microphone input. If you wanted to use a microphone, you will need to boost or amplify the signal before sending it to the DTMF module.
 
You will need the following parts for this project
 

Parts Required:

Software/Apps Required

Arduino Sketch


Upload the following sketch to the Arduino.
 

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
/* ================================================================================================================================================== Project: MT8870 DTMF Servo sketch Author: Scott C Created: 4th August 2015 Arduino IDE: 1.6.4 Website: http://arduinobasics.blogspot.com/p/arduino-basics-projects-page.html Description: This project will allow you to control a Servo motor using an Arduino UNO and a MT8870 DTMF Module. The DTMF signal is received through the 3.5mm port of the DTMF module and is decoded. We will use the decoded output to control the position of the Servo. A SG-5010 Servo motor was used in this project. ===================================================================================================================================================== *///This sketch uses the Servo library that comes with the Arduino IDE #include <Servo.h> //Global variables----------------------------------------------------------------------------------------- Servo SG5010; // The SG5010 variable provides Servo functionality int servoPosition = 0; // The servoPosition variable will be used to set the position of the servo byte DTMFread; // The DTMFread variable will be used to interpret the output of the DTMF module. const int STQ = 3; // Attach DTMF Module STQ Pin to Arduino Digital Pin 3 const int Q4 = 4; // Attach DTMF Module Q4 Pin to Arduino Digital Pin 4 const int Q3 = 5; // Attach DTMF Module Q3 Pin to Arduino Digital Pin 5 const int Q2 = 6; // Attach DTMF Module Q2 Pin to Arduino Digital Pin 6 const int Q1 = 7; // Attach DTMF Module Q1 Pin to Arduino Digital Pin 7 /*========================================================================================================= setup() : will setup the Servo, and prepare the Arduino to receive the MT8700 DTMF module's output. ========================================================================================================== */void setup() { SG5010.attach(9); // The Servo signal cable will be attached to Arduino Digital Pin 9 SG5010.write(servoPosition); // Set the servo position to zero. //Setup the INPUT pins on the Arduino pinMode(STQ, INPUT); pinMode(Q4, INPUT); pinMode(Q3, INPUT); pinMode(Q2, INPUT); pinMode(Q1, INPUT);} /*========================================================================================================= loop() : Arduino will interpret the DTMF module output and position the Servo accordingly ========================================================================================================== */void loop() { if(digitalRead(STQ)==HIGH){ //When a DTMF tone is detected, STQ will read HIGH for the duration of the tone. DTMFread=0; if(digitalRead(Q1)==HIGH){ //If Q1 reads HIGH, then add 1 to the DTMFread variable DTMFread=DTMFread+1; } if(digitalRead(Q2)==HIGH){ //If Q2 reads HIGH, then add 2 to the DTMFread variable DTMFread=DTMFread+2; } if(digitalRead(Q3)==HIGH){ //If Q3 reads HIGH, then add 4 to the DTMFread variable DTMFread=DTMFread+4; } if(digitalRead(Q4)==HIGH){ //If Q4 reads HIGH, then add 8 to the DTMFread variable DTMFread=DTMFread+8; } servoPosition = DTMFread * 8.5; //Set the servoPosition varaible to the combined total of all the Q1 to Q4 readings. Multiply by 8.5 to amplify the servo rotation. } SG5010.write(servoPosition); //Set the servo's position according to the "servoPosition" variable. }


 
 
 

Fritzing Sketch


Connect the Arduino to the MT8870 DTMF module, and to a Servo.
Use the following Fritzing sketch as a guide.
 
(Click the image above to enlarge it)



Discussion


You will need to connect a cable from the DTMF module's 3.5mm port to that of your smart phone, computer, voice recorder or any other DTMF source of your choice.
 

 

When you power up your Arduino, the Servo motor should turn all the way to the left to it's zero position. Once the DTMF module receives a DTMF signal, it will identify the relevant frequecies as described in the table at the beginning of this tutorial, and produce a binary like output. You will notice the DTMF module's onboard LEDs light up when a tone is detected. Onboard LED (D5) will turn on for the length of the DTMF tone it just received, and turn off when the tone has stopped. On the other hand, the onboard LEDs (D1 to D4) will light up depending on the tone received, and will remain lit until the module receives another tone. The onboard LEDs are a visual representation of the voltages applied to the DTMF module's pins (Q1 to Q4, and STQ). Q1 matches D1, Q2 matches D2 etc etc. and STQ matches D5.
 
You will notice that there are two STQ pins on the DTMF module. The STQ pin that is closest to Q4 will only go high when a DTMF tone is detected, and will remain high for the duration of the tone. The other STQ pin is the exact opposite. It will switch LOW when a tone is received and remain LOW for the duration of the tone. When there is no tone, this STQ pin will remain HIGH. The table below provides a summary of the DTMF module outputs, with a blue box representing a voltage applied to that pin (HIGH), whereas a black box indicates no voltage applied (LOW).


 
In order to follow this project, you need a source of DTMF tones. You can produce DTMF tones using a touch-tone phone, or through the use of a DTMF Pad app. If you are feeling creative, you can create a DTMF song/tune like the one I posted on YouTube. You can see the video below:
 

 
As you can see from the video, I also recorded the DTMF tune onto a voice recorder, and was able to control the servo that way. If you are not feeling creative, you can visit this website to create DTMF tones from your browser.

Concluding comments


This project was very fun, and shows some novel ways to control your Arduino. After completing the project, I realised that I could use this module to alert me when new emails or messages arrive on my phone or computer. If you have the ability to change the email or message notification sound to a DTMF tone, you should be able to get the module and Arduino to respond accordingly. Oh well, maybe I'll save that project for another day.
 
If this project helped you in anyway or if you use my code within your project, please let me know in the comments below. I would be interested to see what you did.


If you like this page, please do me a favour and show your appreciation :

 
Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
I can also be found on Pinterest and Instagram.
Have a look at my videos on my YouTube channel.


 
 
             

 



However, if you do not have a google profile...
Feel free to share this page with your friends in any way you see fit.

MT8870 DTMF - Dual Tone Multi Frequency Decoder

Project Description

We will be using an MT8870 DTMF module with an Arduino UNO to control a small servo motor in this project. The DTMF module gives the Arduino super-powers and allows you to control the Servo motor in so many ways. For example, this tutorial will show you how to control the servo motor using:
  • a YouTube Video
  • a voice recorder
  • A web application (Online tone generator)
  • A smart phone app (DTMF Pad)
  • A touch-tone phone to cell-phone call
All of these control methods will take advantage of the same exact Arduino code/sketch. But how???
The MT8870 DTMF decoder is quite a neat little module that allows you incorporate DTMF technology into your arduino projects. DTMF stands for Dual-Tone Multi-Frequency. DTMF tones are commonly associated with touch-tone phones and other telecommunication systems. When you press the number "1" on a touch-tone phone, two sine waves with frequencies: 697Hz and 1209Hz are combined to produce a unique DTMF signal which can be transmitted through the phone line. The MT8870 DTMF module can take this signal as an input, and decode it to produce a binary output.
 
 

 
The DTMF module does not care how you produce the DTMF tone. However, if it receives this tone, it will decode it. We can take advantage of this feature to supply the module with tones from different sources. The module has a 3.5mm port for line input. Providing you can connect your DTMF source to this line input in some way, it should work. I must warn you, however that this is a line input and NOT a microphone input. If you wanted to use a microphone, you will need to boost or amplify the signal before sending it to the DTMF module.
 
You will need the following parts for this project
 

Parts Required:

Software/Apps Required

Arduino Sketch


Upload the following sketch to the Arduino.
 

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
/* ================================================================================================================================================== Project: MT8870 DTMF Servo sketch Author: Scott C Created: 4th August 2015 Arduino IDE: 1.6.4 Website: http://arduinobasics.blogspot.com/p/arduino-basics-projects-page.html Description: This project will allow you to control a Servo motor using an Arduino UNO and a MT8870 DTMF Module. The DTMF signal is received through the 3.5mm port of the DTMF module and is decoded. We will use the decoded output to control the position of the Servo. A SG-5010 Servo motor was used in this project. ===================================================================================================================================================== *///This sketch uses the Servo library that comes with the Arduino IDE #include <Servo.h> //Global variables----------------------------------------------------------------------------------------- Servo SG5010; // The SG5010 variable provides Servo functionality int servoPosition = 0; // The servoPosition variable will be used to set the position of the servo byte DTMFread; // The DTMFread variable will be used to interpret the output of the DTMF module. const int STQ = 3; // Attach DTMF Module STQ Pin to Arduino Digital Pin 3 const int Q4 = 4; // Attach DTMF Module Q4 Pin to Arduino Digital Pin 4 const int Q3 = 5; // Attach DTMF Module Q3 Pin to Arduino Digital Pin 5 const int Q2 = 6; // Attach DTMF Module Q2 Pin to Arduino Digital Pin 6 const int Q1 = 7; // Attach DTMF Module Q1 Pin to Arduino Digital Pin 7 /*========================================================================================================= setup() : will setup the Servo, and prepare the Arduino to receive the MT8700 DTMF module's output. ========================================================================================================== */void setup() { SG5010.attach(9); // The Servo signal cable will be attached to Arduino Digital Pin 9 SG5010.write(servoPosition); // Set the servo position to zero. //Setup the INPUT pins on the Arduino pinMode(STQ, INPUT); pinMode(Q4, INPUT); pinMode(Q3, INPUT); pinMode(Q2, INPUT); pinMode(Q1, INPUT);} /*========================================================================================================= loop() : Arduino will interpret the DTMF module output and position the Servo accordingly ========================================================================================================== */void loop() { if(digitalRead(STQ)==HIGH){ //When a DTMF tone is detected, STQ will read HIGH for the duration of the tone. DTMFread=0; if(digitalRead(Q1)==HIGH){ //If Q1 reads HIGH, then add 1 to the DTMFread variable DTMFread=DTMFread+1; } if(digitalRead(Q2)==HIGH){ //If Q2 reads HIGH, then add 2 to the DTMFread variable DTMFread=DTMFread+2; } if(digitalRead(Q3)==HIGH){ //If Q3 reads HIGH, then add 4 to the DTMFread variable DTMFread=DTMFread+4; } if(digitalRead(Q4)==HIGH){ //If Q4 reads HIGH, then add 8 to the DTMFread variable DTMFread=DTMFread+8; } servoPosition = DTMFread * 8.5; //Set the servoPosition varaible to the combined total of all the Q1 to Q4 readings. Multiply by 8.5 to amplify the servo rotation. } SG5010.write(servoPosition); //Set the servo's position according to the "servoPosition" variable. }


 
 
 

Fritzing Sketch


Connect the Arduino to the MT8870 DTMF module, and to a Servo.
Use the following Fritzing sketch as a guide.
 
(Click the image above to enlarge it)



Discussion


You will need to connect a cable from the DTMF module's 3.5mm port to that of your smart phone, computer, voice recorder or any other DTMF source of your choice.
 

 

When you power up your Arduino, the Servo motor should turn all the way to the left to it's zero position. Once the DTMF module receives a DTMF signal, it will identify the relevant frequecies as described in the table at the beginning of this tutorial, and produce a binary like output. You will notice the DTMF module's onboard LEDs light up when a tone is detected. Onboard LED (D5) will turn on for the length of the DTMF tone it just received, and turn off when the tone has stopped. On the other hand, the onboard LEDs (D1 to D4) will light up depending on the tone received, and will remain lit until the module receives another tone. The onboard LEDs are a visual representation of the voltages applied to the DTMF module's pins (Q1 to Q4, and STQ). Q1 matches D1, Q2 matches D2 etc etc. and STQ matches D5.
 
You will notice that there are two STQ pins on the DTMF module. The STQ pin that is closest to Q4 will only go high when a DTMF tone is detected, and will remain high for the duration of the tone. The other STQ pin is the exact opposite. It will switch LOW when a tone is received and remain LOW for the duration of the tone. When there is no tone, this STQ pin will remain HIGH. The table below provides a summary of the DTMF module outputs, with a blue box representing a voltage applied to that pin (HIGH), whereas a black box indicates no voltage applied (LOW).


 
In order to follow this project, you need a source of DTMF tones. You can produce DTMF tones using a touch-tone phone, or through the use of a DTMF Pad app. If you are feeling creative, you can create a DTMF song/tune like the one I posted on YouTube. You can see the video below:
 

 
As you can see from the video, I also recorded the DTMF tune onto a voice recorder, and was able to control the servo that way. If you are not feeling creative, you can visit this website to create DTMF tones from your browser.

Concluding comments


This project was very fun, and shows some novel ways to control your Arduino. After completing the project, I realised that I could use this module to alert me when new emails or messages arrive on my phone or computer. If you have the ability to change the email or message notification sound to a DTMF tone, you should be able to get the module and Arduino to respond accordingly. Oh well, maybe I'll save that project for another day.
 
If this project helped you in anyway or if you use my code within your project, please let me know in the comments below. I would be interested to see what you did.


If you like this page, please do me a favour and show your appreciation :

 
Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
I can also be found on Pinterest and Instagram.
Have a look at my videos on my YouTube channel.


 
 
             

 



However, if you do not have a google profile...
Feel free to share this page with your friends in any way you see fit.

Automated Pocky Dispenser

Sometimes, along comes a build project that is not so much a fail, as how not to do it. First off, some of us here had to look up what a Pocky is, never having heard, seen or tasted one – seriously. Once satisfied, we turned our attention to [Michael]’s Automated Pocky Dispenser. Took a while for us to figure out if it’s useful or not. But it’s a fun, quick project that [Michael] put together in around an hour using parts lying around in his office.

For those of you who’d like to know, a Pocky is a chocolate-coated biscuit stick, although you can also buy it in other flavors. You can grab one from a box, but maybe it tastes better when you dispense it by banging a big red button. [Michael] says he used  incredibly advanced construction techniques, but we leave it to our readers to decide on that. The key element of the build is the special “flexible coupling” that he built to transfer the rotation of the stepper motor to the dispensing mechanism. The rest of the build consists of an Arduino, stepper motor, driver, and giant red button. Special motor driving code ensures that the dispenser wiggles back and forth every time, preventing any stuck Pocky’s. And the Electronics is, well, hanging out for all to see. Happy with the success of his build, [Michael] is planning an upgraded version – to connect the Pocky Dispenser to the cloud for statistical gathering of office Pocky habits. He claims even Google does not have that data. To see the dispenser in action, check out the video below.


Filed under: misc hacks
Hack a Day 01 Mar 18:11

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  

Spider controller now sold by SparkFun

The DAGU Red back Spider controller is an Arduino Mega (1280) compatible controller that is especially designed for driving a large number of servos. All 70 I/O pins are terminated in servo compatible 3pin male headers as well as the standard female header and the power supply is a switchmode power supply delivering 5V @ 3A from an input voltage of 7V - 32V.

read more

Let's Make Robots 26 Oct 17:41
1280  48  advertising  arduino  atmega  controller  dagu  fun  robot  servos  spark  sparkfun  spider