Elektrik

  • Home
  • Privacy Policy
  • About
  • Related

Friday, 16 October 2015

Using Arduino as a simple Web Server along with Ethernet shield

 dvbot     03:00     arduino mega and uno, arduino web server, atmega328, ethernet shield, simple web server     No comments   

Using an Ethernet shield along with Arduino board you can turn it into a simple web server which can be accessed by anyone on the internet, and by accessing that server with a browser running on any computer connected to the same network as the Arduino board, you can:
  • Control hardware from the webpage like fan or lights (using Javascript buttons).
  • Read the state of a switch which can be either ON or OFF (using simple HTML).
  • Read value of a sensors connected to Arduino board (using simple HTML).


Arduino Board


atmega328 arduino web server http://lifestyle-facts.blogspot.com/

 

 

Ethernet Shield


http://elektriktech.blogspot.com/ atmega328 arduino web server http://lifestyle-facts.blogspot.com/

Hardware needed:





To use an Arduino Board as a Simple Web server, you need the following:

   DC Voltage of 5V from Arduino - To power the Ethernet Shield
    Ethernet shield - To connect with LAN
    Connection speed: 10/100Mb - For optimum performance.
    Connection with Arduino on SPI port

The Ethernet shield will connect the Arduino board to the Web or Internet. Setup is very simple, Just plug the header pins of the shield into your Arduino, then connect an Ethernet cable to the shield.  In the figure below, you can see an Arduino Mega with an Ethernet shield installed and connected with internet.

atmega18 arduino web server http://elektriktech.blogspot.com

atmega arduino web server http://elektriktech.blogspot.com

Now let's get to the working.

We will demonstrate how to use the Arduino as a Web server,  in the further experiment we will find how Arduino can show the state of a switch through sending information as a web server. Giving it's output in html pages

Components required:
  • 1 x Ethernet cable
  • 1 x Wi-Fi Router (Optional)
  • 1 x Arduino Mega2560 or Arduino UNO
  • 1 x Ethernet Shield
  • 1 x Breadboard or blank circuit board can do as well
  • 3 x Jumper Wires
  • 1 x 1k Resistor
  • 2 x 9VDC Adaptor
  • 1 x Push button

 Schematic

Wiring Diagram http://elektriktech.blogspot.com

 Connect the components as shown in the figure above. Pin 8 of the Arduino is connected to the Push button. This pin is configured as an INPUT, and when the button is pushed, the Arduino will read a HIGH value on this pin because the current will start flowing in this part. The Arduino will then set the status of the OUTPUT to ON on the webpage it hosts. When it is released, the output will be set to OFF. The status of the switch will available to the Web server as we need it.

Ethernet design

To control the Ethernet shield, you utilize the Ethernet.h library.

The shield must be allocated a MAC and IP address utilizing the Ethernet.begin() function. For a specific gadget, a MAC address is an all around extraordinary identifier. Current Ethernet shields accompany a sticker showing the MAC address. For more seasoned shields, an arbitrary one ought to work, however one should not utilize the same MAC address for many Ethernet Shields. Legitimacy of IP address relies on upon the arrangement of one's network. In the event that DHCP is utilized, it might dynamically assign an IP to the shield.

IP ADDRESS

IP address (Internet Protocol address) is a numerical name allotted to every gadget participating in a PC system that uses the Internet Protocol for correspondence. To indicate the IP address which is done inside the system. It is basic:

byte ip[] = { 192, 168, 0, 112 } and change it to match one own setup. For instance, if the switch's IP location is 192.168.0.60, and the scanner has 192.168.0.40, So I will allot the IP of Ethernet shield to 192.168.0.50 with the assistance of taking after order:

byte ip[] = { 192, 168, 0, 50 };

The initial three bytes ought to be same and it should not have similar IP address as any of other devices connect in same LAN.

MAC ADDRESS

MAC address (media access control location) is an exceptional identifier doled out to every gadget taking an interest in a physical system. Every bit of systems administration gear has an one of a kind serial number to recognize itself over a system and this is typical hard-modified into the hardware's firmware. In any case, with Arduino, we can characterize the MAC address our self.

byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x85, 0xD9 };

You can set the subnet and portal with the assistance of taking after charges:

byte subnet[] = { 255, 255, 255, 0 }; /allocating subnet veil

byte gateway[] = { 192, 168, 0, 1 }; /allocating entryway

Along these lines, to setup Ethernet Shield, the square of code is given below:

/********************ETHERNET SETTINGS ********************/

byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x85, 0xD9 }; /allotting MAC address

byte ip[] = { 192, 168, 0, 112 }; /ip in lan

byte subnet[] = { 255, 255, 255, 0 }; /allotting subnet mask

byte gateway[] = { 192, 168, 0, 1 }; /allotting default gateway

