Learn how to use a 5V relay with Arduino with our easy guide. Get step-by-step instructions on wiring, coding, and controlling relays for your projects.
What is Arduino? Arduino is a programmable circuit board that is used in many electronics and DIY projects worldwide. The co...
Arduino - Multi Servo Control Up to 16 With Arduino: In this tutorial we will learn how to control multiple servo with the Arduino. For this we will use "16 Channel Servo Expansion Board For the Arduino Uno R3". You can also control 2 DC motors and 1 stepper motor with this motor shield.
Auf Youtube sieht man immer wieder Videos von Vertikalplottern, die - meist recht behäbig - Bilder an Wände zeichnen, sprayen oder auch mal punktweise stempeln. Die meisten dieser Projekte werden über einen Arduinom angesteuert. Ich habe mir in den letzten Wochen verschiedene dieser Projekte angesch
Overview In this project, we will make our own DIY Soil Ph Meter using Soil Ph Sensor & Arduino for the measurement of Soil Ph. Soils can be naturally
Turn your Arduino into a car speedometer! This DIY project lets you measure and display your car's speed. Learn what you'll need & follow the easy steps to build your own!
Have you ever wanted to simplify or automate a task using an Arduino? Yes? Well, have you ever wanted to simplify the code required for that task into a neat collection of easy-to-use functions? Also yes? Then this tutorial is for you! In this tutorial, we will be creating a library to initialise and control a small, Arduino-powered circuit; but first, what is a library? What is a Library and how do they work? A library is a collection of resources designed to simplify a process or task. These resources can include (but aren't limited to): subroutines, functions, classes, values or type specifications. A library typically consists of: A Header File (.h) - This contains the library's definitions Source Code (.cpp) - This contains the library's code A Keyword file (.txt) - This contains the keywords used in the library A Readme file (.txt) - This contains other information about the library (Revision Number, TODO's, etc.) Examples (.ino) - These are to show a user how to operate the library All of these files should be put in a single folder (called the name of your library) which is then to be placed within the \Arduino\libraries directory of your computer. This will be shown later in the tutorial. If you're looking for a shortcut, the library we're building in this tutorial can be found on GitHub and you can read the last section on Examples, Zipping and Including to see how to get started from there. This Library's Purpose and Description This library's purpose is to easily control 3 LED's connected to 3 digital pins on the Arduino. It will have the ability to: Declare which pins the LEDs are connected to (Pins 3,5 & 6 aren't necessarily required) Turn all LEDs on Turn all LEDs off Flash all LEDs 4 times Note: This is just an introduction to library creation; once you understand how the Source File and Header File are written and combined, you can modify this code (or write your own) to perform lots of different processes using a variety of electrical components! Creating the Header File To create the header file and source code, we will need to use a word editor of some sort. I'll be using Notepad++ due to its ability to understand Arduino syntax. Once that is downloaded, open up a new document and save it as myFirstLibrary.h making sure to save as type "C++ source file". After this is done, copy the code below and paste it into the document. Have a look through the comments to get an understanding of how the header file works, this will become clearer after exploring the source file. /* * myFirstLibrary.h - An introduction to library setup * Created by Christian @ Core Electronics on 1/06/18 * Revision #5 - See readMe */ // The #ifndef statement checks to see if the myFirstLibrary.h // file isn't already defined. This is to stop double declarations // of any identifiers within the library. It is paired with a // #endif at the bottom of the header and this setup is known as // an 'Include Guard'. #ifndef myFirstLibrary_h // The #define statement defines this file as the myFirstLibrary // Header File so that it can be included within the source file. #define myFirstLibrary_h // The #include of Arduino.h gives this library access to the standard // Arduino types and constants (HIGH, digitalWrite, etc.). It's // unneccesary for sketches but required for libraries as they're not // .ino (Arduino) files. #include "Arduino.h" // The class is where all the functions for the library are stored, // along with all the variables required to make it operate class myFirstLibrary{ // 'public:' and 'private:' refer to the security of the functions // and variables listed in that set. Contents that are public can be // accessed from a sketch for use, however private contents can only be // accessed from within the class itself. public: // The first item in the class is known as the constructor. It shares the // same name as the class and is used to create an instance of the class. // It has no return type and is only used once per instance. myFirstLibrary(int pinOne, int pinTwo, int pinThree); // Below are the functions of the class. They are the functions available // in the library for a user to call. void on(); void off(); void flash(int delayTime); private: // When dealing with private variables, it is common convention to place // an underscore before the variable name to let a user know the variable // is private. int _pinOne, _pinTwo, _pinThree; }; // The end wrapping of the #ifndef Include Guard #endif Creating the Source File Creating the source code for this library will be done in a similar manner to the above section. We will open a new document in Notepad++ and save it as myFirstLibrary.cpp once again, making sure that the save as type selection is "C++ source file". Once again, read through the code below, following the comments along the way. Copy it into the document and save it in the same folder as the myFirstLibrary.h file. The folder should be called myFirstLibrary, now containing both the Header and Source files. /* * myFirstLibrary.cpp - An introduction to library setup * Created by Christian @ Core Electronics on 1/06/18 * Revision #5 - See readMe */ // The #include of Arduino.h gives this library access to the standard // Arduino types and constants (HIGH, digitalWrite, etc.). It's // unneccesary for sketches but required for libraries as they're not // .ino (Arduino) files. #include "Arduino.h" // This will include the Header File so that the Source File has access // to the function definitions in the myFirstLibrary library. #include "myFirstLibrary.h" // This is where the constructor Source Code appears. The '::' indicates that // it is part of the myFirstLibrary class and should be used for all constructors // and functions that are part of a class. myFirstLibrary::myFirstLibrary(int pinOne, int pinTwo, int pinThree){ // This is where the pinModes are defined for circuit operation. pinMode(pinOne, OUTPUT); pinMode(pinTwo, OUTPUT); pinMode(pinThree, OUTPUT); // The arguments of the constructor are then saved into the private variables. _pinOne = pinOne; _pinTwo = pinTwo; _pinThree = pinThree; } // For the 'on', 'off' and 'flash' functions, their function return type (void) is // specified before the class-function link. They also use the private variables // saved in the constructor code. void myFirstLibrary::on(){ digitalWrite(_pinOne, HIGH); digitalWrite(_pinTwo, HIGH); digitalWrite(_pinThree, HIGH); } void myFirstLibrary::off(){ digitalWrite(_pinOne, LOW); digitalWrite(_pinTwo, LOW); digitalWrite(_pinThree, LOW); } void myFirstLibrary::flash(int delayTime){ for(int i = 0; i < 4; i++){ digitalWrite(_pinOne, HIGH); digitalWrite(_pinTwo, HIGH); digitalWrite(_pinThree, HIGH); delay(delayTime); digitalWrite(_pinOne, LOW); digitalWrite(_pinTwo, LOW); digitalWrite(_pinThree, LOW); delay(delayTime); } } Creating the Keywords and Readme files Inside the myFirstLibrary folder, save two blank text documents, keywords and readme. It's within these two files that you will: Tell the Arduino IDE which words are 'important' so that it can highlight them when they're called in a program (not required, just good practice and makes debugging easier) Identify the library's revision number and what it does List the functions of the library The keywords file is the file that tells the IDE which words are important and should be highlighted. Two different types of keywords exist (KEYWORD1 -> Classes, KEYWORD2 -> Functions) and they should have a space between them. The keywords file for this library is shown below. The readme file should explain what the library does, it's revision number and the date it was last revised such that a user with no knowledge of the library could understand what it's used for and when it was last edited. myFirstLibrary KEYWORD1 on KEYWORD2 off KEYWORD2 flash KEYWORD2 Examples, Zipping and Including Now that all of the above is completed, the last thing to do is to create some examples so users have a working program that explains how to use the library's capabilities. Once you have a few examples sketches made, create a folder called examples within the myFirstLibrary folder and place them inside. Next, back out to the myFirstLibrary folder, right-click it and compress it into a .zip file. Finally, open the Arduino IDE and navigate to Sketch>Include Library>Add .ZIP Library. Find your zipped folder through its directory and you're done! Note: File>Examples>myFirstLibrary (you may need to scroll down) will take you to the examples found in the myFirstLibrary folder. This is Circuit 1 This is Circuit 2 If you have any problems along the way, please visit our Forum and we'll do what we can to get your library up and running!
Arduino 3-axis Mini Lazer Paper-Cutter: Updated : 16/3 Add step 4, about using the stage. Updated : 18/3 Add photos (cutting vinyl adhesive sheet) Updated : 19/3 Add step 5, acting as pen plotter Updated : 20/3 Add laser engraving video (Wood) and photo Updated : 22/3 Add 2 drawin…
Simple Multitasking in Arduino on Any Board: Update 6th Jan 2021 – loopTimer class now part of the SafeString library (V3+) install it from Arduino Library manager or from its zip file Update 15th Dec 2020 – Revised to use SafeString readUntilToken and BufferedOutput for non-blocking Serial I/…
Arduino OLED 128X64 IIC Serial Display: Printing Text and Moving Images: Have you bought yourself an OLED display for Arduino but don't know how to get started? Not as simple to use as you thought? Try this out! You'll learn to wire up your OLED display and communicate to it over serial (I2C). We're going to cover…
Arduino Fingerprint Lock: There is a short video for this Arduino fingerprint lock here: http://v.youku.com/v_show/id_XNjIxNzQyNzY4.html I live in a small apartment in Shenzhen with my …
The First Usage of ESP8266 With Arduino Uno: Today, I am going to show you that how can we prepare our module ESP8266 to be used with Arduino UNO. The need list: 1. Arduino UNO (With USB cable which attached to your computer via USB cable, also it will use it's voltage) 2. Your computer (If yo…
Arduino Programmable Open-Source Flight Controller and Mini Drone using SMT32 and MPU6050 for Drone Enthusiasts
How to set up an LCD display on an Arduino, with descriptions and examples of all of the functions available to program it.
Liste exhaustive des capteurs Arduinos et Raspberry and co : capteurs ultrason, infrarouges, pression, RGB, UV, capteur de gaz, de pluie , de température, accéléromètre, capteur piezo, capteur PIR, interrupteur tilt, cellule de charge, détecteur à effet hall, transducteur ultrason.... - La Fabrique DIY, premier site collaboratif de tutoriels DIY
How to Make Arduino Based Digital Tachometer Simple DIY Tutorial: Let see how to make Arduino based digital Tachometer. Working principle :- IR Sensor get penetrate by motion of motor shaft, signal are transfer from IR Senor module to Arduino. This signal are processed in Arduino according to code loaded on it.…
Blynk Arduino Multiple DS18B20 Thermometer Display on IOS or Android : This project uses the Blynk app on an iOS or Android device to display the values of several DS18B20 sensors.
Arduino Uno Menu Template: While working on a new Instructable (coming soon) I had decided to use an Arduino Uno with an LCD/button shield I purchased off of AliExpress. It's a knockoff of the DFRobot Shield. I knew that I needed a menu for my project but was becoming so disi…
The increased interest in IoT and electric automobiles around the world is driving an increase in...
UART, I2C and SPI are one of the most common and basic hardware communication peripherals that makers and electricians use in microcontroller development. Similarly, for the Arduino, they contain UART, I2C and SPI peripheral too.
An easy to set up and program digital weather station you can build for around $50
Here's the ultimate collection of 21 Arduino Modules that you can get for less than $2 on eBay. The Arduino community has created a wide variety of sensors, modules, and shields that allows you to easily create a wide variety of projects. Find out how the best and cheaper sensors for the Arduino and instructions.
DIY Arduino Geiger Counter: Hello everybody! How do you do? This is project How-ToDo my name is Konstantin, and today I want to show you how i made this Geiger counter. I started to build this device almost from the beginning of last year. Since then it has gone through 3 comp…
ESP8266 Weather Station With Arduino – #2 Software: This instructable is for the software of my Weater Station Project. Please read it first to understand all explanations. Because of the both MCUs the software concept is based on two parts: The ESP8266 runs on Nodemcu and does the Internet connecti…
In this project tutorial we’re going to build a super easy Arduino dice circuit. It’s a great learning project and one of the first project a lot of people new to the Arduinos or micro-controllers in general like to do because it is simple to understand. We’ve added a neat twist to our dice circuit […]
Past few month’s I’ve been researching and testing with LoRaWAN networks. After some good test results I decided to developed my own compact, fully Arduino compatible LoRaWAN Nod…
The ESP8266 combination microcontroller/Wi-Fi modules can now be programmed using the Arduino IDE. Here's how!
Parts List nRF24L01+ DS18B20 Temperature Sensor I2C LCD display 16×2 Arduino UNO 4.7k resistor Library nRF24L01 Library RF24 Library DallasTemperature Library LiquidCrystal_I2C Library Wire Library Wiring Wire nRF24L01+ to Arduino UNO GND GND VCC Arduino 3.3V CE Arduino pin 9 CSN Arduino pin 10 SCK Arduino pin 13 MOSI