Sunday 23 July 2017

Tips For Getting The Most From Solar Energy


Have you been toying with the idea of switching over your current energy system to solar energy lately? Solar panels could help you save on energy and reduce your impact on the environment both for your home and business. The following article will teach you the ins and outs of solar energy.
If you are thinking about using solar power in your home, you must consider how much direct sunlight your home is actually exposed to. In order for solar energy to be worth it, your roof should have full sun exposure a minimum of 6 hours every day. You should also be wary of any areas of your roof covered by shade.
If you properly maintain your solar panels, they should continue to work well. Be sure and inspect your equipment a minimum of once each month, and carefully wash your solar panels. Don't fear hiring a pro to clean and check the panels, but remember that you may save a lot of you can do it yourself.
Get the records from your energy company on how much energy you have used in the last five years. You can then use this information to figure out exactly how much power you will need solar energy to provide for you home. Having the past five years is important so that you can see that some years you will need more energy than others.
Cleaning your solar panels does not need to be labor intensive. You want to avoid abrasive soaps at all costs, as they can deteriorate and even destroy your panels. So long as there is not caked up dust or bird droppings, frequent rinses with just hose water should be more than enough.
Fossil fuels that are used around the world do not help our environment. In fact, the cause a great deal of damage to the world we live on. Solar energy will provide us with the power we need without causing any damage to our earth. There will be no more gases, carcinogens or even carbon dioxide produced by solar energy.
Know how light mixes with the trees around your property. You may think you've got the perfect spot for a solar panel, but watch it throughout the day. The sun coming in from different angles may lead to surprising shadows from trees and foliage. This will affect your solar output.
Once you buy a system, one of the first things you will notice is how quiet your solar cells are. As they draw in energy from the sun, they make absolutely no noise. This is something that most owners appreciate, as all other renewable energy sources make some noise as they operate. Particularly if you have a stressful job or a stressful life, the last thing you need is a noisy system interrupting your few moments of peace.
In recent years smaller solar systems have become available that the average person can use at a relatively low cost. They might not be able to power your home, but they can power many of your smaller electronics and help you reduce the amount of energy you consume. Search for some smaller systems to help reduces your carbon footprint.
Make sure to watch the light on your solar panel inverter regularly. Check it at least a couple of times a week, while sunlight is hitting your panels. The light should be green. If it is not, your panels might not be working correctly, and it is time to call in a technician.
Your solar panels need to face the sun. The panels must be oriented so that they collect as many of the sun's rays as possible for maximum energy production.
Be honest about what you can expect from a solar powered water heater. The best solar water-heating systems are only a fraction as effective as the best electric systems, but having said that, they do save you money. Second, don't think that just because you shower in the dark means you'll have to deal with cold water. Water heated by solar energy stays warm for about a day.
Now that you have read this article, you should be more aware of just how much solar energy can benefit you. Open your eyes and learn about the great solar energy choice. Use these tips as needed to improve your solar energy experience and go green.

Thursday 11 May 2017

I2C Relay Board

I2C Relay Board
I2C Relay Board
Relay adalah salah satu antarmuka yang paling umum antara pengendali mikro dan dunia luar. Ini menyediakan isolasi listrik antara rangkaian tegangan rendah dari mikro kontroler, dan muatannya.
So why this funny I2C Relay Board, mungkin kamu akan bertanya ....
dalam postingan ini, saya akan mencoba memberikan beberapa alasan saya di balik perancangan board Relay I2C .
Please enjoy, and any feedback is welcome.

Step 1: Cara Normal menghubungkan Relay Tunggal

Normal Way to Drive a Single Relay
Biasanya, sirkuit hanya mendriver beberapa relay,, cara terbaik dengan mengunakan transistor sebagai driver seperti yang di tunjukkan, itu sederhana, biaya rendah dan effectif.
Resistor menjadi pull-down ke ground, dan pembatasan arus basis transistor.
transistor di gunanakan untuk meningkatkan arus yang diggunakan mendriver / mengerakkan Relay, dengan hanya 1mA keluaran dari pin microcontroller, trasistor bisa mensaklar beban 100mA, lebih dari cukup untuk sebagian besar jenis relay.
Dioda itu adalah dioda Fly-Back, melindungi sirkuit dari lonjakan tegangan tinggi ketika relay swicthing (bekerja).
Keuntungan tambahan dari mengunakan sirkuit ini, adalah tegangan operasi relay dapat berbeda dari tengangan yang digunakan microcontroller. jadi, tidak hanya mengunakan relay 5v, tapi dapat mengunakan tengan DC yang lain sampai 48V.
ada satu kekurangan. meskipun sirkuit hanya mengunakan 4 componen, itu semua akan tetap bertambah jika mengunan relay lebiih dari 4 yang dibutuhkan, jadi ,apaya kamu lakukan jika kamu ingin mendiriver 8 relay, tapi ingin tetap mengunakan PCB dengan ukuran yang kecil sebisa mungkin.?

