Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Automation of AIR CONDITIONER through sensors

Status
Not open for further replies.
No I didnt copied it from the lionk but I found this in one of the study materials for atmega 16.

- - - Updated - - -

Code:
#include<avr/io.h>
#include<util/delay.h>
#define F_CPU 16000000
void main()
{
	DDRA = 0b00000000;
	DDRB = 0b00000001;
	While(1)
	{
		int x = PINA & 0b00000001;	
		If (x = 0b00000001)
		{
			PORTB = 0b00000001;
	
		}
		else
		{
			PORTB = 0b00000000;
		}	
	}
}




And I didnt understand what do you mean by the trigger to relay....


Regards
 

On what event relay should be activated ?

Relay should be activated when receiver receives the value "1" and it should be off when receiver receives the value 0.

Regards
 

........I found this in one of the study materials for atmega 16.

- - - Updated - - -

Code:
#include<avr/io.h>
#include<util/delay.h>
#define F_CPU 16000000
void main()
{
	DDRA = 0b00000000;
	DDRB = 0b00000001;
	While(1)
	{
		int x = PINA & 0b00000001;	
		If (x = 0b00000001)
		{
			PORTB = 0b00000001;
	
		}
		else
		{
			PORTB = 0b00000000;
		}	
	}
}

I coded in C for many years, though not an 'atmega16' programmer. I do not see that the code does anything. Is there a reason to define 'x' inside the loop? usually this is seen as poor practise.

Why assign DDRA and DDRB values and not use them?
 
I coded in C for many years, though not an 'atmega16' programmer. I do not see that the code does anything. Is there a reason to define 'x' inside the loop? usually this is seen as poor practise.

Why assign DDRA and DDRB values and not use them?


see I am not that much familiarwith coding or you can say that I am a novice. I assigned x just for comparison purpose, I found it more easier. Yes i accept that as I am not using the whole ports A and B so What can I do is just assign the particular pins if it can be done. Please let me know the syntax for assigning just the pins of a particular port.

Regards
 

I have an adapter which is giving 12 V DC at no load, Can I use it for powering microcontrollers, (I guess no). So now I want to convert its output into 5 V Dc , Please suggest me the circuit diagram.
 

I am using the 7805 but I am not getting the output. I connected the output (live) of the adapter to the input of 7805 and ground of adapter to the ground terminal of 7805 but I am getting nothing at the output terminal. Maybe its because too much current. output current of Adapter is 1 amp.
 

I am using the 7805 but I am not getting the output. I connected the output (live) of the adapter to the input of 7805 and ground of adapter to the ground terminal of 7805 but I am getting nothing at the output terminal. Maybe its because too much current. output current of Adapter is 1 amp.

Woow slow down, :shock:


Check standard circuit for 7805 voltage regulator and check regulator pins (Vin, Gnd, Vout):



**broken link removed**


Next disconnect all load, including all circuits after voltage regulator. Use voltmeter and measure voltage, you should read 5V.


Also there is chance that you have defective voltage regulator in that case replacement with good part should be done.



Best regards,
Peter

:wink:
 

Hey thanxs a lot but if I have 10 uF, 50 V instead of 10uF 35 V, will it work?
 

Hey thanxs a lot but if I have 10 uF, 50 V instead of 10uF 35 V, will it work?

Yes, will work.

In front regulator you can put 100uF instead 10uF.

On end after 10uF add one more capacitor 100nF, and use one more 100nF on microcontroller Vdd/Gnd pins.


Just to know 7805 can handle max 1A of current, but you need heatsink if you plan to power LCD, GLCD, or some additional parts.



Best regards,
Peter
 
Please specify which one is electrolytic and which is ceremic

- - - Updated - - -

I have 10 uF electrolytic and 100uF ceremic and I dont have 100nF capacitor and yes I do intend to drive LCD,
 

Ceramic caps usually have smaller values up to 330-400nF, and electrolytic caps can be small from 1uF up to several thousand of Farads (supercaps).

In your case 100uF and 10uF are electrolytic or tantalum, and 100nF is ceramic.



Best regards,
Peter

- - - Updated - - -

Your thread reached 76 post but I dont see progress in project.
 

i have started designing my circuit but i am not able to get my hand on certain components such as relay and contactor and also i am facing some problems in programming
 

@Ankit3092

I would agree the following is certainly not exemplary C code, that being said the code does in fact poll Pin 0 of PORTA for changes and reflects those changes on Pin 0 of PORTB.

The purpose of the SuperLoop, while(1), is to constantly poll Pin0 of PORTA.

A much more prudent method of accomplishing the task could be implemented using external interrupts.

@kam1787

The purpose of the DDRA and DDRB is to set the directional properties of the corresponding pins on PORTA and PORTB, similar to the TRISA and TRISB registers found on a PIC.

Although, be aware the directional values are reversed in relation to a PIC, 0 corresponds to an Input Pin, 1 corresponds to an Ouput Pin.

The assignment/preservation of the state of Pin0 of PORTA to variable x could be considered a technique sometimes referred to as a shadow register.

Use of a shadow register prevents a state from changing during critical points within the code where the state/value is being tested at various points, as in an if structure.

As I've indicated above, the code example is certainly less than exemplary and would not be my first choice.

Code:
#include<avr/io.h>
#include<util/delay.h>
#define F_CPU 16000000
void main()
{
DDRA = 0b00000000;	// [COLOR="#FF0000"]Set PORTA for Input[/COLOR]
DDRB = 0b00000001;	// [COLOR="#FF0000"]Set Pin 0 of PORTB for Output, the Rest of PORTB for Input[/COLOR]

	While(1)		// [COLOR="#FF0000"]Repeatedly Poll and Set Pins[/COLOR]
	{
		int x = PINA & 0b00000001;		//[COLOR="#FF0000"] Mask PORTA for Pin 0 Only and store state in shadow register x[/COLOR]
		If (x = 0b00000001)			// [COLOR="#FF0000"]If  Pin0 Was High[/COLOR]
		{
			PORTB = 0b00000001;		// [COLOR="#FF0000"]Set Pin0 of PORTB High[/COLOR]
	
		}
		else
		{
			PORTB = 0b00000000;		//[COLOR="#FF0000"] Else Set Pin0 of PORTB Low	[/COLOR]	
		}	
	}
}


BigDog
 
Can anyone provide me with the circuit diagram to convert 9 v ac to 12 v dc
 

What current rating do you require at the 12v side?

Are TI products available in your locale?

They manufacture several inexpensive Switch Mode Power Supply (SMPS) ICs.

The following is a typical SMPS with 93% efficiency 9v input and 12v 2A output.



Just use a bridge rectifier on the 9v AC along with a reasonable sized cap to reduce the ripple before feeding it into the above circuit.

The BOM is attached as an Excel file.

BigDog
 

Attachments

  • BOM_1214074_2.zip
    958 bytes · Views: 123
Hey Peter... I have developed my project but now I am facing a problem of range... IR sensors are giving a very short range of around 5 mm only. Can you suggest some ideas to improve it upto at least 1 metre.

Regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top