Posts with «best arduino blog» label
Arduino Boombox

Add sound or music to your project using the "Grove Serial MP3 Player".
An Arduino UNO will be used to control the Grove Serial MP3 player by sending it specific serial commands. The Grove Base Shield allows for the easy connection of Grove sensor modules to an Arduino UNO without the need for a breadboard. A sliding potentiometer, switch and button will be connected to the Base shield along with the Serial MP3 player. A specific function will be assigned to each of the connected sensor modules to provide a useful interface:
- Sliding Potentiometer – Volume control
- Button – Next Song
- Switch – On/Off (toggle)
Video
Watch the following video to see the project in action
Parts Required:
- Arduino UNO or compatible board
- Grove Base Shield
- Grove Serial MP3 Player
- Grove Switch (P)
- Grove Sliding Potentiometer
- Grove Button or Grove Button (P)
- Grove Universal 4 pin cables
- Battery Holder
- SanDisk 8GB Ultra Micro SDHC Memory card
- Portable Powered Speaker or Headphones
- Empty Shoe Box
- Paper
- Printer
- Glue
Putting it Together
Place the Grove Base shield onto the Arduino UNO,
and then connect each of the Grove Modules as per the table below.
If you do not have a Grove Base shield,
you can still connect the modules directly to the Arduino as per the table below:
When you are finished connecting the modules, it should look something like this:
(ignore the battery pack):
As you can see from the picture above. You can cut holes out of the shoebox and stick the modules in place. Please ignore the battery pack, because you won't use it until after you have uploaded the Arduino code.
Arduino Sketch
1 |
|
IMPORTANT: You need to load your MP3 sounds or songs onto the SDHC card before you install it onto the Serial MP3 player.
Once the SDHC card is installed, and your code is uploaded to the Arduino, all you have to do now is connect the MP3 player to some headphones or a powered speaker. You can then power the Arduino and modules with a battery pack or some other portable power supply.
You can design and decorate the shoebox in any way you like. Just print out your picture, glue them on, and before you know it, you will have your very own Arduino Boombox.

