Search the Community

Showing results for tags 'arduino'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Electronics Forums
    • Projects Q/A
    • Datasheet/Parts requests
    • Electronic Projects Design/Ideas
    • Power Electronics
    • Service Manuals
    • Theory articles
    • Electronics chit chat
    • Microelectronics
    • Electronic Resources
  • Related to Electronics
    • Spice Simulation - PCB design
    • Inventive/New Ideas
    • Mechanical constructions/Hardware
    • Sell/Buy electronics - Job offer/requests
    • Components trade
    • High Voltage Stuff
    • Electronic Gadgets
  • General
    • Announcements
    • Feedback/Comments
    • General
  • Salvage Area

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 16 results

  1. The very first program you write when you start learning a new programming language is: "Hello World!". The program itself does nothing more than printing a “Hello World” text on the screen. So, how do we get our Arduino to display the "Hello World!"? In this video, I will be showing you how to get started with the small 0.91 (128x32) and 0.96 (128x64) I2C OLED displays. There are 100s of tutorials on the web explaining the same thing in different ways, but I couldn't find one that tells me all about the OLED display and how to use it in different scenarios. It took me some time to work it all out. So, I thought I should create a tutorial on what I have learned and combine all the features and ways the OLED displays can be used in our projects. Step 1: Things We Are Going to Learn Today In this video we will be talking about: - What is an OLED display? - Then we will have a closer look at the 0.91 (128x32) and 0.96 (128x64) I2C OLED displays - Next we will talk about installing the Adafruit Library to your Arduino IDE - Then we will connect NodeMCU and Arduino to an OLED display - Next we will have a look at the code and display some graphics and text on it - We will also talk about applying Custom Fonts and displaying Images - Then we will connect Multiple OLEDs to a micro-controller using I2C Multiplexer - Finally, we will talk about few common errors people make while using the OLED displays Step 2: Hardware Requirement For this tutorial we need: - A Breadboard - A 0.91" (128x32) and 0.96" (128x64) I2C OLED displays - Arduino UNO/NANO (whatever is handy) - NodeMCU - TCA9548A I2C multiplexer - Few Connecting Cables - and a USB cable to upload the code Step 3: What Is an OLED Display? OLED or organic light-emitting diode is a light-emitting diode (LED) in which the emissive electroluminescent layer is a film of organic compound (millions of small LED lights) that emits light in response to an electric current. OLEDs are used to create digital displays in devices such as television screens, computer monitors, portable systems such as mobile phones, hand-held game consoles and PDAs. An OLED display works without a backlight because it emits visible light. There are many types of OLED displays available in the market based on their - Sizes - Color - Brands - Protocol - SPI (Serial Peripheral Interface) or I2C - Passive-matrix (PMOLED) or active-matrix (AMOLED) control scheme In this tutorial, I am going to talk about connecting the blue color 0.91 (128x32 OLED) and 0.96 (128x64 OLED) I2C OLDE displays to an Arduino NANO and NodeMCU. I2C bus technology uses only 2 pins of the MCU so we have heaps available for other sensors. Step 4: Closer Look Lets have a closer at these two displays. At the back of these displays there are heaps of SMD capacitors and resistors soldered on-board; but, since its an I2C device we only care about these 2 pins (SCL and SDA) The display connects to Arduino using only four wires – two for power (VCC and GND) and two for data (serial clock SCL and serial data SDA), making the wiring very simple. The data connection is I2C (I²C, IIC or Inter-Integrated Circuit) and this interface is also called TWI (Two Wire Interface). - The on-board pins can be in different order, so always triple check before hooking it up to your project. - Operation voltage is between 3v to 5v but, it is best to use the guidance from the manufacturer's datasheet. - Sometimes we need to use 2 displays in our projects. So, how can we achieve this? The trick is to have a configurable address on your display. This unit has a configurable address between 0x78 and 0x7A. Just by unsoldering the 0Ohm resistor from one side and hoking it up to the other side or just by putting a global solder we can change the address. We will talk about it in depth when we hook up multiple displays to an Arduino in the later section of this tutorial. In picture these displays look very big. But, practically speaking they are tiny. They are made of 128 x 32/64 individual OLED pixels and do not require any back-light. Just have a look at this and see how small it is. Even though they are small they can be very useful in any electronic projects. Step 5: Library There are several libraries available to control these displays. In past I have used the "u8glib library" but I find the AdaFruit library very easy to understand and use in our projects. So, I am going to use the AdaFruit library in this tutorial. To control the OLED display you’ll need the "adafruit_GFX.h" library and the "adafruit_SSD1306.h" library. There are two ways you can download and install the library to your Arduino IDE. Method 1 Go to the "Library manager" and search "adafruit_SSD1306" and "adafruit_gfx" Select the latest version and hit the Install button. Once installed you can use these libraries in your program. Method 2 These two libraries can be also be downloaded from github (you need both): I will provide the links in the description below. The display library: https://github.com/adafruit/Adafruit_SSD1306 The GFX library: https://github.com/adafruit/Adafruit-GFX-Library Once downloaded, copy the Adafruit_SSD1306-master folder from the downloaded zipped file into the Arduino libraries folder. This folder is usually found at Documents > Arduino > libraries on Windows systems. On Linux it is usually found at home folder > Arduino > libraries. Finally in the Arduino library folder, rename the Adafruit_SSD1306-master folder to Adafruit_SSD1306. Even if you don’t rename that’s fine. Now, lets have a look at the "Adafruit_SSD1306.h" file Two things we need to know in this library: 1. If you want to use the smaller display use the default 128_32 otherwise for the bigger display comment the 128_32 and uncomment the 128_64 2. If you have soldered the 0x7A Address on the board (which we will talk about later) then use the 7 bit 0x3D address for the bigger displays, otherwise use the default 0x3C address. For the smaller displays the address is 0x3C. Step 6: Wiring 128 X 64/32 OLEDs Lets start by connecting the NodeMCU to the display. The first and most important thing to note is that some of the displays may have the GND and VCC power pins swapped around. Check your display to make sure that it is the same as the image. If the pins are swapped, make sure to change the connections to the Arduino or NodeMCU. - NodeMCU OLED Wiring OLED VCC – NodeMCU 3.3V OLED GND – NodeMCU GND OLED SCL – NodeMCU D1 OLED SDA – NodeMCU D2 - Arduino Uno OLED Wiring OLED VCC – Arduino 5V OLED GND – Arduino GND OLED SCL – Arduino Uno A5 OLED SDA – Arduino Uno A4 - Arduino MEGA 2560 OLED Wiring OLED VCC – Arduino 5V OLED GND – Arduino GND OLED SCL – Arduino MEGA 2560 pin 21 OLED SDA – Arduino MEGA 2560 pin 20 Step 7: Code Adafruit library comes with really good examples for both 128x32 and 128x64 displays. The Library is located under File > Examples > Adafruit SSD1306 > and then the display type in the Arduino IDE. We are going to use the 128x32 I2C example and will modify it to work with both 128x64 and 128x32 displays fist by hooking it up to an Arduino and then to a NodeMCU board. The code starts by including both the Adafruit libraries. In this tutorial I am going to stress on only those parts of the code which are necessary for us to load on both boards and displays. If you want to know more about the code please drop a comment on my blog or in the comments section below and I endeavour to get back to you. - First we are going to load the code to an Arduino Nano connected to a 128x32 display. We can use the code as is without any modifications. 128x32 uses 0x3C address so this bit looks all good here, lets double check the header library, yes its also using the 0x3C address and the display type is 128x32. - Now lets connect the 128x64 display. As we know it uses the 0x3C address by default so we don't need to update the address in either the code or the library. We just need we need to comment the 128_32 and uncomment the 128_64 in the header library and change the LCDHEIGHT to 64 in our code. - Now to run the same code on a NodeMCU we need to change one more line in our code. The "#define OLED_RESET 4" > "#define OLED_RESET LED_BUILTIN" rest of the code is same as Arduino Pretty much to display anything we first need to clear the previous screen using display.clearDisplay(); // Clear the buffer Then draw the object testdrawline(); // Draw a line Show it on the hardware display.display(); // Make them visible on the display hardware! Wait for some time before displaying the next item. delay(2000); // Wait for 2 seconds In this example we are displaying few items like text, lines, circles, scrolling text, triangles and more. Go ahead and use your imagination and display whatever you want on these tiny displays. Attachments Libraries.zip Download NodeMCU.zip Download Step 8: Customizing Text & Adding Images Sometimes your code needs to display custom fonts and images. If you are very good in bit mapping then you just need to create a byte arrays by turning on or off the tiny LEDs of the display to create custom fonts and images. However, I am not very good in doing these mappings and don't want to spend hours creating the bit map tables. So, what are my options? I generally use two websites to generate custom fonts and images. The links are provided in the description below. Custom Fonts ------------ Go to the font converter website, select the font family, style, size, Library Version as "Adafruit GFX Font" and then hit the "Create" button. On the right hand side of this page you can see how your font is going to look like on the actual display. Based on your selection the webpage generates the fonts header file. Create a file called "modified_font.h" in the same folder where your code is and copy and save the generated code into it. Then you just need to include the header file in your code to use the custom font. #include "modified_font.h" Then, you just need to set the font before displaying the text to apply the custom font to it. display.setFont(&Your_Fonts_Name); You can get the name of the font from the header file you just added to your project. Thats it, easy. Memory is always a concern while using custom fonts, so always consider the bytes that will be consumed by the memory. Just remember Arduino UNO has only 32K of memory. Custom Images ------------- To display a bitmap image on your screen you first need to create a 128 x 64/32 sized image. I am using the good old "MS Paint" to create a 128 x 64 bitmap image which I will then upload to this image converter website. The website converts images into byte-strings, which can be used with Arduino and OLED displays. Start by uploading the image to the website. Then put a check on the "Invert image colors" check-box and change the "Output code format" to "Arduino Code" next select the orientation and hit the "Generate Code" button to generate the byte array. The "Preview" section shows you how your image will look like on the actual display. I have included the code along with this tutorial which you can use to display your images. You just need to replace the array in my code with the one you just generated and then load it to your Arduino. Attachments Custom_Font.zip Download Custom_Image.zip Download Step 9: Connecting 2 Displays Connecting two 128 x 64 displays to your project is easy. You just need to unsolder the 0Ohm resistor from 0x78 address and put it on 0x7A and then use the 0x3D address in your code instead of the default 0x3C. You must be wondering why we are using the 0x3C and 0x3D address and not the actual 0x78 and 0x7A. Arduino accepts 7-bit address and not the 8-bit hardware addresses. So, we first need to convert the 8-bit address to binary, and then chop off the least significant bit to get the 7 bits. Then convert the 7 bits to HEX to get the 0x3C or 0x3D addresses which you enter in your code. First, initialize the display by giving it a unique name: Adafruit_SSD1306 display1(OLED_REST); Adafruit_SSD1306 display2(OLED_REST); Then in your code use the display 1 and display 2 to call the begin statements with the device addresses in them: display1.begin(SSD1306_SWITCHCAPVCC, 0x3C); // display 1 op address 0x3C display2.begin(SSD1306_SWITCHCAPVCC, 0x3D); // display 2 op address 0x3D That's it, you can now go ahead and do whatever you want using either Display 1 or Display 2 in the rest of your code. I have provided an example with this tutorial. Wiring is exactly the same as what we have done before, pretty much you just need to add another display to the same I2C pins of either the Arduino or NodeMCU. Based on the addresses, the MCU then sends the data on the I2C data line. Attachments Two_OLEDs.zip Download Step 10: Connecting More Than 2 Displays 3 More Images Now, what if you want to hook up more than 2 displays? Arduino has limited number of pins and hence you cannot have more than a certain amount of shields attached to it. Moreover, it has only one pair of I2C buses. So, how can we attach more than 2 I2C displays to an Arduino? The trick is to use a TCA9548 Multiplexer. TCA9548 allows a single micro-controller to communicate with up to '64 sensors' all with the same or different I2C address by assigning a unique channel to each sensor slave sub-bus. When we talk about sending data over 2 wires to multiple devices we then need a way to address them. Its same as the postman coming on a single road and dropping the mail packets to different houses because they have different addresses written on them. The Multiplexer connects to 3V3, GND, SDA and SCL lines of the micro-controller. The slave sensors are connected to one of eight SCL/SDA slave ports on the board. The channels are selected by sending the TCA9548A its I2C address (0x70 {default} - 0x77) followed by the channel number (0b00000001 - 0b10000000). You could have at the max 8 of these multiplexers connected together on 0x70-0x77 addresses in order to control 64 of the same I2C addressed parts. By connecting the three address bits A0, A1 and A2 to VIN you can get different combination of the addresses. I will explain this in-depth in my next tutorial on TCA9548A breakout board. For now, lets just hook up 8 OLEDs to this board and have a quick look at the code. Connection: VIN to 5V (or 3.3V) GND to ground SCL to I2C clock SDA to I2C data Then wire up the sensors to VIN, GND and use one of the SCn / SDn multiplexed buses Now, Int the code lets start by including the "Wire" library and by defining the multiplexers address. #include "Wire.h" #include #define MUX_Address 0x70 // TCA9548A Encoders address Then we need to select the port we want to communicate to and send the data on it using this function: void tcaselect(uint8_t i) { if (i > 7) return; Wire.beginTransmission(MUX_Address); Wire.write(1 << i); Wire.endTransmission(); } Next we will initialize the display in the setup section by calling "u8g.begin();" for each display attached to the MUX "tcaselect(i);" Once initialized, we can then do whatever we want just by calling the function "tcaselect(i);" where "i" is the value of the multiplexed bus and then sending the data and clock accordingly. Attachments I2C_Port_Scanner.zip Download Multipe_OLEDs.zip Download Step 11: Advantages and Disadvantages The image of an OLED is beautiful. However, OLEDs also have disadvantages. Because OLED screens contain organic material, their lifespan is shorter than LCD displays. Additionally, many OLED displays get burn-ins after showing the same image for a long time. After a burn-in, the image stays on the screen even after showing another image. So make sure you keep refreshing the screen every few seconds. Water can instantly damage the organic materials of these displays. Advantages No need for a backlight Displays are very thin and lightweight Low power consumption Viewing angles are wider than LCDs Brightness and contrast are great High speed and have low response time Deep black color Disadvantages Costly technology Short lifecycle OLEDS are more likely to burn-in Water damage Step 12: Common Errors To conclude the tutorial lets talk about few common errors people make while using these displays: - Always triple check the pins before using it in your project - Pick up the right library address in the header file and in your code #define SSD1306_I2C_ADDRESS 0x3C // in Adafruit_SSD1306.h and display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // in your code If the address is wrong the OLED will not display anything - The display size must be changed in the driver before it can be used. If it is not changed you will get an error message when attempting to verify the code #error ("Height incorrect, please fix Adafruit_SSD1306.h!"); - If using NodeMCU make sure you replace the OLED_RESET from 4 to LED_BUILTIN #define OLED_RESET LED_BUILTIN I have scene people making all sorts of things using this OLED display. Some have even made video games and all. I am really not interested in making a video game using this tiny display. However, I will now leave you to explore your imaginations and come out with amazing ideas. - Blog: http://diyfactory007.blogspot.com.au - Add Image: http://javl.github.io/image2cpp/ - Custom Text: http://oleddisplay.squix.ch/#/home - Adafruit display library: https://github.com/adafruit/Adafruit_SSD1306 - Adafruit GFX library: https://github.com/adafruit/Adafruit-GFX-Library - u8glib library: https://code.google.com/archive/p/u8glib/ or https://github.com/olikraus/u8glib If you want to use the smaller display use the default 128_32 otherwise for the bigger display comment the 128_32 and uncomment the 128X64 NO_ACK in your code (just uncomment the type of screen you are using) (fonts are in the fonts library) Attachments DataSheets.zip Download LCD-U8glib.zip Download OLED_Graphing.zip Download Schema.zip Download
  2. Introduction ---------------- Hi Friends, I am back again with another Arduino based home automation project. This time I am trying to make my partner's life easy by installing a collision avoidance system in the garage to help her park the car safely without hitting the garage wall. So, in this video, I am going to use an ultrasonic sensor to calculate the car's distance from the garage wall and display it using green, yellow and red LEDs. The color of LEDs indicates whether to keep moving, slow down, stop or go back. The total cost of the project is around $20 - $25. Step 1: Logic The project has 3 phases Phase 1: Waiting for the car In this phase the device keeps looking for a moving object within the sensors proximity. If an object enters the proximity then one of the three LEDs turns on based on how far the moving object is. If the object is way too close, then a noise is made to make the moving object aware of the distance. Phase 2: No car in the garage If there is no object in the proximity then turn off all the LEDs. Phase 3: The car has stopped moving (Parked in the right spot) If the object has stopped moving and is still in the proximity wait for 20 CPU cycles and then turn off the LEDs. Step 2: Hardware Requirement For this very simple project we need: - A Perfboard - An Arduino nano/uno (whatever is handy) - A Red, Green and a Yellow LED (Light Emitting Diode) - 3 x 220ohm resistor for the LEDs - One HC-SRO4 Ultrasonic Sensor - A Buzzer shield or A buzzer and a 100 ohm resistor - A 220v AC to 5v DC Buck step-down module - One Female Pin Header Strip - An Ethernet cable - Some connecting cables - A USB cable to upload the code to the Arduino - and general soldering equipments Step 3: Assembly Let start by connecting the LEDs to the board. Connect the Red LED to pin D2, Yellow LED to D3 and the Green LED to D4 of the Arduino by putting in a 220ohm resistor between the Arduino board and the LEDs. Now lets connect the Buzzer to analogue pin A0. Next, connect the Trig pin of the Ultrasonic Sensor to D5 and the Echo pin to D6 of the Arduino. Once all the modules are connected to the Arduino board, its time for us to connect all the positive and negative pins together. Connect all the positive pins of the modules to the +5v supplied by the Buck Step-Down Module and the negative pins to the -ve terminal of the Module. That's it, we can now upload our sketch to the board. In this assembly I am using 3 LEDs to display the distance, however you can replace the 3 LEDs with a RGB LED, or you can also use an array of LEDs like an audio level indicator to display the movement of the car. Step 4: My Setup OK now lets see what I have made. I have installed the Arduino, buzzer, the ultrasonic sensor and the three 220 ohms resistors on one Perfboard. The 3 LEDs and the power module is installed on a second Perfboard. I will be covering the LEDs with a translucent cover to give it a nice look. The 220v power supply will be connected to the screw terminal block. The base unit will then be connected to the LEDs and the power supply with an Ethernet cable. Step 5: The Code int trigPin = PD5; // Sensor Trip pin connected to Arduino pin D5 int echoPin = PD6; // Sensor Echo pin connected to Arduino pin D6 int redLED = PD2; // Red LED connected to pin D2 int yellowLED = PD3; // Yellow LED connected to pin D3 int greenLED = PD4; // Green LED connected to pin D4 int buzzer = A0; // Buzzer connected to Analogue pin A0 long TempDistance = 0; // A variable to store the temporary distance int counter = 0; // Counter value to check if the object has stopped moving void setup() { Serial.begin(9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(redLED, OUTPUT); pinMode(greenLED, OUTPUT); pinMode(yellowLED, OUTPUT); pinMode(buzzer, OUTPUT); } void loop() { long duration, Distance; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); Distance = (duration/2) / 74; // Distance in Inches if(counter < 20){ // Do the rest if the car is still moving if (Distance > 200) { // Nothing in the garrage turnThemAllOff(); } if ((Distance > 55) && (Distance <= 200)) { // Turn on Green LED digitalWrite(greenLED, HIGH); digitalWrite(yellowLED, LOW); digitalWrite(redLED, LOW); noTone(buzzer); } if ((Distance > 15) && (Distance <= 55)) { // Turn on Yellow LED digitalWrite(yellowLED, HIGH); digitalWrite(redLED, LOW); digitalWrite(greenLED,LOW); noTone(buzzer); } if (Distance <= 15) { // Turn on Red LED digitalWrite(redLED, HIGH); digitalWrite(greenLED,LOW); digitalWrite(yellowLED, LOW); noTone(buzzer); } if (Distance < 8) { // Item is way to close - start the buzzer tone(buzzer, 500); } } if ((Distance == TempDistance) || ((Distance+1) == TempDistance) || ((Distance-1) == TempDistance)){ if(counter >= 20){ // Turn off the lights if the object hasn't moved for 20 cycles (no change in distance) Serial.println("No movement detected, turning off the lights"); turnThemAllOff(); } else { counter++; } } else { counter = 0; // Reset counter if there is a movement } TempDistance = Distance; Serial.print(Distance); Serial.println(" inches"); Serial.print("Counter : "); Serial.println(counter); delay(500); } // Function to turn the LEDs off void turnThemAllOff(){ digitalWrite(redLED, LOW); digitalWrite(greenLED,LOW); digitalWrite(yellowLED, LOW); noTone(buzzer); } Start the code by defining the constants and the global variables that will be used throughout the code. Then define the pin modes in the setup section of the code. Then create a function to turn off all the LEDs and the buzzer. Now, calculate the "Distance" in inches by reading the values received from the Ultrasonic Sensor. Then by checking the value of the "Distance" we will turn on and off the LEDs based on how far the object is. If the distance is greater than 200 then turn off all the LEDs and the buzzer as the object is out of range. Else if it is between 55 and 200 then turn on the green LED. If the object is between 15 and 55 then turn on the yellow LED, and if the object goes closer than 15 inches then turn on the red LED until it reaches 8 inches. When the distance becomes less than 8 start the buzzer along with the red LED. Next bit of the code is to set the value of the counter based on the cars movement which then decides when to turn off the LEDs. It compares the value of "Distance" with the "TempDistance" and if the values are same (object hasn't moved) then increments the counter. If the object moves any-time during this process the counter is reset to 0. Finally the "TempDistance" is set to the value of "Distance". Just before comparing the Distances we also need to check if the counter value has exceed 20. I am doing this to stop the below code from executing if the car is in a steady position. Lastly we just need to add a small delay to our sketch to pause the code for a while. Step 6: Quick Demo So this is how I have installed the unit in my garage. As I walk close to the sensor the light changes from green to yellow to red and ultimately the buzzer goes on when I am too close to the sensor. In my case I have installed the buzzer next to the Arduino however I will recommend you to install the buzzer along with the LEDs. If you want you can also flash the red LED when the buzzer goes on. So now, my partner can park the car easily without making any assumptions. Doesn't matter how many times she fail her driving test she is not going to break my wall (even when she is drunk). Not that I am asking her to drive when she is drunk (just kidding). Thanks again for watching this video! I hope it helps you. If you want to support me, you can subscribe to my channel and watch my other videos. Thanks, ca again in my next video.
  3. Hi Everyone, In this tutorial I am going to show you how to charge a Lithium 18650 Cell using TP4056 chip utilizing the solar energy or simply the SUN. Wouldn’t it be really cool if you can charge your mobile phones battery using the sun instead of a USB charger. You can also use this project as a DIY portable power bank. The total cost of this project excluding the battery is just under $5. The battery will addup another $4 to $5 bucks. So the total cost of the project is some what around $10. All components are available on my website for sale for really good price, the link is in the description below. Step 1: Hardware Requirement For this project we need: - A 5v Solar Cell (make sure it is 5v and not anything less than that) - A general purpose circuit board - A 1N4007 High Voltage, High Current Rated Diode (for reverse voltage protection). This diode is rated at forward current of 1A with peak reverse voltage rating of 1000V. - Copper Wire - 2x PCB Screw Terminal Blocks - A 18650 Battery Holder - A 3.7V 18650 Battery - A TP4056 battery protection board (with or without the protection IC) - A 5 V power booster - Some connecting cables - and general soldering equipments Step 2: How the TP4056 Work Looking at this board we can see that it has the TP4056 chip along with few other components of our interest. There are two LEDs on board one red and one blue. The red one comes on when it is charging and the blue one comes on when the charging is done. Then there is this mini USB connector to charge the battery from an external USB charger. There are also these two points where you can solder your own charging unit. These points are marked as IN- and IN+ We will be utilizing these two point to power this board. The battery will be connected to these two point marked as BAT+ and BAT- (pretty mush self explanatory) The board requires an input voltage of 4.5 to 5.5v to charge the battery There are two versions of this board available in the market. One with battery discharge protection module and one without it. Both boards offer 1A charging current and then cut off when finished. Furthermore, the one with protection switches the load off when the battery voltage drops below 2.4V to protect the cell from running at too low (such as on a cloudy day) - and also protects against over-voltage and reverse polarity connection (it will usually destroy itself instead of the battery) however please check you have it connected correctly the first time. Step 3: Copper Legs These boards gets really hot so I will be soldering them a bit above the circuit board. To achieve this I am going to use a hard copper wire to make legs of the circuit board. I will then be sliding the unit on the legs and will solder them all together. I will put 4 copper wires to make 4 legs of this circuit board. You can also use - Male Breakable Pin Headers instead of the copper wire to achieve this. Step 4: Assembly The assembly is very simple. The solar cell is connected to the TP4056 battery charging board's IN+ and IN- respectively. A diode is inserted at the positive end for the reverse voltage protection. Then the BAT+ and BAT- of the board is connected to the +ve and -ve ends of the battery. (That all we need for charging the battery). Now to power an Arduino board we need to boost up the output to 5v. So, we are adding a 5v voltage booster to this circuit. Connect the -ve end of the battery to the IN- of the booster and +ve to IN+ by adding a switch in between. OK, now lets have a look at what I have made. - I have connected the booster board straight to the charger however I will recommend putting a SPDT switch there. So when the device is charging the battery its only charging and not getting used Solar cells are connected to the input of the lithium battery charger (TP4056), whose output is connected to the 18560 lithium battery. A 5V step-up voltage booster is also connected to the battery and is used to convert from 3.7V dc to 5V dc. Charging voltage is typically around 4.2V. Voltage booster's input ranges from 0.9 to 5.0V. So it will see around 3.7V at it's input when the battery is discharging, and 4.2V when it's recharging. The output of the booster to the rest of the circuit will keep it's 5V value. Step 5: Testing This project will be very helpful to power a remote data logger. As we know, the power supply is always a problem for a remote logger and most of the times there is no power outlet available. A situation like that forces you to use some batteries to power your circuit. But eventually, the battery will die. Question is do you want to go there and charge the battery? Our inexpensive solar charger project will be an excellent solution for a situation like this to power an Arduino board. This project can also solve the efficiency issue of Arduino when in sleep. Sleep saves battery, however, the sensors and power regulators (7805) will still consume battery in idle mode draining the battery. By charging the battery as we use it, we can solve our problem. Thanks again for watching this video! I hope it helps you. If you want to support me, you can subscribe to my channel and watch my other videos. Thanks, ca again in my next video. TP4056.pdf
  4. Introduction --------------- Hi Everyone, This is my 1st Arduino's tutorial video. In this video i am going to show you how to use a LDR or Light Dependent resistor to turn on and off another circuit or a LED. Wouldn’t it be really cool if whenever a room gets dark, a light bulb automatically turns ON and eliminates the darkness? In this very simple project, I am focusing on eliminating darkness. You can even use this as an emergency lighting system. Step 1: Principle The LDR is a special type of resistor which allows a lower voltage to pass through it (high resistance) whenever its dark and higher voltages to pass (low resistance) whenever there is a high intensity of light. We are going to use a 10k resistor along with the LDR to create a voltage divider circuit. The varying resistance of the LDR is converted to a varying voltage that the analog pin of the Arduino will then be using in its logic. Step 2: Harware Reqirement For this very simple DIY Arduino project we need: - a breadboard - an arduino uno/nano (whatever is handy) - LED (Light Emitting Diode) - LDR (Photoresistor) - A 10K Resistor for creating the voltage divider and a 220ohm resistor for the LED - Few breadboard friendly connecting wires - and a USB cable to upload the code to the Arduino Step 3: Assembly - Connect the 3.3v output of the Arduino to the positive rail of the breadboard - Connect the ground to the negative rail of the breadboard - Place the LDR on the breadboard - Attach the 10K resistor to one of the legs of the LDR - Connect the A0 pin of the Arduino to the same column where the LDR and resistor is connected (Since the LDR gives out an analog voltage, it is connected to the analog input pin on the Arduino. The Arduino, with its built-in ADC (Analog to Digital Converter), then converts the analog voltage from 0-5V into a digital value in the range of 0-1023). - Now connect the other end of the 10K resistor to the negative rail - And the the second (free) leg of the LDR to the positive rail Pretty much this is what we need for the light sensing. Basic circuits like this can be done without an Arduino aswell. However, if you want to log the values and use it to create charts, run other logics etc. I will recomend an Arduino or ESP8266 or may be a ESP32 for this. Now, as we want our circuit to do something in the real world other than just displaying the values on the computer screen we will be attaching a LED to the circuit. The LED will turn on when its dark and will go off when its bright. To achieve this we will: - Place the LED on the breadboard - Connect the 220ohm resistor to the long leg (+ve) of the LED - Then we will connect the other leg of the resistor to pin number 13 (digital pin) of the Arduino - and the shorter leg of the LED to the negative rail of the breadboard Step 4: The Code const int ledPin = 13; const int ldrPin = A0; void setup() { Serial.begin(9600); pinMode(ledPin, OUTPUT); pinMode(ldrPin, INPUT); } void loop() { int ldrStatus = analogRead(ldrPin); if (ldrStatus <= 200) { digitalWrite(ledPin, HIGH); Serial.print("Its DARK, Turn on the LED : "); Serial.println(ldrStatus); } else { digitalWrite(ledPin, LOW); Serial.print("Its BRIGHT, Turn off the LED : "); Serial.println(ldrStatus); } } Thanks again for watching this video! I hope it helps you. If you want to support me, you can subscribe to my channel and watch my other videos. Thanks, ca again in my next Instructable.
  5. Hi,I have created a isolated version of the common USB - UART converter for programming the Arduino mini.It have all the communication pins isolated: DTR, TX, RX and also CTS.This little board can be very useful if you are working on some projects and worrying to damage a USB port because of ground loop or a short circuit with the main power supply.Here our campain: https://www.kickstarter.com/projects/1351830006/isolated-usb-to-uart-converter-for-arduino-pro-min?ref=user_menuWe also made a short video: https://www.youtube.com/watch?v=ReD4d7x2PaoThanks!
  6. Hello Everyone,We are pleased to announce the launch of our online store - Mynics.All of you are requested to check the website and do give us your valuable feedback.You can do the following at Mynics.in- Shop for electronics and robotics- Blogs- Forums- Projects and VideosWe are soon rolling out some great competitions and offers, do follow us to stay updatedhttps://www.facebook.com/mynics.in/http://stalkture.com/p/mynicsinsta/4934651665/https://plus.google.com/104613178419222567531Time to show your creativity and leave the rest to Mynics.Cheers,Team Mynics.
  7. HI CAN I USE 12V 2A DC POWER ADAPTER FOR MY ARDUINO UNO ?IS THEIR ANY LIMITATION FOR CURRENT???
  8. Hi all, I found a ver very good and really cheap pcb service! Its called PCBWay, and they have cheap 2layer 10x 10x10cm pcb for just $5! and shipping to the Netherlands was just $7!(china post) And they have real good and very kind customer service witch reply back very fast and every question i had got answered in not time AND they give you $5 free for your first order! Pcb's look good and came fast. All pcb's where exported with eagle. I got 2 extra pcb's(win win) probably if a pcb fails check or something. I used blue silkscreen with white text for the pcb and also bought some project pcb's with holes wich i got in 5 collors and look absolutly great! The blue silkscreen looks absolutly perfect, its really perfectly alligned! and the text looked good, it looked a little bit blocky but still it looks great! I ordered pcb's for a adafruit solar charger clone as i needed 9 of them and just didnt have the money to buy them. Since i already had all the components i needed exept the pcb's i just bought the pcb's since their charger is opensource and created them my self to save some costs.(i'll probable sell the last one i dont need) At first i thought if i had to buy the comonents also it all would be more expensive but i calculated if i wanted to create 10 solar chargers and bought all components from aliexpress and bought the pcbs from pcbway i save around $30 to my suprise!!!!!(first time self build a product is cheaper then buying) The chargers are for my solar powered raspberry pi zero powered wireless timelapse and livestream camera's, witch will be mounted in my backyard pointing at bird homes and one as security camera for my back yard gate to watch intruders. I already finished one of the charger and it looks really really impressive with the blue silkscreen! I'll maybe upload some pics of my assembled pcb's and bare pcb's soon for other peaple to check and i am probably going to clone the adafruit powerboost 1000 charger too!(because its cheaper offcourse, i still bought a lot of products from adafruit so i am still supporting them). The pcb's are of good quality, no broken or half traces, all boards are straight and not bend, all boards got the silkscreen and white text right so they just look amazing! I really really recommend this service to everyone and i am defenitly going to try their 4 layer too some time!! And they also offer cheap assembly services so maybe i will try that sometime too! Since i am very very and very happy with my pcb's i am defenitly buying from them again and again in the future and recommend them to everyone! So now i want to know who else used this service and had good experience or wants to try it out? hope to hear from you all!
  9. Hi guys,Lovely community here. So i got into the bandwagon of the ESP32. I am planning to build an entire data acquisition built around the ESP32. Would really appreciate it much if i were to get help from all of you. It would be a learning experience for all of us. So basically here are my project details and list of components being used.A 32 Channel Data acquisition system with 30 sensors measuring strain (momentarily using a metal gage strain sensor of 120Ohm being fed to a quarter bridge circuit) and 2 temperature sensors(PT100). I would like an acquisition speed of atleast 1000Samples/Sec per channel. So here is my idea as of now.32 Sensors connected to its each wheatstones bridge. The amplifier is done using the XR18910/XR10910, which is a 16:1 bridge Mux interface with selectable gain. I have attached link https://www.exar.com/content/document.a ... rt=XR10910The XR18911 can be controlled via I2C link. it does all the amplification necessary. I will need to use 2 XR10910 or 4 XR18911(8:1 sensor interface). And then finally controlled by our LEGENDARY ESP32 which converts the analog data to digital. and with the help of wifi to transmit it to a computer where it can be collected in an excel file along with time of capture.Could you guys kindly help me out on how i am to proceed with programming of the ESP32. I would really prefer to use Arduino IDE guys, as that seems to simplify things. Also if there is any improvements that could be added to the circuit. Kindly let me know. Please let me know if you need more details(Picture attached). Thank you
  10. Hi, I've been working on replacing the two 10k potentiometers for voltage and current control with two rotary encoders. The idea is to get (theoretically) arbitrarily fine control via software on an ATMega328P microcontroller. The microcontroller would also be in charge of outputting desired and measured voltage and current values to an LCD. Since I haven't found any suitable digital potentiometers I figured I'd simply generate the analog voltages for the non-inverting inputs of U2 and U3. U2 gets a voltage between 0 and 10V using the uC's PWM output, a low pass filter and an op amp. Points 5 and 10 are connected with a 10k resistor. This part is working brilliantly so far. However current limit control is giving me some trouble. Again points 6 and 11 are connected with a 10k resistor and the non-inverting input of U3 is fed with an analog voltage between 0 and 1.4V (again via PWM and low pass filter). To test the setup I shorted the outputs of the supply with my multimeter, turned up the voltage to about 10V and then slowly increased the current limit. Seemingly at random one of the following scenarios occurs: The current limit increases way too fast (the microcontroller sends the signal for .5A but the multimeter already reads 3A) The current limit increases fairly accurately as it should. The current limit gets stuck and then goes haywire at some 16A and Q4 lets the magic smoke out. Am I wrong in thinking I could generate U3's input voltage isolated from points 6 and 11? If I'm not just being stupid somewhere else my suspicion is that my approach kills some vital feedback path... I'd appreciate any input, thanks!
  11. Hello friends, hope you all are fine and having fun with your lives. In today’s post we are gonna have a look at How to use Temperature Sensor 18B20 in Proteus ISIS. I will use Arduino board as a microcontroller and will connect the temperature sensor with it and then will display the code on LCD. I have already posted the same tutorial in which I have done Interfacing of Temperature Sensor 18B20 with Arduino but in that project I have used the real components and designed the hardware. But today, I will just show you the simulation so that you could test the simulation first and then design it in hardware. Temperature Sensor 18B20 is the most commonly used temperature sensor. Its a one wire sensor means it sends data through a single wire and we can connect multiple sensors with a single wire, that’s why its quite efficient and easy to use as well. I have also posted a tutorial on How to Interface LM35 sensor with Arduino in Proteus ISIS which is another temperature sensor so give it a try as well and let me know which one you think is better. Anyways let’s get started with temperature sensor 18B20 in Proteus ISIS. HOW TO USE 18B20 IN PROTEUS ISIS First of all, get these components from Proteus components list as shown in below figure: Now design the circuit as shown in below figure: As you can see in above simulation, we have used Arduino UNO board along with LCD and 18B20 temperature sensor. 18B20 in Proteus can’t detect the real temperature but we can change the temperature by pressing + and – buttons. So, now we have interfaced the temperature sensor and the LCD with Arduino. Next we are gonna design the code for Arduino and will upload it in Arduino baord. Note: If you don’t know How to use Arduino in Proteus then read Arduino Library for Proteus. You should also read How to get Hex File from Arduino, as Arduino software doesn’t generate the hex file. Now download these three libraries, one is “one wire” library which is the protocol for 18B20 temperature sensor, next is the Dallas Temperature sensor library which is the actua library for temperature sensor 18B20 and uses one wire library. Third library is the Crystal LCD library which is used for displaying character on LCD. So, download all these three libraries by clicking on below buttons and then paste them in your libraries folder of Arduino software. Download One Wire LibraryDownload Dallas Temperature LibraryDownlaod Liquid Crystal Library Now after adding these libraries, open your Arduino software and paste the below code into it. #include &lt;OneWire.h&gt; #include &lt;DallasTemperature.h&gt; #include &lt;LiquidCrystal.h&gt; #define ONE_WIRE_BUS 6 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&amp;oneWire); LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup(void) { Serial.begin(9600); Serial.println("Welcome to TEP !!!"); Serial.println("www.TheEngineeringProjects.com"); Serial.println(); sensors.begin(); lcd.begin(20, 4); lcd.setCursor(5,0); lcd.print("Welcome to:"); lcd.setCursor(1,2); lcd.print("www.TheEngineering"); lcd.setCursor(4,3); lcd.print("Projects.com"); delay(5000); } void loop(void) { sensors.requestTemperatures(); Serial.print("Temperature : "); Serial.println(sensors.getTempCByIndex(0)); //lcd.clear(); lcd.setCursor(0,0); lcd.print("Temperature: "); lcd.print(sensors.getTempCByIndex(0)); lcd.print("C"); delay(1000); } Now get your hex file from Arduino and upload it to your Proteus Arduino board and hit the RUN button. If everything goes fine then you will something like this at the start: After a delay of around 5 sec you will start receiving the Temperature sensor 18B20 values on your LCD as shown in below figure: Now you can see the value shown in the temperature sensor is the same as in LCD. So, now by clicking the + and – buttons on temperature sensor, you can increase and decrease the value of temperature and same will be changed in LCD. That’s how you can do simulation of Temperature sensor 18B20 in Proteus ISIS. Its quite simple and easy to use. That’s all for today, hope you get some knowledge out of it.
  12. Are u looking for a way to connect the Arduino to the internet easily? Do you want to develop your IoT project quickly without much hassle? ARMA IoT might just be the thing for you! The simple and efficient Arduino shield is powered through a esp12f wifi module, which enables it to be connected to the wifi network. it also has an SD card slot for for extra data storage like its wired brethren the Ethernet Shield. The ARMA IoT goes a step further and provides an easy plug and play feature for most of the common devices such as sensors, motors, LCDs and relays. The ARMA IoT is a great place for beginners to start their IoT project, as it requires minimum time to setup the hardware all thanks to the plug and play feature. Even the programming is simplified through the help of apps such as Blynk, which provides easy feature of controlling the Arduino through your Android or iOS phone. Thingspeak an upcoming IoT platform is also supported by the shield. The ARMA IoT platform proves as a tool for aspiring beginners and also a prototyping tool for advanced users. IoT products can be developed much faster with the help of this board. Weather it is creating a simple IoT project such as blinking LEDs or controlling relays, or developing your own Home automation system, the ARMA IoT facilitates it all and things seem to happen rather quickly with all the features provided on the board. The wifi connection feature can provide fast communication between devices or two instances of ARMA itself, making it applicable for simple swarm robotics, wireless controllers etc. The applications can also be extended to simple robotics, Energy management systems and it does not stop there as it all depends upon the users creativity. To get started simple tutorials are provided on the YouTube page of ARMA IoT, the link below guides on the setup of Arduino and ARMA IoT with the help of Blynk app More tutorials and projects will be posted to help you make the most of the shield. Of Course there are also various DIY communities that can provide you with both support and inspiration for your upcoming IoT projects. thus ARMA is another simple board that has the ability to bind many devices together. The ARMA IoT is still undergoing a crowdfunding campaign in Indiegogo and is available for pre-order. https://www.indiegogo.com/projects/arma-iot-breakout-board-for-arduino#/
  13. jack-chen

    Simple Wav Player Using Arduino

    Integrated with the homemade low-pass filter, this Arduino-based simple WAV player is to send out PWM signal generated by UNO, then through the low-pass filter and make the PCM data stored in the flash of UNO into sounds. Basically, the player cannot be regarded as a pure WAV playback, because by extracting the data from the WAV file and storing it in an array format in UNO, this tutorial is for reference. You can make SD card based WAV player by referring to this idea. The WAV player is easy to make on different platforms and applicable for various scenarios like voice broadcast system, electronic keyboard, as long as you understand the principle of sound. The hardware: 1.USB mini speaker 2.Digital push button 3.Freaduino UNO 4.4×6 cm universal board 5.Dupont line 6.Audio port more imformation >>>http://www.tenco-tech.com/article.php?id=94
  14. Linksprite-Yuki

    Yún – Wifi connection

    Starting with this post, you’ll find on my website a tutorial about the new Arduino Yun: I’m going to blog about my experiments with that board and show its features through real examples… today you’ll learn how to connect it to your wifi network! Yun and wifi One of the most useful features Arduino Yun has is the ability to connect to wired (Ethernet) or wireless networks without the needing of an external shield. I decided to supply my Yun using an external micro USB power supply (power supplies for modern cellphones works fine): By default, Arduino Yun acts as an access point, broadcasting an unprotected wifi network with Arduino Yun-xx SSID: After having established a connection, your PC obtains an IP address on the network 192.168.240.0/24: You can reach the administrative interface of Arduino Yun pointing a web browser to the address http://192.168.240.1. The default password is arduino: After having logged in, click on configure: You can change the board’s name (in the screenshot I chose Yun-Luca), the password, the timezone and connect the Yun to one of the wireless networks it detected: After a reboot, the board will be connected to your network! Upload via wifi Now you can use a new feature of Arduino Yun: the ability to upload a sketch using the network, without the needing to connect the board to your PC using a USB cable. Open the IDE (warning: you must download the latest version, at the moment I’m writing 1.5.4r2) and choose Arduino Yun as your board. The IDE will scan your network searching for Yun boards and, under the port menu, will display your board and its IP address: You can now compile and upload your sketch as usual… when the upload process will start, you’ll be prompted for the Yun password: SSH terminal You can also connect to your Yun in text mode, using an SSH client (for example PuTTY per Windows)… in the next posts you’ll discover why this can be useful: For more details,please refer to original post http://www.lucadentella.it/en/2013/11/05/yun-collegamento-alla-rete-wifi/
  15. Project with Arduino to share... I have tried to make a similar one befire, but it failed. Hope this article helps you like it helps me.
  16. I am quite new to Matlab, I heard that its quite easy to rotate servo to any precise angle using matlab. I have tried searching but not getting proper procedure, also tell me some good resources to learn Matlab?