Week 15 Assignment:Embedded Networking and Communications



What our assignment is that to Design and build a wired &/or wireless network connecting at least two processors

So I'm planing to work with I2C Protocol to do communication between 2 boards.

The Inter-integrated Circuit (I2C) Protocol is a protocol intended to allow multiple “slave” digital integrated circuits (“chips”) to communicate with one or more “master” chips. It only requires two signal wires to exchange information.

Each I2C bus consists of two signals: SCL and SDA. SCL is the clock signal, and SDA is the data signal. I²C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial Clock Line (SCL), pulled up with resistors. Typical voltages used are +5 V or +3.3 V, although systems with other voltages are permitted.This document gives much more details about i2c.

Board Schematics, Designs and PCB assembly

I used Atmega as master which is used in week 13 assignment and driver board which is used in week 10 as slave. So I need not have to mill the board once more. Also I plan to adopt the same for my final project also.

But For the final project I actually use two motors. Eventhough one Atmega board is enough for the two motors, I planned to make it seperately.

After converting into .png I began to mill. Milling went very well. Then next is the cut portion. In cut, what modella do is that it make the holes in the portion wherever it is needed. But here the bit has displaced a bit and it reflected in my board.

Soon I aborted the process. By God's garce I could remember the origin I set for the milling. So once again I started the operation and this time it came well

Bit displaced and normal is clearly visible ib the picture.

Next is to solder my components and it was little difficult to solder the IC as it is so small and the legs are so closely packed.

But somewhat I made it possiblee to do so.

Now the board is ready and the same mistake was happened as of week 13. Here also I made a mistake and gave the ground connection externally.

Next is about the slave. Here what I've used is that, the driver board used in Week 10. All the details are available there.

So now the boards are ready. What I'm planning to do is that master should recieve data from humidity sensor. Then by using I2C it should transfer to slave and slave should activate the output. Here I gave an LED to detect the output. Actually what I've planned is to adopt this into my project and in the output I could drive the motor. But later I've dropped that idea nad go for the other.

First of all I made the connection. I connected SDA of master with SLAVE, similarly SCL to each other. SDA of ATTiny44 PIN7 and SCL is PIN9. And that of Satsha is PIN 27 and PIN 28. Bluetooth module is conneted to the board and its connected to the PC.

As I'm not so ok with AVR programming, I decided to implemet I2C using Arduino IDE. I reffered Ganadev's week15 week for burning Arduino bootloader into Atmega board. The slave with address number (8) will only receive the transmission from the master. When it recieves the data, output LED blinks.

The following is the setup I used to work on networking, I connected the SDA & SCL of the master IC to SDA & SCL of the slave IC respectively

Here I used wire.h to implement I2C between Atmega328 boards. I found that this won't work for Attiny44. So I searched and find out that tinywire.h would work for the I2C between Attiny44 and Atmega and now it worked.

In this video all the process is shown clearly well. The I2c is between Atmega328 and ATTiny44. Here in Atmega board, input sensor is given. Bluetooth module is also given in Atmega board. I2C connections are added in ATTiny44. Bluetooth module and computer is connected. Then command is given to the master to run the motor or to give the output. Now the master, Atmega328 initiates the slave, Attiny44 to show the output. Also, by using the moisture sensor is sensed command is given to the slave from master to show the output or blink the LED.

Humidity sensing programme

Master

Slave

Go back HOME