Step 2: Memperkenalkan ULN2803

Introducing the ULN2803
uln2.jpg
semakin banyak relay yang sebuah project butuhkan, semakin banyak pula kompunen yang terhitung. ini aka membuat design PCB menjadi lebih sulit, dan mungkin mengunakan ruang pcb yang berharga, tapi dengan mengunakan transistor array, seperti ULN2803, pasti akan sangat membantu untuk menjaga ukuran pcb.
ULN2803 sangat ideal untuk input 3.3v dan 5V dari microcontroller, dan dapat mendriver relay hingga 48v DC.
ULN2803 ini memiliki 8 sirkuit yang terpisah(sendiri-sendiri), masing-masing sirkuit memiliki semua komponen yang dibutuhkan untuk menyalakan relay.

Step 3: Apa yang telah kita capai sejauh ini

What We Have Achieved So Far
uln.jpg
dengan mengunakan driver ULN2803, kita mengurangi jumlah komponen untuk mendriver 8 relay dari 32 komponen menjadi satu komponen.
ini akan membuat design pcb jauh lebuh sederhana dan mengurangi keseluruhan ukuran pcb.

Step 4: menghubungkan relay ke proyek mengunakan ULN2803

Connecting Relays to a Project Using ULN2803
timer1.jpg
uln3.jpg
timer3.jpg
gambar ini menunjukkan sebuah projek yang mendriver 16 relay, seperti yang dapat dilihat, ruang yang diambil oleh ULN2803 sangan sedikit, dan tata letak pin dari ULN2803 membuatnya sangat mudah di gabungkan dalam pcb.
header sebelah kanan dari ULN2803 digunakan untuk menghubungkan ke masing-masing relay. ini membuat pbc relay sangat sederhana, dengan hanya satu koneksi suply, dan satu koneksi per relay.
mungkin kamu akan bertanya apakah ada cara untuk memperbaiki desig ini.

Step 5: Memperkenalkan Microchip MCP23017 IO Expander

Intruducing the Microchip MCP23017 I/O Expander
mcp.jpg
MCP23017 dari MicroChip adalah sebuah I/O is an I/O Expander IC, yang menambahkan 16 port I/O tambahan ke microcontroller. masing-masing pin MCP23017 dapat di konfigurasi sebagai input dan output. MCP23017 di control lewat bus i2c, dan pengalamatan dapat di program pada MCP23017, sampai 8 ic MCP23017 yang dapat terhubung pada sebauh proyek. ini dapat menambahkan pin total hingga 128 I/O.
melihat proyek yang mana menggunkan 16 relay, jumlah kabel antara pcb utama dan papan relay total ada 17 kabel - satu suplai positif relay dan satu kabel per realay.
mengunakan MCP23017,pengkabelan antara pcb utama dan relay board dapat dikurangi hanya 5 kabel:

  •  relay positive supply
  •  +5V for MCP23017
  •  0V
  •  SDA (I2C bus)
  •  SCL (I2C bus)

untuk mengontrol maksimum 128 I/O porta tambahan ,itu masih membutuhkan 5 kae yang sama dari PCB utama. hal ini membuat desig pcb utama sederhana dan rapi,dan menguangi pengkabelan internal proyek seminimal mungkin.

Step 6: Merancang papan relay I2C

