1. 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.
    Dismiss Notice

Radio Controlled LEDS?

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by crazylegsmurphy, May 27, 2008.

  1. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,445
    Likes:
    937
    Location:
    Canada, of course!
    ONLINE
    There are also hundreds of posts at all the other website forums.
     
  2. arhi

    arhi Member

    Joined:
    Apr 17, 2008
    Messages:
    887
    Likes:
    12
    Location:
    Belgrade, .rs
    crazylegsmurphy, with not much exp with RF .. I'd really suggest you try the easier / cheaper solutions first .. you can try the IR thing with 2pic + 2IR LED's + 2 IR Receivers and some simple elements around .. it will set you back 10-20$ to try that .. the more complex is the US and that will include some opamps to amplify the received signal and demodulate it, with 1tx and 1rx capsule (enough for test) it will be again under 40$ (the US capsules are the major expense here) so when you test out those solutions, with 2 devices only then you can move forward and thing about RF if the "simple" IR/US does not work .. getting RF kit will set you back much more and I'll go with it only if the IR/US does not work, not to mention that RF is some 1000x more complex then IR/US solution, that there is (as many said already) many things that can go wrong with RF (everything is bloody important, and you have "hard to get" demand on something normal RF is not ment to be used for) ... The resonance idea might be also good but that's too complex for me so I cannot comment on that more then "it might be good idea"...

    with IR .. just generate 40KHz pulse with a pic - feed it trough 300R + 2K variable resistor, attach receiver and led on another side, encase them in resin, and check if turning the variable resistor you can achieve some "accuracy" on the distance .. if it works, go from there, it is quite simple then to send ID trough that modulated signal via IR .. if it does not, try out the US ...

    the "fact" that US will not go trough resin is bit "not true" .. it actually depends on the resin, the 40KHz will bounce of resin (over 50% for sure) but some of it will go trough, as distance you need to send your signal to is 30cm .. I believe it will work, and you do not want to catch reflection of the signal from the device you are sending it, you will just receive signal on the other node ..

    so what I suggest
    - make 2 resin shell's
    - make simple 40KHz IR modulator with potentiometer (2K for e.g.) - you can either generate 40KHz via pwm output of PIC or you can make simple ne555 circuit (I suggest you go with PIC as you will eventually need it)
    - make a simple receiver (IR Receiver for 40KHz + some indicator of received signal - LED for e.g.)

    test the devices without shell, if it does not work, post your schematic here so we can figure out what you missed
    when that works, put them in resin shell's and do the test again, change the output power of the LED so you can penetrate the resin ...

    that should be your first test .. it is simple, fast, easy and cheap .. if it does not work (resin is not transparent enough, move to US doing pretty much the same thing)
     
  3. crazylegsmurphy

    crazylegsmurphy New Member

    Joined:
    May 27, 2008
    Messages:
    104
    Likes:
    0
    arhi! You posting wizard!

    Just when I think I'm convinced of something, you convince me otherwise.

    I like your idea of using IR, but there are still questions I have yet to find the answers too (probably because it's such an odd question to ask). How am I going to get the IR signal to "stop" at the range I want?

    Unless I'm wrong, the beam of light will travel quite far and so I'm not sure how to limit the distance, or have the rocks know where they are relative to each other. Would limiting the power to the IR transmitter do the trick, or would it simply degrade the signal?

    I think the main question besides that is the resin. I'll be honest at this point and say I'm not entirely sure which resin I'll be using. While I have worked with resins a lot in the past, the way to get clear resin to look like Amber is to mix in fillers. These fillers can range from shredded cloth, to dirt, to gold flakes.

    It could become a potential "fun house of mirrors" in the inside, and because of the outside shell being almost completely opaque (and the outside being quite shiny) it may just bounce off it, let alone go back through the other resin.

    As for the US, I was kinda convinced of the same thing. I mean, I can stick my head in a bucket and people can still hear me even if it is muffled. I just don't know if the sound waves will "distort" too much through the resin. They might "hear" each other, but covering your mouth with your hand and singing aren't exactly the same when trying to get a message across.

    I don't know sound all that well (aside from basic knowledge), but if the waves are changed too much by the resin then it wouldn't really matter if it went the 30 cm or so because the receiver would be hearing a "muffled hand", no?

    I have been trying to see if there is a way I can adjust the resin so it has thinner parts. If you look on the other post on the main forum site, I posted some images of the stones from the movie. You can see how they have a darker bottom where the light doesn't quite get too...this is basically where all my hopes lay of hiding the internal components.

    The ultimate trick in this whole thing is to not give away the "magic" inside. That means that the resin has to be thick enough to not allow the shadows of the components to be obvious, or they need to be pushed down to the bottom so far that it just blends with the already dimmer bottom.

    If I could make the IR/US/RF signals radiate from the bottom, then I can perhaps place the closer to the surface without them being too obvious...this may help things.

    Lets see about IR as well then. (I'm going to keep researching all three to be sure).

    If anyone has any good, simple, working IR transmitter/receiver schematics (or where I can find some), that would be great. As well, does anyone know how to solve the distance issue?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. arhi

    arhi Member

    Joined:
    Apr 17, 2008
    Messages:
    887
    Likes:
    12
    Location:
    Belgrade, .rs

    It is fairly simple, the light intensity will decrease by distance, IR receiver need some intensity to detect the signal, by using variable resistor (trimmer or potentiometer) you can vary the output intensity of the IR LED hence limit the distance where that light will be detected. I use that in my IR obstacle detector where the output of the IR LED is made so low that it can be detected in few cm's only. As this is soo cheap to make / test I suggest you do that before playing with "complex" solutions.

    now this is something I cannot help you with, nor probably anyone else on the forum .. you will have to decide that for yourself. I have no idea how "expensive" the resin is, but you can try out different shell's .. maybe you can use some "old" props made out of different types of resin to test the "IR transparency" thing ..

    well, it is fairly simple to test - of course, like with the IR, you need to decide on the shell material first in order to make successful tests. To play with US a oscilloscope would be useful btw.

    All I can say is - have you ever saw US image of baby? Ok, that is more sophisticated device, but, that is sound .. and it travels trough the flesh&bone .. and then bounce back to be detected ... I'd say you have pretty good chance of transmitting readable signal trough resin with 40KHz carrier ..

    again, it is you who need to decide how the thing will look, how the resin will be shaped, with what it will be mixed etc... if you can make inside cast as well as the outer cast I assume you can make "budges" on the inside cast where your receivers and transmitters will be .. but again .. without making a choice and doing some tests, we exosted the theory here ... you have 2 relatively simple solutions (IR/US) that might work but might not, to know, you have to test ... it is fairly easy and fearly cheap... If that does not work you need to go the EM/RF field .. that's where I cannot go with you as I suck in those areas .. (not that I'm too good with digital too :( but compared to EM/RF .. wow ..)

    that I do not present a big problem ... the LED's will not be visible trough resin, the tranducers (if you go with US) are also quite small ... and the PCB/Battery you can put all way down .. so "hiding it" will not be a problem, and, you can make the bottom bit thicker/with more filler .. I have no experience with resin, but I'm pretty sure it can be done

    no need to .. if you put few IR LED's and few IR receivers on the inside of the resin, they are not going to be easy to spot ... and some thin wires to the board on the bottom will solve the problem

    you have here Cybot IR Obstacle Detector Page a simple schematic on how to send and how to receive IR ... afaik the schematic uses 36KHz modulated signal and 36KHz IR receiver ..

    [​IMG]

    The project explained here uses reflection to determine obstacle, that is not what you need, you just need to send out signal from one pic and receive it on another, but on this schematic you can see how to connect both receiver and the transmitter ... the current limiting resistors (R1/R2 1K) should be replaced with 500R resistor + 2K variable resistor so you can change the output strength of the IR signal (light intensity) to achieve optimal distance trough resin.

    also, even better example can be found here:
    Nigel's PIC Tutorial Page
    look at PIC Tutorial  Five - Infrared Communication on that page, it gives you a full explanation on how to do IR communication ... it is written in ASM, but if you like some other HLL you can probably write something similar in C
     
    Last edited: Jun 8, 2008
  6. gramo

    gramo New Member

    Joined:
    Oct 2, 2006
    Messages:
    1,221
    Likes:
    23
    Location:
    Newcastle, Australia
    I just finished my Infrared UART Example on my site too

    [​IMG]

    [​IMG]

    Transmit Program:
    Code (text):
    Device = 18F2550
    Clock = 8
    Config FOSC = INTOSCIO_EC

    Include "INTOSC8.bas"
    Include "pwm.bas"
    Include "IR_UART.bas"
    Include "convert.bas"

    Dim Variable As Byte

    // start of main program
    PWM.SetFreq(38000, 50)
    IR_UART.SetTX(PORTC.2)
    IR_UART.SetMode(umTrue)
    IR_UART.SetBaudrate(sbr300)

    Variable = 0

    Low(PORTC.0)
    While True
        Inc(Variable)
        IR_UART.Write(Variable)
        DelayMS(500)
    Wend
    Receive Program:
    Code (text):

    Device = 18F2550
    Clock = 8
    Config FOSC = INTOSCIO_EC

    #option LCD_DATA = PORTB.4
    #option LCD_RS = PORTB.0
    #option LCD_EN = PORTB.1

    Include "INTOSC8.bas"
    Include "pwm.bas"
    Include "IR_UART.bas"
    Include "convert.bas"
    Include "lcd.bas"

    Dim Variable As Byte


    PWM.SetFreq(38000, 50)
    IR_UART.SetRX(PORTC.2)
    IR_UART.SetMode(umTrue)
    IR_UART.SetBaudrate(sbr300)

    DelayMS(150)
    LCD.Cls
    LCD.WriteAt(1,1,"IR UART")

    While True
        IR_UART.Read(Variable)
        LCD.WriteAt(2,1,Convert.DecToStr(Variable,3))
    Wend
    More about the program/parts etc can be found here Spencys digital-diy 18F PIC micro - Infrared IR Modulated UART

    :eek:
     
    Last edited: Jun 8, 2008
  7. crazylegsmurphy

    crazylegsmurphy New Member

    Joined:
    May 27, 2008
    Messages:
    104
    Likes:
    0
    gramo,

    Let me say first off your site is awesome! The video and text tutorials really helped me understand things better.

    I have a few questions if you (or someone else who knows) don't mind.

    In your IR diagrams above you use a 28 Pin PIC (PIC18F2550). Is there any issue with using a "smaller" PIC such as the (PIC12F508) or even the (rfPIC12C509AF)?

    As well, with my project I want to have the PIC control up to 5 LED/bulb lights and have them randomly fade brighter to dim, is that too much to ask of one MCU to be doing the IR and the LED control?

    Because my rocks need to have a 360 degree line of sight, I was considering putting 3 inside each so they point outwards in a triangle configuration, can you just add IR LED's (TX and TR) as you would normal LED's (in series) or is there power issues?

    For all the grounds in the schematics, where do those attach? Would they just be attached to the resin core?

    Thanks, great post!
     
  8. gramo

    gramo New Member

    Joined:
    Oct 2, 2006
    Messages:
    1,221
    Likes:
    23
    Location:
    Newcastle, Australia
    I use Swordfish to create my PIC programs - its a higher language compiler that gives the user a real modular structured approach to PIC programming. It's designed for the 18F range of PIC's, so the smallest you could go is the 18 Pin 18F1320.

    No, its very easy!

    The LED's that I use had a 1.6V forward voltage drop. As I am driving with a ULN2003, it too has a 0.9V drop. Working with that, you could calculate the resistor requirements for different configurations, but instead of putting two LED's in series and one in parallel, it would probably be easier to simply drive all three LED's in parallel (each one with a separate 25 ohm or greater LED)

    They are all connected together - a ground is a common connection
     
  9. crazylegsmurphy

    crazylegsmurphy New Member

    Joined:
    May 27, 2008
    Messages:
    104
    Likes:
    0
    Cool, the only reason I ask is because I'm very limited for space in those things and I need a small chip, that can do what I need. As well there doesn't seem much point in putting 20 DIP PIC's in there when I'm only using two or three of the DIP's. I'm not sure what the price difference is, but I'm assuming I would be paying for stuff I wouldn't be using.


    Ok sweet. One of my concerns is driving the TX, the RX, the LED's the MCU, and such. I heard that IR takes a lot of power, so I need to find a decent battery to power all these things.

    In your website, you're programming the IR's to put out pulses at certain frequencies am I right? In your opinion do you think for what I'm trying to do would it be better to just have the transmitting IR's send 3 different frequencies, or have them all one one frequency and send unique ID's?

    Thanks again!
     
  10. gramo

    gramo New Member

    Joined:
    Oct 2, 2006
    Messages:
    1,221
    Likes:
    23
    Location:
    Newcastle, Australia
    If developed correctly, your end circuit can be very compact still.

    Before I answer, what range do you want to detect between the LED's? This distance can be adjusted by controlling the current to the Infrared LED's... A small current = small transmitting range...

    Either way you go, it will take some non-linear thinking. Personally I would have each of them transmit a different code;

    Circuit 1 transmits 100
    Circuit 2 transmits 200
    Circuit 3 transmits 250

    And build a transceiver program. The transmitted data will be somewhat of a mess if some real thought isn't put into the program, but its completely doable.
     
  11. crazylegsmurphy

    crazylegsmurphy New Member

    Joined:
    May 27, 2008
    Messages:
    104
    Likes:
    0
    Awesome!

    The rocks themselves are about 18cm in width...but that's not taking into consideration the internal resin, so it needs to be small. That big 28 pin chip on your video demo is almost as long as the rocks are wide, so that's the only reason I need as small as possible, but I'll look into it.

    More importantly though, I need the range to be 1 - 2 feet roughly. When all the rocks are brought together at the same time (within that range) the IR's communicate and then the MCU's figure out if all three are there and then light the lights.

    The thing I'm not sure about with IR is....

    Well you said make it like the following:

    This is exactly how I was thinking.

    Rock 1 - (Circuit 1 transmits 100) - (Looks for (receives) - Circuit 2 - 200 & Circuit 3 -250)

    Rock 2 - (Circuit 2 transmits 200) - (Looks for (receives) - Circuit 1 - 100 & Circuit 3 -250)

    Rock 3 - (Circuit 3 transmits 250) - (Looks for (receives) - Circuit 1 - 100 & Circuit 2 -200)

    (I think that's right)

    So do I need to have two receiver LED's per stone, or can one receiver LED jump between the two efficiently enough without getting confused?
     
    Last edited: Jun 8, 2008
  12. gramo

    gramo New Member

    Joined:
    Oct 2, 2006
    Messages:
    1,221
    Likes:
    23
    Location:
    Newcastle, Australia
    I'm glad you identified the primary problem with transceivers in this sort of use straight away!

    There will be "confusion" on the databus if there is no master device to initiate the transfers...

    • Say you make circuit 1 the master, it sends out the value "100" and awaits for a reply.
    • Circuit 2 will instantly send "200" if it receives the value "100"
    • Circuit 3 will delay for 100mS and then send "250" after it receives "100"
    • After Circuit #1 has received the other two signals, it continually sends the command "199", which when received in the other circuits, it will turn on the LED's.
    • And of course the in between the "199" LED enable signals, it re-checks to see if the other stones are near by, if one fails to transmit a reply, then the "activate" signal will stop being transmitted
    • Should Circuit 2 or 3 not receive the "199" signal within a 1 second time frame, then they turn off... Rinse and repeat


    Now you have setup an error free protocol, so the devices are not continually transmitting randomly. The issue here is - what if the Master (circuit 1) is not near the other two stones - answer; Nothing will be sent/received because Circuit #1 controls the databus...

    This is perfect if you only want the devices to turn on if all three are close

    Simply place a 1K to 10K potentiometer in series with the IR LED, and now you can control the strength of the signal... Decrease it until you get ~2ft
     
    Last edited: Jun 8, 2008
  13. crazylegsmurphy

    crazylegsmurphy New Member

    Joined:
    May 27, 2008
    Messages:
    104
    Likes:
    0
    That is EXACTLY what I want. I don't want them to ever turn on when there are only two of any of the combinations.

    I think you got it exactly how it needs to be. Slave/Master is a much better idea (as Blue above was thinking as well).

    Plus, if I'm reading it correctly, they can all just have one Transmitter/Receiver per rock, and all be on the same frequency.

    I'm liking this idea!

    Looking back at your diagrams you posted, you seem to have two separate MCU's. I'm assuming (as I have seen it before) you can just put the TX or the TR from another DIP and use one chip (as well as the normal LEDs)?

    Gramo, You're really helping here! I appreciate it greatly!
     
  14. Yongleloo

    Yongleloo New Member

    Joined:
    May 24, 2008
    Messages:
    4
    Likes:
    0
    Location:
    Sydney, Australia
    Nice project, are the rocks RGB?
     
    Last edited: Jun 8, 2008
  15. crazylegsmurphy

    crazylegsmurphy New Member

    Joined:
    May 27, 2008
    Messages:
    104
    Likes:
    0
    Sorry, what? RGB?
     
  16. gramo

    gramo New Member

    Joined:
    Oct 2, 2006
    Messages:
    1,221
    Likes:
    23
    Location:
    Newcastle, Australia

    Each circuit would have its own receiver and transmitter, the modified library controls the PWM output - you need to set the TX Pin to the PWM output CCP1 module.

    From there, the RX pin could be any pin you want :eek:
     
  17. crazylegsmurphy

    crazylegsmurphy New Member

    Joined:
    May 27, 2008
    Messages:
    104
    Likes:
    0
    Last edited: Jun 16, 2008
  18. think_ed

    think_ed New Member

    Joined:
    Jun 17, 2009
    Messages:
    12
    Likes:
    0
    Just wondering if you had considered bluetooth ?

    Reading though this - bluetooth may be interesting...

    A7 Serial Bluetooth Adapters


    The modules have adjustable power and simply need a serial connection (to the pic) then the pics can chat to each other...

    Determine the maximum transmitter power the device will use to maintain a
    connection. This is most often used to limit range as the lower the setting for
    txpower the less the range for connections will be. Valid values are integers from 1 to 10.

    http://www.a7eng.com/downloads/a7-qs-serial.pdf

    Assuming you can lower the power down enough for the 1-2 feet - these seem to have a range of 10 meters at full power. Depends on the power and what the antena needs to go though.

    Just a thought... no real research as yet.
     

Share This Page