Comments
I was very surprised by the quality of the sound that came from the MP3 module. It is actually quite good.
This tutorial was an introduction to the Grove Serial MP3 module in it's most basic form. You could just as easily use some other sensor to trigger the MP3 module. For example, you could get it to play an alert if a water leak was detected, or if a door was opened, or if the temperature got too high or too low. You could get it to play a reminder when you walk into your room. The possibilities are endless.
I really liked this module, and I am sure it will appear in a future tutorial.
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.
Weather Reporter - Temboo, Ethernet and Arduino
Parts Required
- 2 x Arduino UNO (or compatible board)
- Ethernet Shield
- ITDB02-1.8SP TFT LCD Module
- Solderless Breadboard Jumper wires
- Mini Breadboard 4.5cm x 3.5cm
- Protoshield
Project Description
- How to use an Ethernet Shield with a Temboo account to retrieve internet data
- How to use a TFT LCD module (ITDB02-1.8SP)
- How to reduce memory consumption when using the UTFT library
- How to power two Arduinos with a single USB cable
- How to transmit data from one Arduino to another (via jumper wires)
Video
You will need to create a Temboo account to run this project:
Temboo Account Creation
Step 1:
Visit the Temboo website : https://www.temboo.com/ Create an account by entering a valid email address. Then click on the Sign Up button.
Step 2:
Verify your email address by clicking on the link provided in the email sent by Temboo.
Step 3:
You will be directed to the account setup page: Create an Account Name, and Password for future access to your Temboo Account Check the terms of service and if you agree, then tick the box Press the Go! button
Step 4:
You will then encounter the "Welcome!" screen:
Step 5:
Navigate to the top right of the screen and select the LIBRARY tab
Step 6:
On the left hand side you will see a list of choreos. Type Yahoo into the search box on the top left of the screen. Navigate to the GetWeatherByAddress Choreo by clicking on... Yahoo _ Weather _ GetWeatherByAddress
Step 7:
Turn the IoT Mode to ON (in the top right of screen)
Step 8:
What's your platform / device? : Arduino How is it connected? : Arduino Ethernet The following popup box will appear:
Step 9:
Name: EthernetShield - you can choose any name. Letters and numbers only. No spaces. Shield Type: Arduino Ethernet MAC Address : You can normally find the MAC address of the Ethernet shield on the underside. Enter the MAC address without the hyphens. Then click SAVE.
Step 10:
Move to the INPUT section. Enter the Address of the place you want the Temperature for. Address = Perth, Western Australia Expand the Optional INPUT for extra functionality Units = c - If you want the temperature in Celcius.
Step 11:
This will automatically generate some Arduino CODE and a HEADER FILE. Don't worry about the Arduino code for now... because I will provide that for you. However, you will need the automatically generated HEADER file. I will show you what to do with that soon. So don't lose it !'
Temboo Library Install
The Temboo library will need to be installed before you copy the Arduino code in the sections below. To install the Temboo library into your Arduino IDE, please follow the link to their instructions: Installing the Temboo Arduino Library
UTFT Library Install
Download the UTFT library from this site: http://www.henningkarlsen.com/electronics/library.php?id=51 Once downloaded and extracted. Go into the UTFT folder and look for the memorysaver.h file. Open this file in a text editor, and "uncomment" all of the TFT modules that are not relevant to this project. I disabled all of the TFT modules except the last 3 (which made reference to ST7735) - see picture below. The TFT module we are using in this project is the ITDB02-1.8SP from ITEAD Studio. Save the memorysaver.h file, and then IMPORT the library into the Arduino IDE as per the normal library import procedure. If you do not modify the memorysaver.h file, the Arduino SLAVE sketch will not compile.
Arduino Code (MASTER)
This project uses 2 Arduino UNOs. One will be the Master, and one will be the Slave. The following code is for the Arduino MASTER. Open up the Arduino IDE. (I am using Arduino IDE version 1.6) Paste the following code into the Arduino IDE code window. PLEASE NOTE: You may need to change some of the lines to accomodate your INPUTS from step 10. Have a look around line 36 and 37. 1 |
|
Select "New Tab" from the drop-down menu on the top right of the IDE. Name the file: TembooAccount.h
Paste the contents of the HEADER file from the Temboo webpage (Step 11 above) into the TembooAccount.h tab. If you do not have the TembooAccount.h tab with the contents of this HEADER file next to your Arduino Master sketch, then it will NOT work.
Make sure to SAVE the Arduino Sketch and upload the code to the Arduino (MASTER)
Arduino Code (SLAVE)
This project uses 2 Arduino UNOs. One will be the Master, and one will be the Slave. The following code is for the Arduino SLAVE. Make sure to disconnect the Arduino MASTER from your computer, and keep it to one side. Connect the Arduino SLAVE to your computer, and upload the following code to it. Make sure to create a new sketch for this code (File _ New). 1 |
|
Wiring it up
Once the code has been uploaded to both Arduinos (Master and Slave), I tend to label each Arduino so that I don't mix them up. You will notice an 'S' marked on the SLAVE in some of the photos/videos. Then it is time to piggy-back the shields onto the Arduinos and wire them up. Make sure you disconnect the USB cable from the Arduinos before you start doing this.
Step 1: Ethernet Shield
Place the Ethernet shield onto the Arduino MASTER. Connect an Ethernet cable (RJ45) to the Ethernet shield. The other end will connect to your internet router.
Step 2: Arduino SLAVE and TFT LCD module
You can either wire up the TFT LCD module on a breadboard, or you can use a ProtoShield with mini-breadboard. It doesn't really matter how you hook it up, but make sure you double check the connections and the TFT specifications before you power it up. I have powered the Arduino Slave by connecting it to the Arduino Master (see fritzing sketch below).
There is no reason why you couldn't just power the slave seperately. In fact this is probably the safer option. But I read that this power-sharing setup was ok, so I wanted to give it a go. I have no idea whether it would be suitable for a long term power project... so use it at your own risk. I tried using 4 x AA batteries to power this circuit, but found that the LCD screen would flicker. So then I tried a 9V battery, and noticed that the 5V voltage regulator was heating up more than I felt comfortable with. In the end, I settled with the USB option, and had no further issues. I am sure there are other possible options, and feel free to mention them in the comments below.
Use the following fritzing sketch and tables to help you wire this circuit up.
Fritzing sketch
Arduino MASTER to SLAVE connection table
Arduino SLAVE to ITDB02-1.8SP TFT LCD
ITDB02-1.8SP TFT LCD Module Pictures
Project Pictures
Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
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.
New forum
E-Paper Barcode 39
E-Paper (or Electronic paper) is a display technology that mimics the appearance of ordinary ink on paper. E-paper displays do not emit light, rather they reflect light, thus making them much more comfortable to read and provide a wider viewing angle than most light emitting displays (source: Wikipedia).
I printed something to an E-paper display, unplugged it, and could still read the message clearly months later. These E-paper displays are great for showing information that is static for long periods. You only need to provide power when the data or information needs updating.
Barcodes are used everywhere, and one of the simplest Barcodes to generate is the Code 39 format (also known as Code 3 of 9). I used an E-paper shield and E-paper module to display a number in this barcode format. I then tested it with a Barcode reader and it worked perfectly.
This tutorial will show you how to send a number to the Arduino from the Serial Monitor, and display the Barcode on the E-paper module.
The Video
The video will show you how to assemble the shield and the module onto the Arduino, and also how to install the SDHC card.
Parts Required:
Library Download
To use the e-paper shield, you will need to download the Small e-paper Shield library.
This library will allow you to use the following functions on the e-paper shield:
- begin : to set up the size of the e-paper panel
- setDirection : to set up the display direction
- drawChar : to display a Character at a specified position
- drawString : to display a String of characters at a specified position
- drawNumber and drawFloat : to display a number
- drawLine : to draw a line
- drawHorizontalLine : to draw a horizontal line
- drawVerticalLine : to draw a vertical line
- drawCircle : to draw a circle
- fillCircle : to draw and fill a circle
- drawRectangle : to draw a rectangle
- fillRectangle : to draw and fill a rectangle
- drawTriangle : to draw a triangle
For more information on how to use these functions, please visit the seeedstudio wiki. If you are unfamiliar with installing libraries - then have a look at the following sites:
- Arduino Library Installation
- Adafruit Library Installation guide
- Sparkfun Library Installation guide
Barcode 39 Info
Barcode 39 (or Code 3 of 9) is a barcode that consists of black and white vertical lines. These lines can be thick or thin. Each character can be coded using 9 alternating black and white bars. The barcode always starts with a black bar, and ends with a black bar.
If you code using thin lines only, then each character can be coded using a total of 12 bars. A wide black line is essentially two thin black lines next to each other. Same goes for a wide white line. Because there are now only 2 options (black or white), you can create a binary code. I used a 1 for black bars, and 0 for white bars. If there was a thick black bar, then this would be represented with a 11. A thick white bar would be 00.
Each barcode sequence starts and ends with a hidden * character. Therefore if you were to display just the number 1, you would have to provide the code for *1*.
- * = 100101101101
- 1 = 110100101011
- * = 100101101101
Something also to take note of: is that each character is separated by a thin white line (and not represented in the binary code).
All of these 0's and 1's can get a bit confusing, so I decided to represent these binary numbers as decimals. For example, the picture below shows how a 0 and an 8 would be coded (without the *):
The table below provides the binary and decimal codes for each number used in this tutorial. I have also included for your own reference, each letter of the alphabet, however I did not use these in this tutorial.
The binary representation of each character in this table was obtained from this site.
www.barcodeisland.com is a great resource of information about barcodes.
Arduino Sketch
1 |
|
There is something weird about the E-paper shield library which tends to display the word "temperature:" in the Serial monitor when opened, and with each serial transmission. Don't worry about this. Just ignore it.'

Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
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.
One in a million
I don't know what to say, but I feel like I should say something.
Thank you for visiting my blog.
Here are the blog posts that have received most attention to date:
1. Ultrasonic sensor
2. Simple Arduino Serial Communication
3. Bluetooth tutorial 1
4. Bluetooth Android Processing
5. Sound Sensor
6. 433 MHz RF Module with Arduino : this one is rising FAST !
7. Reading from a text file and sending to Arduino
8. Flex sensor and LEDs
9. PhotoCell - sensing light
10. Simple Arduino Serial Communication (Part 2)
For a list of all my projects - please visit my projects page:
ArduinoBasics Project Page
If that is not enough, then perhaps you should visit the Arduino Tutorials Community on Google+.
You are bound to find a project that sparks your interest, or perhaps you could even share your own !
Feel free to leave your thoughts, suggestions or messages in the comments.
Or if you wish to send a confidential message to me - then I would advise to use the form on my Feedback page.
Thanks again for visiting, and good luck with your project and/or Arduino journey !!
DIY Canon Intervalometer using Arduino