Designing of the I2C Relay Board
4.jpg
6.jpg
2.jpg
3.jpg
PCB Design software limitation
saya mengunkan versi gratis Eagle untuk semua desigku. software itu hanya memiliki satu keterbatasan, dan itu adalah ukuran papan yang dibatasi hingga 100mm x 80mm.
merancang sebuah papan relay dengan 16 relay dan terminal skrupnya, itu tidak mungkin pada PCB 100m x 80 mm. tapi itu mungkit sesuai 8 relay dengan terminal skrupnya, sebuah MCP23017 dan ULN2803 dalam satu papan. alih -alih satu papan, designya di ubah menjadi dua pcb yang identik. satu-satunya kelemahan opsi ini adalah berharap mengunakan semua 16 I/o pada satu ic MCP23017 tapi masing-masing papan harus mengunakan satu ic MCP23017 dan hanya mengunakan 8 I/O dari 16 I/O yang tersedia..
Component selection
Desainnya harus dibuat hanya dengan menggunakan komponen melalui lubang standar..
Connecting multiple I2C Relay Boards
MCP23017 memiliki tiga baris alamat (A0,A1, dan A2), dan masing-masing papan Relay i2c harus memiliki alamat I2C yang uniq. untuk memudahkan pengalamatan, pin header ditambahkan untuk pengturan alamat seriap papan relay I2C. dengan opsi ini, hingga 8 papan relay i2c dan terhubung pada sebuah proyek, untuk mengendalikan total 64 relay.
Supplying power to the relays
dengan sampai 64 relay yang dapat dihubungkan pada sebuah proyek, jelas power suply yang dibutuhkan tidak dapat lagi diambilkan langsung dari pcb utama proyek. oleh karena itu, suply masing-masing papan relay I2C melalui terminal skrup. agar mudah untuk terhubung antar papan relay i2c, dua terminala skrup di tambahkan.
Relay operating voltage
kareanabanyapilihan relay yang tersedia, desig harus memenuhi berbagai tegangan relay yang berbeda. degan mengunakan ULN2803, tegangan relay dapat berbeda antara 5v sampai 48V ,ini membuat pemilihan beban relay lebih mudah.
Connecting a load to the relays
A set of 3 screw terminals per relay allows easy connections the relay contacts (Common, Normally Open, Normally Closed). There is no common connections between the 8 relays, allowing maximum connection flexibility using the I2C Relay Board.
Connecting the I2C Bus
Connection of the four I2C Bus wires is done using headers. Again, two rows of headers were added for easy connection of multiple I2C Relay Boards.

Step 7: Cost and Design Breakdown

Cost and Design Breakdown
Using the project where I had to control 16 relays , the different designs can now be compared
Transistor design
32 Resistors, 16 Diodes (1N4007), 16 Transistors (BC109)
Total number of components excluding relays: 64
Total cost of components, excluding relays : ZAR116.96
Pros:
Standard everyday components
Cons:
Difficult PCB layout
17 wires between project and relays


ULN2803 design
2 x ULN2803
Total number of components excluding relays: 2
Total cost of components, excluding relays : ZAR18.24
Pros:
Minimum components
Easy PCB layout, and reduces overall PCB size
Cheapest option
Cons:
17 wires between project and relays
I2C Relay Board design
2 x ULN2803, 2 x MCP23017, 6 x 3-pin headers, 6 x mini-jumpers, 6 x resistors
Total number of components excluding relays: 22 (4 without the address selection headers)
Total cost of components, excluding relays : ZAR78.00
Pros:
Easy to connect multiple I2C Relay Boards to project
Only 6 wires between project and relays
Cons:
Not the cheapest option available.

Step 8: Connecting the I2C Relay Board

Connecting the I2C Relay Board
f4.jpg
f1.jpg
f2.jpg
The project shown, uses 16 relays, so it contains two I2C Relay Boards. The address of the boards are set to 0 and 1 respectively. As can be seen, the connections between the different PC boards are now kept to a minimum.
Simply connect the +5v, 0V, SDA and SCL lines to an Arduino I2C Bus using ribbon cable.
Connect the required V-Relay to the board.

Step 9: Arduino and the I2C Relay Board

