Want to Make a Rotating Beacon Light with PIC tech.

Thread Starter

george0039

Joined Oct 15, 2008
167
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
 

thatoneguy

Joined Feb 19, 2009
6,359
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)

Rich (BB code):
TRISB=0x00;
char disp=0x01;
while(1)
{
    byte=byte<<1; // (or byte=byte*2)
    PORTB=byte;
    if (byte == 0x80) byte=0x01; // when byte will overflow on next shift, reset
    delay_ms(100);  // pause long enough for light to show
}
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:

thatoneguy

Joined Feb 19, 2009
6,359
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:
Rich (BB code):
#picaxe20M2

dirsB=$FF
portB=0x00
symbol disp=b10
main:
disp=0x01
do
    disp=disp *2
    pinsB = disp
    if disp = 0x80 then
       disp=0x01
    pause  10
  endif
loop
 

thatoneguy

Joined Feb 19, 2009
6,359
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.
 

Thread Starter

george0039

Joined Oct 15, 2008
167
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
 

thatoneguy

Joined Feb 19, 2009
6,359
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.
 

Thread Starter

george0039

Joined Oct 15, 2008
167
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
 

thatoneguy

Joined Feb 19, 2009
6,359
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.
 

thatoneguy

Joined Feb 19, 2009
6,359
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:
 

nerdegutta

Joined Dec 15, 2009
2,684
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'm more of a one chip per project guy.

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

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:
That would have been awesome!:)
 

Thread Starter

george0039

Joined Oct 15, 2008
167
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
 

spinnaker

Joined Oct 29, 2009
7,830
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.


Let me know please.
Thanks
George
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.
 

Thread Starter

george0039

Joined Oct 15, 2008
167
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
 

spinnaker

Joined Oct 29, 2009
7,830
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
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. ;)
 

thatoneguy

Joined Feb 19, 2009
6,359
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
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)
 

Thread Starter

george0039

Joined Oct 15, 2008
167
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
 
Top