By taking a picture every 3 seconds, and then playing the sequence back at 30 frames a second, you will get to see a 10 minute event in just 7 seconds.To get a nice flowing motion picture, you need to get a good balance between the recording frame rate, and the play-back frame rate.

The recording frame rate is limited by the amount of memory you have in your camera, the length of the captured event, battery charge, and the camera's general capabilities. The playback frame rate needs to be fast enough to prevent jittering, but not so fast that you lose the event in a blink of an eye. The more you practice with different subject matters, the more you get a feel for how long you need to keep the camera running and how long to leave between shots.
When taking pictures of the clouds, you can generally use a 3-5 second frame rate, depending on their speed across the sky. To capture the flow of traffic, I would recommend a picture every 1-2 seconds. However, for really slow events like a plant growing, you may need to extend the frame capture rate significantly. You will get a better idea once you try it for yourself.

This tutorial follows on from the Arduino selfie tutorial, so you might notice some similarities. However, in this tutorial, we will have more control over the intervalometer by using a sliding potentiometer and an LED bar. The pin layout is slightly different from the Arduino Selfie tutorial - so best to start from scratch to avoid pin misconfigurations.
Warning : Any circuit you build for your camera (including this one) is at your own risk. I will not take responsibility for any damage caused to any of your equipment.
I found out that my Canon Powershot SX50 HS camera has a port on the side for a remote switch. In the "Optional Accessories" section of the camera brochure, it identifies the remote switch model as RS-60E3. I then looked up the model number on this website to find out the size of the jack (3 core, 2.5mm), and the pinout (Ground, focus and shutter) required to emulate the remote switch. Once I had this information, I was able to solder some really long wires to the jack and connect up the circuit (as described below).
I use Time-Lapse tool to stitch all of the pictures together to create a movie/animation.
You will need to download and install the LED_Bar library from Seeedstudio into your Arduino IDE libraries folder in order to use the LED Bar in this tutorial. For more information about the LED Bar - visit the LED Bar Seeed-Studio wiki.
Parts Required:
- Freetronics Eleven or (Arduino UNO compatible board)
- Grove Base Shield
- Grove Sliding Potentiometer
- Grove LED Bar
- Grove Universal 4 Pin 20cm Cable
- 4 Channel Relay Module
- 2x 330 ohm resistors
- 2 x diodes
- breadboard
- Jumper Wires (male to male)
- Jumper Wires (female to male)
- Canon Powershot SX50 HS - (here is the brochure)
- Three core, 2.5 mm Jack
Fritzing Sketch
Connection Tables
Arduino to Relay Module:
Relay Module to Camera:
Arduino to Slide Potentiometer:
Arduino to LED Bar:
Arduino Sketch
1 |
|
The Video