Arduino and the I2C Relay Board
ide.jpg
Connect the board to your Arduino as shown.
Below is a simple sketch for using the I2C Relay Boards.
In this sketch, only the "wire" library is used. Due to the easy comminucation on the I2C Bus, all comms to the MCP23017 is included in the sketch.
<p>#include   <Wire.h>   // needed for I2C operation<br></p><p>void setup() {
 //start I2C communications
 Wire.begin();</p><p>  // Setup relay boards
 SetupRelays();
}</p><p>void loop() {
 // put your main code here, to run repeatedly:
 
 for (byte relaydata = 0; relaydata <= 255; relaydata = relaydata + 1) {
   // write data to cards 0 .. 7 relays
   WriteRelays(0,relaydata);    // write data to relay card 0
   WriteRelays(1,relaydata);    // write data to relay card 1
   WriteRelays(2,relaydata);    // write data to relay card 2
   WriteRelays(3,relaydata);    // write data to relay card 3
   WriteRelays(4,relaydata);    // write data to relay card 4
   WriteRelays(5,relaydata);    // write data to relay card 5
   WriteRelays(6,relaydata);    // write data to relay card 6
   WriteRelays(7,relaydata);    // write data to relay card 7
   delay(1000);  
 }
}</p><p>//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Begin of MCP routines - no library needed
</p><p>//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p><p>void SetupRelays() {
 // Setup all possible relay cards (address 0 to 7)
 for (byte i = 0; i <= 7; i = i + 1) {
   MCP_Write(i, 0x00, 0b00000000);      //  set all pins to output
   MCP_Write(i, 0x12, 0b00000000);      //  set all outputs to off
 }
}</p><p>void WriteRelays(byte address, byte data) {
 // Write data to relays
 // --------------------
 MCP_Write(address, 0x12, data);
}</p><p>void MCP_Write(byte MCPaddress, byte MCPregister, byte MCPdata) {
 // I2C write routine
 // -----------------
 MCPaddress = MCPaddress + 0x20;    // 0x20 is base address for MCP
 Wire.beginTransmission(MCPaddress);
 Wire.write(MCPregister);
 Wire.write(MCPdata);
 Wire.endTransmission();
}
</p><p>//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p><p>// End of MCP routines
</p><p>//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p>


Enjoy !

Step 10: Building and Selling This Project

Building and Selling This Project
If there is a company interested in building this I2C Relay Board, please do so. It would be great if this can be made available for hobbyist as a ready-made add-on.

Source by Eric Brouwer in arduino

Monday 8 May 2017

Connecting ESP8266-01 to Arduino UNO/ MEGA and BLYNK

Connecting ESP8266-01 to Arduino UNO/ MEGA and BLYNK
Connecting ESP8266-01 to Arduino UNO/ MEGA and BLYNK
This is a tutorial to show you how to flash a firmware to ESP8266-01 and connect to Blynk using an ESP8266 - 01 as an Arduino wifi shield.
Hardware needed:
*Arduino Uno/Mega
*Jumper wires
*USB A to USB B cable
*ESP8266-01
Software needed:
For easy access, move or download the following software to the desktop of your Linux. It can be moved later.
*Linux or Mac for flashing firmware.
*Most recent BLYNK library link: https://github.com/blynkkk/blynk-library
*Sdk1.0.0 v0.22 ESP8266 firmware link:
*Download esp8266_flasher [For Windows]
*Blynk app on iphone or android.

Step 1: Download These Files

Download These Files
3 blynk lib Github.JPG
3 esp8266libITEADLIB.JPG
4 pyserial github.JPG
5 esptool link Github.JPG
6 firmware AT SDK.JPG
*Download Arduino IDE
*Download most recent Blynk library
*Download the Blynk-ESP8266 library
Click the link provided, download and install the library.
*Download pySerial
Click the link provided in the intro and click what is in the red box. Make sure you move it to your desktop. Once it's there, double click the "pyserial-2.7.tar.gz" file and it will create a pyserial-2.7 folder.
*Download esptool
Click the link provided in the intro and click what is in the red box. Make sure you move it to your desktop.
*Download Sdk1.0.0 v0.22 ESP8266 firmware
This will download just by clicking the link in the intro page. Make sure you move it to your desktop. Open the "esptool-master" folder and move the "AT22SDK100-2015-03-20-boot12.bin" file into it. Then, rename it to "AT22SDK10020150320boot12.bin".
*Download esp8266_flasher [For Windows]
Download esp8266_flasher.exe

Step 2: Using Windows:

Using Windows:
3.JPG12121.JPG
*Connect your arduino to your computer using an USB 2.0 cable.
  • *ESP8266:____________ Arduino:
  • GND -------------------------- GND
  • GP2 -------------------------- Not connected
  • GP0 -------------------------- GND
  • RXD -------------------------- RX
  • TXD -------------------------- TX
  • CHPD ------------------------ 3.3V
  • RST -------------------------- Not connected
  • VCC -------------------------- 3.3V