The following is a picture of the connection, demonstrating how the Arduino board unites with the Wi-Fi switch. The Ethernet link associate shield with the switch and switch then join remotely with the portable workstation. Or you can just connect the Ethernet shield directly to your home router or switch.

http://elektriktech.blogspot.com

Program
Below is the script that outputs HTML of a simple Web page.

client.println("<!DOCTYPE html>"); //web page is made using HTML

client.println("<html>");

client.println("<head>");

client.println("<title>Ethernet Tutorial</title>");

client.println("<meta http-equiv=\"refresh\" content=\"1\">");

client.println("</head>");

client.println("<body>");

client.println("<h1>A Webserver Tutorial </h1>");

client.println("<h2>Observing State Of Switch</h2>");

client.print("<h2>Switch is: </2>");

if (digitalRead(8))

{

client.println("<h3>ON</h3>");

}

else

{

client.println("<h3>OFF</h3>");

}


client.println("</body>");

client.println("</html>");

This program will display a web page on a Web browser when the IP address assigned to the Arduino is accessed.
The line:

client.println("<http-equiv=\"refresh\" content=\"1\">");

Educates the browser to refresh the page. At the point when the page is accessed once again, the Arduino will again read the switch's status and present it in the output.
Recall that, you can simply see the source code of the displayed Web page. On pushing the push button, you can watch the changing condition of the switch in the webpage.
You can likewise set this up to keep running without the switch. To do this you have to:
  1. Assign a manual IP address to the Arduino's Ethernet say 192.168.0.2 and Subnet mask 255.255.255.0 default Gateway empty.
  2. Use a cross-over Ethernet cable to link the two (laptop and Arduino).
  3. We should then be able to get your Arduino site up on http://192.168.0.2 from the laptop.
Below is the code that you would load into the Arduino to connect it directly to the PC without the router:


#include <SPI.h>
#include <Ethernet.h>


/******************** ETHERNET SETTINGS ********************/

byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x85, 0xD9 }; //physical mac address
byte ip[] = { 192, 168, 0, 112 }; // ip in lan
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
byte gateway[] = { 192, 168, 0, 1 }; // default gateway
EthernetServer server(80); //server port


void setup()
{
Ethernet.begin(mac,ip,gateway,subnet); // initialize Ethernet device
server.begin(); // start to listen for clients
pinMode(8, INPUT); // input pin for switch
}

void loop()
{
EthernetClient client = server.available(); // look for the client

// send a standard http response header

client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connnection: close");
client.println();

/*
This portion is the webpage which will be
sent to client web browser one can use html , javascript
and another web markup language to make particular layout
*/


client.println("<!DOCTYPE html>"); //web page is made using html
client.println("<html>");
client.println("<head>");
client.println("<title>Ethernet Tutorial</title>");
client.println("<meta http-equiv=\"refresh\" content=\"1\">");

/*
The above line is used to refresh the page in every 1 second
This will be sent to the browser as the following HTML code:
<meta http-equiv="refresh" content="1">
content = 1 sec i.e assign time for refresh
*/


client.println("</head>");
client.println("<body>");
client.println("<h1>A Webserver Tutorial </h1>");
client.println("<h2>Observing State Of Switch</h2>");

client.print("<h2>Switch is: </2>");

if (digitalRead(8))
{
client.println("<h3>ON</h3>");
}
else
{
client.println("<h3>OFF</h3>");
}

client.println("</body>");
client.println("</html>");

delay(1); // giving time to receive the data

/*
The following line is important because it will stop the client
and look for the new connection in the next iteration i.e
EthernetClient client = server.available();
*/

client.stop();

} 
 
Hope you liked this project. For more projects related to Arduino or any other electronic please message me or write them in the comments. 
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Thursday, 8 October 2015

Simple +-400Watt Amplifier using TDA7294 or TDA7293 + Power Transistors 2SC5200 and 2SA1943

 dvbot     00:47     powerful amplifier using tda7293 and tda7294 using extra transistors 2sc5200 and 2sa1943, transistor and chip amp hybrid     No comments   

This additional part can be added to the traditional chip amp made using TDA7294 or TDA7293 to gain extra power in output.
The traditional chip amp produces about 40-50watt rms output which isn't any less but by adding these power transistors it can maximize the output to extreme.

This is the classic TDA7294 AMP with LOTS more Power then normal, this is with using Power Transistors at the output stage, it is a simple Addon to make, it just requires a SYNC resistor and the feedback to be moved to the output after the Power Transistors.

So to make this AMP you can just start with the TDA7294 with one change, just need to "move" the feedback so you can connect it to the Output after the Power Transistors, in all the AMPS that have been made with the TDA7294 the 6.8Ohm has been spot on when using the 2SC5200 & 2SA1943, if you use other transistors you may need to experiment with another value for the SYNC resistor.

