control electric appliances

Not rated 18,444

control electric appliances
control electric appliances

This circuit can power on or off various electric and electronic devices such as ADSL modems, personal computers, water boilers, water pumps, garage doors, lights, and more. Additionally, it allows for monitoring the status of eight switches, which can be connected to reed switches on windows and doors, functioning similarly to a security system. The circuit consists of an AVR microcontroller (ATtiny2313) operating at 4 MHz, the GM-47 GSM module, a SIM card, and four relays. The GM-47 module operates at 3.3V and is powered by a voltage stabilizer (IC1). The microcontroller (IC2) can function with a power supply between 2.7V and 5.5V when operating below 10 MHz, hence it is powered at 3.3V to match the GM-47 module's requirements. Communication between the GM-47 and ATtiny2313 occurs at a baud rate of 9600 bps, with a voltage level of 3.3V from the AVR side and 2.7V from the GM-47 side. A T2 transistor is used for voltage level adaptation due to this difference. The SIM card connects to the GM-47 via a SIM holder (K15), and the presence of the SIM card is detected by a switch (SW) on the holder. An LED (D6) indicates the status of the GSM network connection; it blinks when connected and remains on when it cannot connect. Upon powering on the circuit, the ATtiny2313 waits for the GM-47 to initialize by reading the SIM card and connecting to the GSM network. Once connected, the AVR sends the command <AT+CPMS="ME"> to set the GM-47 memory for SMS storage. If the response is not <OK>, the command is resent. Upon receiving an <OK>, the AVR sends <AT+CMGF=1> to configure the module to read SMS in text format rather than PDU format. The command <AT+CSDH=0> is then sent to remove extraneous information from SMS, making them smaller and easier for the AVR to process. The AVR then reads the SMS stored in the first memory address of the GM-47 with the command <AT+CMGR=1>. If an SMS is present, the AVR verifies the password, which defaults to 1234 but can be changed by the user. It then checks for the "*" character, indicating a password change followed by four characters. The AVR searches for commands in the format <RelayX=Y>, where "X" corresponds to a relay number (1-4) and "Y" indicates the desired state (0 for OFF, 1 for ON). For instance, <Relay2=1> means to activate the second relay, while <Relay3=0> means to deactivate the third relay. The AVR also checks for the word <Status> in any case within the SMS. If found, it reads the status of the eight switches (open or closed) and the four relays (ON or OFF), sending a status SMS back to the sender. It is important to ensure that the SIM card has sufficient credits to send SMS messages.

In a scenario where the initial password 1234 is changed to 5678, the user can arm relays 1, 3, and 4 while disarming relay 2. Additionally, by sending the command <Status>, the user can request the current status of the eight switches and the four relays. In an alternate case, the user may bypass the <Relay> command by directly specifying the relay number and its desired state, such as arming relays 1, 3, and 4 while disarming relay 2, and subsequently requesting the status.

This circuit integrates various components and commands to facilitate remote control and monitoring of devices, enhancing both convenience and security in home automation applications. The use of a microcontroller and GSM module allows for versatile communication and control, making it suitable for a wide range of electronic devices.With this circuit you can power-ON or Power-OFF a lot of electric/electronic devices such as aDSL modem, personal computers, water boilers, water pumps, garage doors, lights and many more. Moreover, you can watch the status of 8 switches. These switches can be connected with reed switches to the windows and the doors of your house. Just like a sec urity system. This circuit is constituted by an AVR micro-controller (ATtiny2313) at 4MHz, the GM-47 GSM module, a SIM card and 4 relays. The GM-47 module works at 3. 3V and is powered by the voltage stabilizer IC1. The micro-controller IC2 can work with power from 2. 7V-5. 5V when the speed is under 10MHz. So we power it at 3. 3V because this is the voltage level that works GM-47 module. The data connection between GM-47 and ATtiny2313 is done at 9600 bps. The voltage level for this comunication is 3. 3V from AVR`s side and 2. 7V from GM-47 side. Because of this voltage difference I used the T2 transistor to do the voltage level adaptation. The connection of the SIM card with the GM-47 is been made by the SIM-holder K15 and the presence of the SIM card into the SIM-holder is been made by the swich SW on SIM-holder.

The LED D6 when it flases, indicates that the connection to the cell phone network has been done properly. When the module cannot been connected to any cell phone network, the LED stays always ON (it`s not blinking).

After you power-on the circuit the IC2 (ATtiny2313) waits until GM-47 is initiallized, by reading the SIM card and connects to the GSM network that SIM card supports. After the connection to the network, the AVR sends the command to select the GM-47 memory as SMS storage memory.

If the answer of the module is not the AVR sends again the same command. If the answer is the AVR sends the next command . This command says to the module to read the SMS as text and not as PDU format that we used in the past with T10s cell phone. The next command is that removes some information from the SMS, like SMS server`s phone number and the date and time.

This is done to make the SMS smaller to be handled easiest by the AVR. The next command is to read the SMS that is stored in the first memory address of the GM-47. If there is an SMS, the AVR reads it and checks if there is the correct password. Initially the password is 1234 and can be changed by the user. Then, checks if the next character is the "*" (star). This symbol means: "Change the password with the following 4 numbers or letters". Then is searching to find the words . When "X" means the relay number (1-4) and "Y" means 0 or 1 (On or OFF). For example command means "Arm the 2nd relay" and means "Disarm the 3rd relay". After that the AVR checks again the SMS to see if there is the word with small, capital or mixed letters written in SMS. If there is, the AVR reads the status of the switches (Open or Closed) and the status of the relays (ON or OFF) and sends back an SMS to the person who sent the initial SMS.

Obviously, your SIM card must have credits to send SMS! In case A we have the maximum of selections. We send the initial password 1234 and we change it to 5678. We arm the relay-1, relay-3, relay-4 and disarm the relay-2. Moreover, by writing the word we ask for the status of the 8 swiches and the status of the 4 relays. In case C we do the same bypassing the words . We write the number of the relay we want to change and the status we want to have for this relay. for example case C says: armed the relays 1, 3, 4 and disarmed the relay 2. Moreover, we ask for the status. 🔗 External reference