Want to Make a Rotating Beacon Light with PIC tech.

Discussion in 'The Projects Forum' started by george0039, Jan 14, 2013.

  1. george0039

    Thread Starter Active Member

    Oct 15, 2008
    126
    5
    Hello again

    I think I am greedy But will ask anyways for your help here again.

    I would like Help to design a Working circuit with a PIC chip that will control 5 small LED - 0402 upto 0405. They would be standing up with their backs to eachother in a circle. I would like the circuit to turn on one then off then the next one in the same manner in a circular pattern. I would like to have the ability to alter the flash rate myself, if possible with a pin momentary short etc. I would like the flash pattern to be clockwise.

    I need a complete circuit design, as small as possible. This is for remote control 1/16 tank and vehicle use. I have tried with regular IC but unable to get the circuit small enough and light enough to not be a bother. This would work off the receiver power of 5v.

    I also need someone willing to program the Small PIC for me, which I will pay for of course. I don`t have the knowledge or skills to program PICs.

    Please let me know if there is anyone who can help me with this.

    Thanks Again for your help with this.

    George
     
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Put 8 LEDs on Port B.

    Make a memory map byte for LED position.

    Code in C (more initialization may be required depending on C compiler)

    Code ( (Unknown Language)):
    1.  
    2. TRISB=0x00;
    3. char disp=0x01;
    4. while(1)
    5. {
    6.     byte=byte<<1; // (or byte=byte*2)
    7.     PORTB=byte;
    8.     if (byte == 0x80) byte=0x01; // when byte will overflow on next shift, reset
    9.     delay_ms(100);  // pause long enough for light to show
    10. }
    11.  
    This will shift a byte one position left each time through the loop, lighting one LED.

    If you lay the LEDs out so they are on the surface of a cylinder, facing outward, it will appear that there is a rotating light on the cylinder, provided the LEDs are spaced close enough together.
     
    Last edited: Jan 15, 2013
  3. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    If you buy a 20M2 Picaxe Board (you only need a serial port and cheap cable to program it, available at same store) very cheap and easy to get started.

    For 8 LEDs "rotating" around a cylinder, or one LED of 8 moving in a line if laid out in a row:
    Code ( (Unknown Language)):
    1.  
    2. #picaxe20M2
    3.  
    4. dirsB=$FF
    5. portB=0x00
    6. symbol disp=b10
    7. main:
    8. disp=0x01
    9. do
    10.     disp=disp *2
    11.     pinsB = disp
    12.     if disp = 0x80 then
    13.        disp=0x01
    14.     pause  10
    15.   endif
    16. loop
    17.  
    18.  
     
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Will a DIP8 be small enough (8 pin DIP, same size as 555 timer, 741 op amp, etc?)

    Or do you want a Surface mount uC, and if so, do you want the LEDs pre-soldered to the fine pitch pads? Do you want a dial input for speed?

    For somebody to design and build this (no LED), just programming and board, delivered, you are probably looking at over $50.

    You can learn PICAXE Basic quickly and with the 8 pin, you'd have 5 outputs for a similar effect, with one input for a potentiometer to set the speed. See same link above.
     
  5. george0039

    Thread Starter Active Member

    Oct 15, 2008
    126
    5
    Hello Again

    Thanks for the info thatoneguy. BUT to me looking at your posts is like trying to understand "chinese symbols" SORRY I have NO idea of the material you posted.

    What I was hoping for was a circuit design, that I can makeup myself on a point to point board and get a preprogrammed PIC to do what I wanted with the 5 Micro LED`s mentioned in my first post. I can solder the micro LED myself so the circuit design and a preprogrammed PIC is ALL I hope for. Plus if there are pins that can be momentarily shorted to adjust the flash rate, that would be great OR a small pot. Also I guess the PIC is ok if it`s the size of a 555 or little smaller, thats good to.

    If I am missing anything please let me know. This is ALL new to me.

    Please let me know if this can be done.

    Thanks for the help.
    George
     
  6. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    The PICAXE Code above will do exactly what you want, but it is a 20Pin DIP package (10 pins on each side of IC).

    I linked a place you order it from, along with the programming cable.

    You can download the programming editor/simulator/chip programmer software for FREE at Picaxe.com

    Then you only need to copy the code I put in the PICAXE version above into the editor, plug the USB cable into your computer, plug the other end into the board that has the PICAXE IC, and hit "Program". The 8 pins on the right side will cycle one at a time, for 1/10th second each.

    You essentially only need to add power and ground.

    I walked Another Member Through this process with a more complicated system, and he has it up and running, even though the "code" is foreign to him as well.

    If you insist on a chip being sent to you, I'm sure one of the other members here will offer to do so, I'm giving you the code, method to put code into IC, where to get IC, for free.

    You might realize you like it, if you look at the PICAXE Basic versions, it's basically instructions telling the little computer inside the IC what to do with the I/O pins at certain times. You can make any pattern you'd like once you understand it, and there are a few forums to help you learn if you like, including this one.

    If you want to purchase a programmed IC to do that, somebody may be along in this thread to offer that option. I do not provide that service.
     
  7. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
    Isn't it easy to switch the 20m2 with a 14m2?

    The SOIC-14 SMD is really tiny.
     
  8. george0039

    Thread Starter Active Member

    Oct 15, 2008
    126
    5
    Hello Again thatoneguy

    Thanks for the advice/nudge. I think I will take you up on the offer of future help. Some more questions though, I went to the site you sent me the link to and I was wondering, is there a Smaaller PIC that can be used for my project? The circuit board looks bigger then I can fit into my r.c truck cabin and hide it. Something in a 1" to 1 1/2" square would be Great and still run 5 micro LEDs.
    What do you think?

    Thanks Again for your help/advice.
    George
     
  9. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Once the PICAXE is programmed, you only need to supply it with power, a 0.1uF capacitor across the power leads, and connect the LEDs to it, you don't even need a circuit board. The board is just for programming the IC and getting the design to function the way you'd like to. Once that is finished, the program stays on the chip when you move it to another location.
     
  10. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Yes, if he wants to go with 5 lights instead of 8. There isn't a full 8 bit port on the 14M2 or the 08M2, even though they have enough outputs, the code would be more complex.
     
  11. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
    Thought it was only 5 leds... But the 20m2 SMD is quite small, too. A bit wider but still small.
     
  12. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    The problem is if he wants an easy to program chip that he can then make another one of for other projects, he won't need to using the DIP version.

    I'll re-write the code for the other models if he wishes and post it here. I just don't program ICs and ship them. Too many people think there is a lifetime "free new idea feature upgrade" that comes with them. :rolleyes:
     
  13. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
    I'm more of a one chip per project guy.

    Could be interesting to see how small it is possible to make it.

    That would have been awesome!:)
     
  14. george0039

    Thread Starter Active Member

    Oct 15, 2008
    126
    5
    Hello thatoneguy

    I think you have inspired me to try your suggestion. I will order from the site you sent me a link to. One thing about your code, could you adjust it so that I have a means to physically adjust the LED flash rate? If not I will try the original to see how it looks. What I am after is a typical rotating safety beacon on a work truck. If that helps to make it clearer.

    Also since all I need is the chip, a cap, 5 LED`s and power/ground, I can hard solder them to the chip`s leads and go from there. Could this chip be sealed ti epoxy to make it water proof and still function? Is the chip static sensitive? will it retain the program even with power for LONG periods of time?

    Sorry to be a pain, just starting to get interested in the possibilities.

    Let me know please.
    Thanks
    George
     
  15. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    One way to do this is to have a pot hooked to one of the ADC inputs of the pic. The pot would vary the voltage but the pic would translate that to flash rate.

    Another is to have a momentary contact switch The longer it is held the faster the lights flash.


    Or really simple a momentary contact switch again. But one press = slow, two faster, three even faster and so on till you reach a reset point then back to slow.
     
  16. george0039

    Thread Starter Active Member

    Oct 15, 2008
    126
    5
    Hello again

    I need thatoneguy`s help. Went to the site to finalize my order BUT what cable to I have to order so that I can program from my computer to the Pic?

    Also spinnaker

    Could you tell me what value of pot to use to make the adjustments to the flash rate and what pin numbers on the PIC is it attached to.

    Also thatoneguy, that programmer board is ONLY for that one PIC 14pin chip right? I saw a 8 pin also could that do the same thing with the same program OR is that something for more advanced programs and experienced users?

    I thing I should start to crawl before I stand.

    Thanks again to you both for your help.

    George
     
  17. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    You could use almost any value I would think a 10K pot would do but I will leave that question open to others.


    You are going to need a programmer to program the pic. You can get the pic kit 2 or pick kit 3.

    Thatoneguy will tell you to get the 2. I will tell you to get the 3. We are both right. :) Just get one from microchip.

    Basically the 2 has more features. Most important for you would be the logic analyzer. BUT and a very big BUT. The 3 will program the newer chips but does not have any of the fancy features of the 2 (go figure).

    So if you buy a 2, be VERY careful that it will program the pic that you select.

    Whatever you do just buy a microchip programmer and don't cheap out on the third party programmers. Best you will save is $5 or $10 anyway.

    One nice thing about the 3 is they have a kit that comes with a demo board and some really great lessons in C. Everything is all there for you wired up so no way to make mistakes. Takes a lot of guess work out of learning.

    And don't just buy one chip, buy a few. They are cheap and you will bound to blow one or two up. Don't ask me how I know this. ;)
     
  18. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
  19. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    You'll need the cable that has the 3.5mm stereo jack on the end if that matches the board. The site has boards that will work with PICAXE having any number of pins, check the D-Axe out, which has a ZIF (Zero Insertion Force) Socket for quick programming to then pull out and put into another circuit.

    To adjust the strobe speed, use the readadc PICAXE Basic command, covered in manual 2 (Download the 3 manuals and editor/simulator software from picaxe.com)
     
  20. george0039

    Thread Starter Active Member

    Oct 15, 2008
    126
    5
    Hello Again

    Just wanted to let You; theoneguy, know that I have ordered the parts kits and some spare PIC chips.
    When they get here I will let you know and we can go from there.

    Thanks again for the help.

    George
     
Loading...