Help With Electronic Circuit

Aineejames

Beta member
Messages
0
Location
Arizona, USA
Hello, I need some help on designing a circuit for an animal shelter that does the following:

Requirements - Must be battery operated, maximum of $20 parts cost

Operation Details:
When a button is pushed, a bundle of 3 white leds will begin to flash at a rate of half a second on and half a second off. This will repeat for 10 minutes. After the ten minutes is up, then the white leds will turn off and switch to a bundle of 3 red leds. These red leds will then continue to blink forever until a button is pressed to turn the entire circuit off.

Any help is appreciated :lol:.
 
Easily doable for less than $5 let alone $20, but I'm curious...how exactly is this gonna be used? o_O
oh and how bright do you need the LEDs to be?
 
Thank you for letting me know the potential cost of parts. It needs to catch attention and be easily visible in daylight. The use of this circuit will be used as an animal care alarm.
 
You'll need this:
3x white leds (series 1)
3x red leds (series 2)
2 x resistors (for your leds)
1x button
1x PIC microcontroller (cheapest you can find)
1x 4 AA battery holder, or decide whatever type works best for you. If it's gonna sit somewhere and never be moved then maybe bigger battery type.

Connect both LED series to 2 separate outputs on the PIC + 1 resistor each in series with each colour group, and one PIC input to the button.

For programming, set PIC to stay in sleep mode until triggered on interrupt by someone pushing the button, then just do your simple routine of light flashes.

Your LEDs will have to be pretty bright to be seen, something like this will work though and only cost 30 cents each!
Note it's only a 15 degree output, will that work for your purpose? That'll be darn bright anywhere inside that 15 degree arc, but outside you won't see it much in direct daylight.

This is actually a pretty good/easy first project even if you've not done something like this before, lemme know if you get stuck!
 
Last edited:
Thank you so much for your help! If there is any way that you could possible make a circuit diagram for me that would help me understand the process more. Also, how are you able to program a PIC and what programming language must you know. Maybe send me a couple links that would help me too and your recommendations of products. Again, thank you.
 
Last edited:
Just realised there probably won't be enough current from the PICs outputs to drive these high brightness LEDs directly :(

You'll need a MOSFET to do that as shown here: mosfet - Driving LED strip from microcontroller - Electrical Engineering Stack Exchange

PWM_3.3V = the output from your PIC (don't worry, all you do is just turn pin on turn pin off to get the LEDs to flash)
MCU_GND = PIC ground. Just connect to the negative terminal on the battery case you're using.

THere's a super easy option called a "PICAXE" that might be better for you, you can buy a starter kit like this one: PICAXE-08 Starter Pack (AXE003U) - Hardware - PICAXE
That'll have everything you need to program the PIC and get started, the only downside is it's a bit more expensive than just sourcing the same bits yourself.

If that's too expensive, just google "PIC programming" to get tons of tutorials up - they'll vary slightly depending on which exact model you get, but the general idea is the same. You'll usually program them in C or MicroC. Whatever the cheapest most basic PIC you can find is will probably be good enough for your purposes.
 
Thank you again for all of your help! I need to make 8 of these, however as long as each one is under $20 it should be fine. What components will I need to purchase outside of the "PICAXE"?
Im guessing a couple resistors and led right?
 
Ah ok, if you're building 8 then you might be able to get away with the picaxe version.

I'll put the parts together using an Australian store, and you can go shopping for a US place that does the same :p

1x Dev board kit: Z6101 - PICAXE PICAXE-08M USB Starter Kit - Altronics
This has the board you'll mount your PICAXE into to program it, the cable used to connect the board to your PC, and 1 08M2 Picaxe for you to get started with.

7x PICAXEs: Z6111A - PICAXE PICAXE 08M2 Microcontroller - Altronics

7x Battery holder: S5033 3 X AA Flat Battery Holder - Altronics

8x Mosfets: Z1555 2N7000 TO-92 N-Channel TMOSFET - Altronics

1x 10-pack Resistors: R7582 10k 0.25W 1% Metal Film Resistor PK 10 - Altronics

Now the only things missing are your bunches of red/white LEDs and an extra resistor per string of LEDs (you'll need to calculate value after picking what LEDs you want)

So far we're at a total cost of $83.75 for all 8, just the cost of your LEDs + resistor to go. And like I linked earlier, LEDs shouldn't cost you more than like 40c each max, and resistors are even cheaper (the pack of 10 above is 55 cents).

Your whole project will come out likely around $90 for 8, or $11.25 each. And that's at Aussie prices which are terrible :p
Any future projects you won't have to buy the expensive USB-to-serial cable either (which is the most expensive bit at ~$25).

For the circuit, follow the diagram from my last post except get rid of R1 and change R2 to a 10Kohm.
 
Last edited:
You have been a lifesaver! I am browsing PICAXEs store and I'm not sure if it ships to the US. As far as buttons go, I should just find one of the four pin ones right? Also, what is the symbol for the MOSFET?
 
Last edited:
Back
Top Bottom