*Open "esp8266_flasher.exe" and click on bin.
*Select the binary file "AT22SDK100-2015-03-20-boot12.bin".
*Enter proper COM port. In this case it is COM3
*Then click on download button,
*If your connections are proper the flashing will begin after erasing flash memory.
*After completion it shows "failed to leave flash mode this is OK.

Step 3: Using Linux: Changing the Directory

Using Linux: Changing the Directory
Open your Terminal (here we are using Kali linux), then type "cd". Next, drag the "pyserial-2.7" folder into the terminal window and hit enter.

Step 4: Installing PySerial

 Installing PySerial
Enter this command “python setup.py install" into the terminal
(If your terminal doesn’t have root/administrator/Superuser privilege access use "sudo python setup.py install" and enter password when asked.)
Step 5: Connecting Arduino and ESP8266-01
*Connect your arduino to your computer using an USB 2.0 cable.
*ESP8266:____________ Arduino:
GND -------------------------- GND
GP2 -------------------------- Not connected
GP0 -------------------------- GND
RXD -------------------------- RX
TXD -------------------------- TX
CHPD ------------------------ 3.3V
RST -------------------------- Not connected
VCC -------------------------- 3.3V

Step 6: Flashing the Firmware to ESP8266-01

Flashing the Firmware to ESP8266-01
11 Afterflashing.png
*Type "cd". Next, drag the "esptool-master" folder into the terminal window and hit enter.
* Esptool-master should contain following files
[ AT22SDK10020150320boot12.bin, esptool.py, LICENCE, MANIFEST.in, README.md, setup.py ]
*Enter this command
"sudo python esptool.py --port /dev/ttyACM0 write flash 0x00000 AT22SDK10020150320boot12.bin"
Note:The port address of your arduino may be different. You can use the command “ls /dev/tty*” to list all devices.

Step 7: Add the Blynk Library and the Blynk-ESP8266 Library to Your Arduino IDE.

*Arduino IDE >> Sketch >> Include library >> Add .zip library.
* And install "blynk-library-master" and "ITEADLIB_Arduino_WeeESP8266-master" libraries.
*Update the ESP8266 library from “Arduino IDE >> Sketch >> Include library >> manage library”.

Step 8: Uploading the Code to Arduino

Uploading the Code to Arduino
  • USING Arduino MEGA:
ESP8266:____________ Arduino:
GND -------------------------- GND
GP2 -------------------------- Not connected
GP0 -------------------------- Not connected
RXD -------------------------- TX
TXD -------------------------- RX
CHPD ------------------------ 3.3V
RST -------------------------- Not connected
VCC -------------------------- 3.3V
We will be using a 1K POT connected to analog0 pin and an LED connected to D7 of arduino mega.


*Open Your “Blynk app” from android/iPhone get the “authentication token”.
  • Open the code in “Arduino IDE >> File >>examples >> blynk >> BoardsAndShields>> ESP8266_Shield_HardSer”
  • Add your authentication token to the code
  • Enter "SSID" and "PASSWORD" in respective fields.
  • Upload the code to your arduino.

Step 9: Connecting, Controlling and Monitoring Arduino Pins Using Blynk App

Connecting, Controlling and Monitoring Arduino Pins Using Blynk App
14 screenshotBlynk.jpg
In the Serial monitor you can see that the connection has been established with blynk server.


Here’s the screenshot of the blynk app
Digital Pin 7 of Arduino mega --------->>controlled by blynk app.
Analog Pin 0 data from Pot -------- >> displayed on graph.

Step 10: USING ARDUINO UNO

Similarly you can also use arduino uno....
ESP8266:____________Arduino:
GND -------------------------- GND
GP2 -------------------------- Not connected
GP0 -------------------------- Not connected
RXD -------------------------- D3 (SoftwareSerial)
TXD -------------------------- D2 (SoftwareSerial)
CHPD ------------------------ 3.3V
RST -------------------------- Not connected
VCC -------------------------- 3.3V
For Arduino UNO you can use “Arduino IDE >> File >> examples >> blynk >> BoardsAndShields>> ESP8266_Shield_SoftSer”
*The “Baud rate” of ESP8266 has to be changed to 9600 in Software Serial.
*AT command “AT+UART_DEF=9600,8,1,0,0”.