WEEK 13:EMBEDDED NETWORKING AND COMMUNICATION



GROUP ASSIGNMENT

SEND A MESSAGE BETWEEN TWO BOARDS


SERIAL COMMUNICATION BETWEEN TWO ARDUINO

Serial communication on pins TX/RX uses TTL logic levels (5V or 3.3V depending on the board). Don't connect these pins directly to an RS232 serial port; they operate at +/- 12V and can damage your Arduino board. Serial is used for communication between the Arduino board and a computer or other devices. All Arduino boards have at least one serial port (also known as a UART or USART): Serial. It communicates on digital pins 0 (RX) and 1 (TX) as well as with the computer via USB.

The two Arduino boards are connected serially. The TX of the Transmitter Arduino is connected with the RX of the Receiver Arduino. The RX of the Transmitter Arduino is connected with the TX of the Receiver Arduino. in the simulation it doesn’t matter if you don’t connect the grounds of both the Arduino’s, but in reality make sure you connect the grounds of both the Arduino’s.

This is connection diagram using proteus simulation I took from this website HERE



TRANSMITTER CODE

this code is transmit the signal to the receiver using buttons.


RECEIVER CODE

This code receives the signal through Rx from transmitter Tx.


TESTING USING 2 ARDUINOS



FINAL CONNECTION USING ATMEGS328P BOARDS

Two push buttons are connected with the Transmitter Arduino pins 12 and 13.

FINAL TESTING USING two ATMEGA328P BOARDS

These push buttons are used to control the LEDs those which are connected with the Receiver's Arduino pins 12 and 13. The connections are pretty simple and straight forward.



INDIVIDUAL ASSIGNMENT

DESIGN, BUILD AND CONNECT WIRED OR WIRELESS NODE WITH NETWORK OR BUS ADDRESSESS

In this week I want to make a Transmitter and Receiver circuit with push buttons and leds which will be used for my final project.

12C CONNECTION

This how our connection will look like. In addition both microcontrollers has to be connected to VCC and GND.

My first board “Master” has atmega328p and I can connect the SDA and SCL through PC4 and PC5.

My second board “Slave” has attiny44 20 MHZ clock and I can connect the SDA and SCL through the avr isp header.

This is the connection pinout for Attiny44.

SERIAL BUS

In telecommunication and data transmission, serial communication is the process of sending data one bit at a time, sequentially, over a communication channel or computer bus. Many communication systems were generally designed to connect two integrated circuits on the same printed circuit board, connected by signal traces on that board (rather than external cables).

Serial communication on pins TX/RX uses TTL logic levels (5V or 3.3V depending on the board). They are used for communication between the PCB and a computer or other devices.

SERIAL BUS (ATMEGA328P AND ATTINY44)

In this part of the assignment I used the PCB that I made in WEEK6 with ATtiny44, the PCB in WEEK10 with ATMega328P and Arduino UNO. I communicate with them through serial bus.

I follow the following stepes:
1. Open Arduino IDE and go to file >> examples >> Arduino ISP and upload the example to the Arduino uno board to set it as programmer.
2. Connect the ATtiny 44 board to Arduino UNO through AVR ISP 6-pins.

Arduino uno 328p is as the Master and Attiny44 as a Slave.

3. Select the right settings in the tools bar.
-Select the board From the toolbar go to Tools << Board << ATtiny 24/44/84 << ATtiny44.
-Select the processor From the toolbar go to Tools << processor << ATtiny44.
-Program the Arduino From the toolbar go to Tools << clock << External 20 MHz.

This setting is for Attiny44 I am using it as a slave.


SLAVE CODE

This code is for Attiny44 this board behave as a slave.


MASTER CODE

This is the code for Atmega328p which I am using as a master




Transmitter:

In electronics and telecommunications a transmitter or radio transmitter is an electronic device which produces radio waves with an antenna. The transmitter itself generates a radio frequency alternating current, which is applied to the antenna. When excited by this alternating current, the antenna radiates radio waves. A transmitter can be a separate piece of electronic equipment, or an electrical circuit within another electronic device. A transmitter and a receiver combined in one unit is called a transceiver. The term transmitter is often abbreviated "XMTR" or "TX" in technical documents.


this is the ir led.


RECEIVER:

Consumer IR, consumer infrared, or CIR is a class of devices employing the infrared portion of the electromagnetic spectrum for wireless communications.[citation needed] CIR ports are commonly found in consumer electronics devices such as television remote controls, PDAs, laptops, and computers. The functionality of CIR is as broad as the consumer electronics that carry it. For instance, a television remote control can convey a "channel up" command to the television, while a computer might be able to surf the internet solely via CIR. The type, speed, bandwidth, and power of the transmitted information depends on the particular CIR protocol employed.

3 pins Ir receiver for 38kHz.



PCB DESIGING(SCHEMTIC FOR TRANSMITTER):

selecting the required components.

schematic design of the board.


PCB DESIGING(BOARD LAYOUT FOR TRANSMITTER):

drag the components inside the dimension boundry.


final schematic diagram.


GENERATE THE .RML FILES:

Open the mods and upload the trace file. Select the dpi 2000 and tool bit to 1/64 inch. Click to calculate and save the rml file.


Repeat the same process for outline and holes. Select the tool 1/32inch for holes and outline. Click calculate. RML files is generated.


PCB DESIGING (SCHEMATIC LAYOUT FOR RECEICER):

here, leds are as the output with the receiver circuit.


Selecting the IR receiver.


Ir receiver schematic is raady for board with leds.


PCB DESIGING (BOARD LAYOUT FOR RECEIVER):

routing is done now board is ready for soldering.


MILLING

Open the SRM20 machine software. First replace the tool with 1/64 for traces. Manually set X,Y and Z coordinates of machine. Open the rml file of traces and select output. After job of traces is completed, now replace the tool with 1/32 for holes and outline. Set Z-axis of machine again. Now open the rml file of holes.

Open the rml file of outline and click output. Take out the pcb and clean it.


SOLDERING

IR receiver and Transmitter connection circuit.



REMOTE CONTROLLER FOR MY FINAL PROJECT:

I'm testing my remote, which I designed with an IR transmitter circuit when you hit a button on your remote, an IR LED repeatedly turns on and off, 38,000 time a second, to transmit information (like volume or channel control) to an IR photo sensor or receiver. Here, I am using 4 leds as an output for my final project for controlling the following things with remote.
HR+ ----> setting the hour needle in clockwise direction.
HR- ----> setting the hour needle in anticlockwise direction.
MIN+ ----> setting the minute needle in clockwise direction.
MIN- ----> setting the minute needle in anticlockwise direction.
SEC_RESET ----> reseting the seconds to start the seconds from starting.
MODE -----> changing the mode from Analog to Digital and vise versa.


four leds indicates the hour, minute, mode and Second_Reset of the propeller led pendulum clock.


REMOTE USING ARDUINO UNO:

Turning On and Off the leds using IR remote


CODING FOR TRANSMITTER:

code for transmitter to transmit the signal.


CODING FOR RECEIVER:

When the transmitter sends a signal to the receiver, the output produces the desired result.


REMOTE CONTROLLER FOR MY FINAL PROJECT:

Using 328p microcontroller for IR remote.







Propeller Led Pendulum Clock by Engr. Rashid Ali is licensed under Attribution-ShareAlike 4.0 International


Download all files from here