Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Remote Controlled Switch

Status
Not open for further replies.

JobbinJP

New Member
Hi Everyone

Can any of u help me in making a remote controlled Switch, preferably an IR one, even aradio frequency one would do.

I broke up an old remote control car and i can control 2 switches with them but what can i do to control more than 2 switches? about 6 switches

Jobbin
 
The TLP/RLP434's are cheap as chips, and easy to interface with PIC's. My examples don’t include Manchester encoding, but that’s as easy as adding Encode[Data] in most compilers

**broken link removed****broken link removed**

TX
Code:
 Device 16F84

XTAL = 4

Dim Number As Word

TRISA = %00000000             'set PORTA pins, A.3 is an output
PORTA = 0

Main:

Number = 34761

SEROUT PORTA.3, 396, ["Z", DEC Number, "A"]
        ' Send the value 34761 via the serial o/p
        '   with the header Z

Goto Main 'Loop for ever

RX
Code:
 Device 16F84

XTAL = 4

Dim Number As Word

TRISA = %00010000             'set PORTA pins, A.4 is an input

Main:

SERIN PORTA.4, 396, 1000, Time_Out, [WAIT("Z"), DEC Number]
        ' Wait for the value "Z" to be received and
        '  When it has, retrieve the number.
        '  Should the SERIN function not receive anything in 1000ms, it will
        '   jump to Time_Out, but if it does receive a number, then you could
        '   print it to an LCD/do what ever you wanted with it


Print At 1,1, Number, " "

Time_Out:
        ' This is where to go if nothing is received
        '   in 1000ms

Goto Main 'Loop For ever
 
gramo said:
The TLP/RLP434's are cheap as chips, and easy to interface with PIC's. My examples don’t include Manchester encoding, but that’s as easy as adding Encode[Data] in most compilers

Have you actually done this?, or is it just theoretical? - unless you invert RS232 it normally won't work over radio modules, as RS232 requires DC coupling, and radio modules are AC coupled.
 
isnt there any other simpler way , without using a PIC? Because i dont have one.!! :(
Or isnt there any simple way to just wirelessly activate 6 switchs ?
 
JobbinJP said:
isnt there any other simpler way , without using a PIC? Because i dont have one.!! :(
Or isnt there any simple way to just wirelessly activate 6 switchs ?

There are much more complicated ways, using a PIC makes it simple - or you can buy specific IC's for the job, Holtek are the most common manufacturer, and make specific IR and radio versions.
 
Are PICs expensive to buy? (I havent even seen one before)

are PICs reusable i.e. can u reprogram it ? or u cant do anything once its programed?

If i somehow manage to get a PIC will u people help me in programming it?
 
JobbinJP said:
Are PICs expensive to buy? (I havent even seen one before)

No, they are cheap.

are PICs reusable i.e. can u reprogram it ? or u cant do anything once its programed?

Most are, although you can buy some OTP ones (One Time Programmable).

If i somehow manage to get a PIC will u people help me in programming it?

Yes, check the micro-controller forum.
 
Nigel Goodwin said:
Have you actually done this?, or is it just theoretical? - unless you invert RS232 it normally won't work over radio modules, as RS232 requires DC coupling, and radio modules are AC coupled.


Software USART is exactly the same syntax as hardware, just a couple of different settings. Heres an extract from Proton+ Lites help file for the RSOUT command

DECLARE RSOUT_PIN PORT . PIN
Assigns the Port and Pin that will be used to output serial data from the RSOut command. This may be any valid port on the PICmicro.

If the Declare is not used in the program, then the default Port and Pin is PORTB.0.

DECLARE RSOUT_MODE INVERTED , TRUE or 1 , 0
Sets the serial mode for the data transmitted by RSOut. This may be inverted or true. Alternatively, a value of 1 may be substituted to represent inverted, and 0 for true.

If the Declare is not used in the program, then the default mode is INVERTED.

DECLARE SERIAL_BAUD 0 to 65535 bps (baud)
Informs the RSIn and RSOut routines as to what baud rate to receive and transmit data. Virtually any baud rate may be transmitted and received, but there are standard bauds, namely: -

300, 600, 1200, 2400, 4800, 9600, and 19200.

When using a 4MHz crystal, the highest baud rate that is reliably achievable is 9600. However, an increase in the oscillator speed allows higher baud rates to be achieved, including 38400 baud.

If the Declare is not used in the program, then the default baud is 9600.

DECLARE RSOUT_PACE 0 to 65535 microseconds (us)
Implements a delay between characters transmitted by the RSOut command.

As you can see, its vary customizable. Hardware RS232 will not function with RF modules very well as the output needs to be inverted. RSOUT is a software equivalent
 
One feature I really like with Proton is,

RSIN WAIT( "XYZ" ) , Dec SERDATA


This allows you to tag data with headers, in this case "XYZ" (It could be any alphabetical string), there could be many other packets of data with different headers, but the PIC will wait until it reads "XYZ" and then fill the following variable with the contents that follows (any numerical variable type), and stop when it receives the next non-numerical value. The Dec modifier turns the ASCII characters into a numerical value on the fly.

This is going off topic a bit, but is a great example of how easy data communication can be with higher level languages such as PIC Basic
 
Last edited:
:(( i went around almost every electronic stores and i couldnt find even 1 shop selling a PIC in my city!!!!!!!!!!!!

It'll take some time for me to order one from the next city!!!

(Sorry bout that)
 
You STILL haven't answered Nigel's question.

gramo said:
Software USART is exactly the same syntax as hardware, just a couple of different settings. Heres an extract from Proton+ Lites help file for the RSOUT command



As you can see, its vary customizable. Hardware RS232 will not function with RF modules very well as the output needs to be inverted. RSOUT is a software equivalent
 
I thought I did.

To invert RS232 data with RSOUT or RSIN, it’s a matter of declaring a setting, in this case;

DECLARE RSOUT_MODE INVERTED , TRUE
Sets the serial mode for the data transmitted by RSOut. This may be inverted or true. Alternatively, a value of 1 may be substituted to represent inverted, and 0 for true.

Have I tried this? Yes!
**broken link removed****broken link removed**

**broken link removed**

**broken link removed**

For the TX/RX program, have a look here;
**broken link removed**
 
Oh Gramo,
I was just razzing you! Nigel asked if you had ever done it. You didn't answer that. (I wish you could see, that I'm grinning ear to ear.) Nice picture, though!
 
The HT12E and HT12D are great chips if you don't want to use a PIC/microcontroller to do the encoding/decoding.
 
Status
Not open for further replies.

Latest threads

Back
Top