This has been one of my favorite projects, it was a lot of fun, and very interesting.
I highly recommend that you try it out!

Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
Have a look at my videos on my YouTube channel.

Feel free to share this page with your friends in any way you see fit.
Arduino Selfie

My attention is drawn towards the noise behind me....
I cannot believe it.
There it is.
The Arduino is taking a SELFIE !!
How did this happen?
Well actually, it is not that difficult for an Arduino.
I found out that my Canon Powershot SX50 HS camera has a port on the side for a remote switch. In the "Optional Accessories" section of the camera brochure, it identifies the remote switch model as RS-60E3. I then looked up the model number on this website to find out the size of the jack (3 core, 2.5mm), and the pinout (Ground, focus and shutter) required to emulate the remote switch. Once I had this information, I was able to solder some really long wires to the jack and connect up the circuit (as described below).
Warning : Any circuit you build for your camera (including this one) is at your own risk. I will not take responsibility for any damage caused to any of your equipment.
Parts Required:
- Freetronics Eleven or (Arduino UNO compatible board)
- 4 Channel Relay Module
- 2x 330 ohm resistors
- 2 x diodes
- breadboard
- Jumper Wires (male to male)
- Jumper Wires (female to male)
- Canon Powershot SX50 HS - (here is the brochure)
- Three core, 2.5 mm Jack
Fritzing Sketch

Connection Table

Three core, 2.5 mm jack

Camera Connection to Relays

Jack pinout