Things to do when SYNC it is to listen to it, things to listen to are from very low volume (FROM a clean source) and go slowely up in volume, the POINT here is that it should just get louder like a normal amplifier would, if the SYNC is off then a normal thing will be that at audio peaks (like drums & bass) it will sound like someone is kicking your speakers because the Transistors kick in at a wrong volume then the amp is playing, believe me you will hear it, this needs to be corrected by changing the resistor else you will have an amp that only sounds good at very low volume and medium to high volume.


Component list: (1x AMP)
1x 680 (680R) Resistor
1x 10K Resistor
3x 22K Resistor
1x 6.8 (6R8) 5W Resistor
2x 0.15 (0R15) 5W Resistor
2x 10uF 50V Capacitor
2x 22uF 50V Capacitor
1x 1uF 63V MKT/BiPolar Capacitor
1x TDA7294 Chip AMP
1x 2SA1943 PNP Transistor
1x 2SC5200 NPN Transistor



http://elektriktech.blogspot.com/ amplifier using tda7293 and tda7294


Output Power: The output is at 400W+ (MAX) and this is based on that the TDA itself adds ONLY 20-40W (because of the much higher driving Ohm), but the 5200/1943 are some GOOD POWERFULL transistors and going through the datasheet it will deliver peeks over 600W (short pulse pr Transistor), they supply 100W but this is FULL DC and there are no audio tracks to my knowledge that has that kind of "sound"
Driving Impedance: We have been using it for 2-8Ohm speakers, the lowest we have driven was 1.3Ohm but as with all AMPS if you know your Transistors you know how many watts you can pull out, this AMP will drive what ever you hook it up to, JUST one thing, when we were using my 1.3Ohm set it did introduce some "noise" (sounded like 80' AMP hiss), and at this point the SYNC resistor properly needs to be changed, we did not do this, we took the lazy way out and put some 1.8Ohm POWER Resistors in line with the speakers instead.

We have been using this AMP for +3 years, it is good for driving 2-8Ohm speakers with current config (6.8Ohm RES & 5200/1943)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Popular Posts

  • Simple +-400Watt Amplifier using TDA7294 or TDA7293 + Power Transistors 2SC5200 and 2SA1943
    This additional part can be added to the traditional chip amp made using TDA7294 or TDA7293 to gain extra power in output. The traditional c...
  • Audio Amplifier - 2N3055 MJ2955
    Here is A amplifier with 2n3055 transistors on its output for those of you that are looking at doing a bang for buck amplifier with all tho...
  • Stun Gun Circuit Diagram using 555 timer IC
    CAUTION: Before going to explain about this circuit, we are going to strictly suggest that DO NOT TRY TO IMPLEMENT IT PRACTICALLY AS IT PR...
  • Simple 3 Watt and 5 Watt LED Driver Circuit Using IC 338
    The IC LM338 as we probably are aware, is a profoundly adaptable gadget with regards to controlling voltages and current levels. In the pres...
  • A simple 12V battery charger schematic using LM317
    This is a simple 12Volt Battery Charger Circuit which can be made using less components. This circuit can be modified using the formulas giv...
  • Simple 150 Watt amplifier circuit using transistors
    This is the cheapest 150 Watt amplifier circuit you can make,I think.Based on two Darlington power transistors TIP 142 and TIP 147 ,this c...
  • How to easily repair Momentary Switches used in boats
    Momentary switches make generators and motors begin at the push of a catch. In any case, when they don't begin, consider the switch as o...
  • All the new content will be added to new blog - http://elektriktech.blogspot.com/
    Please visit the new blog http://elektriktech.blogspot.com/ for new content. Apologies for the inconvenience.     http://elektrikte...
  • Simple Car Audio Amplifier Circuit
    A straightforward low power car stereo amplifier circuit taking into account TDA 2003 is showed here. The circuit utilizes low cost, promptl...
  • Lead Acid Battery Charger Circuit
    To successfully charge a battery, it should be supplied with DC current and not AC. This circuit shows how you can use DC voltage to regulat...

Pages

  • Home

Blog Archive

  • ►  2016 (2)
    • ►  August (2)
  • ▼  2015 (23)
    • ►  December (1)
    • ►  November (2)
    • ▼  October (2)
      • Using Arduino as a simple Web Server along with Et...
      • Simple +-400Watt Amplifier using TDA7294 or TDA729...
    • ►  September (2)
    • ►  August (4)
    • ►  July (10)
    • ►  June (2)
  • ►  2013 (1)
    • ►  July (1)
  • ►  2011 (3)
    • ►  August (3)

Dear Visitor

Please visit the new blog http://elektriktech.blogspot.com/ for latest and updated content.

Contact Form

Name

Email *

Message *

About Me

dvbot
View my complete profile

UPDATE!

Please visit the new blog http://elektriktech.blogspot.com/ for all new contents.

Translate

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © Elektrik
Distributed By My Blogger Themes | Blogger Theme By NewBloggerThemes