Completed Circuit
Arduino Sketch
1 |
|
By connecting up the camera to an Arduino, the camera just got smarter !!
The Arduino connects to 2 different channels on the relay board in order to control the focus and the shutter of the camera. The relays are used to isolate the camera circuit from that of the Arduino. I have also included a couple of diodes and resistors in the circuit as an extra precaution, however they may not be needed.
Warning : Any circuit you build for your camera (including this one) is at your own risk. I will not take responsibility for any damage caused to any of your equipment. Do your research, and take any precautions you see fit.
The Video

Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
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.
Relay Module

WARNING: Mishandling or incorrect or improper use of relays could result in

- serious personal injury or DEATH
- possible physical damage of the product
- faulty operation
- or create serious/dangerous hazards.
Please make sure that you read and understand how your relay/relay module board works, the voltage and current it is rated for, and the risks involved in your project BEFORE you even attempt to start putting it together. Seek professional and qualified assistance BEFORE you undertake ANY high power projects.
If you choose to follow the instructions in this tutorial, you do so at your own risk. I am not an electrician, and am not a qualified electrical engineer - so please do your research and seek advice BEFORE undertaking a project using a relay. Please check your connections and test them BEFORE turning the power on.
I accept no responsibility for your project, or the risk/damage/fire/shock/injury/death/loss that it causes. You take full responsibility for your actions/project/creation, and do so at YOUR OWN RISK !!!
Please note: It is illegal in some countries to wire up a high power project without an electrician. Please check your country's rules/laws/regulations before you undertake your project. If you have any doubts - don't do it.
What is a relay
A Relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate the switch and provide electrical isolation between two circuits. In this project there is no real need to isolate one circuit from the other, but we will use an Arduino UNO to control the relay. We will develop a simple circuit to demonstrate and distinguish between the NO (Normally open) and NC (Normally closed) terminals of the relay. We will then use the information gained in this tutorial to make a much more exciting circuit. But we have to start somewhere. So let's get on with it.
Parts Required:
- Freetronics Eleven or (Arduino UNO compatible board)
- 4 Channel Relay Module
- 2x LEDs
- 2x 330 ohm resistors
- Jumper Wires (male to male)
- Jumper Wires (female to male)
Fritzing Sketch

Table of Connections

Arduino Sketch
1 |
|
The Red light on the Relay board turns on when power is applied (via the VCC pin). When power is applied to one of the Channel pins, the respective green light goes on, plus the relevant relay will switch from NC to NO. When power is removed from the channel pin, the relay will switch back to NC from NO. In this sketch we see that power is applied to both LEDs in the setup() method. When there is no power applied to the CH1 pin, the yellow LED will be on, and the Green LED will be off. This is because there is a break in the circuit for the green LED. When power is applied to CH1, the relay switches from NC to NO, thus closing the circuit for the green LED and opening the circuit for the yellow LED. The green LED turns on, and the yellow LED turns off.
I also show what happens when you apply power to a channel (eg. CH3) when there is nothing connected to the relay terminals. The respective onboard LED illuminates. This is useful for troubleshooting the relays, and knowing what state the relay is in (NC or NO). NC stands for Normally closed (or normally connected) NO stands for Normally open (or normally disconnected)
Here is a circuit diagram for two of the relays on the relay module (CH1 and CH2).
This was taken from the iteadstudio site.
The Video


Grove Water Sensor
Connecting a water sensor to an Arduino is a great way to detect a leak, spill, flood, rain etc. It can be used to detect the presence, level, volume and/or the absence of water. While this could be used to remind you to water your plants, there is a better Grove sensor for that. The sensor has an array of exposed traces which will read LOW when water is detected. In this tutorial, we will connect the Water Sensor to Digital Pin 8 on the Arduino, and will enlist the very handy Grove Piezo buzzer and an LED to help identify when the Water sensor comes into contact with a source of water.
Parts Required:
- Arduino UNO or compatible board
- Grove Base Shield
- Grove Water Sensor
- Grove Piezo Buzzer
- Grove Universal 4 pin 20cm cables (x 2)
- RED LED
- Battery Holder
- Water
Putting it together
If you have a Grove Base Shield, you just have to connect the Grove Water Sensor to D8 on the shield, and the Buzzer to D12 on the Shield. My Grove base shield obstructs the onboard LED, so I will attach an LED to Digital pin 13. If you do not have a Grove base shield, then you should connect the Sensors as described in the tables below:
Arduino Sketch
1 |
|
The Video

If you liked this tutorial - please show your support :