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.

Hello, im new and need some help!

Status
Not open for further replies.

slopagafud

New Member
Hello everyone my name is Dan and im new to this. I dont have much of an understanding of how circuits work, but, I can use a soldering iron and a multimeter rather well and build/repair things with the aid of a good schematic. That being said, heres my problem: I need to build a timer to turn a 9v device on for 10min, off for 20min, on 10, off 20, and on another 10 min before shutting off completely.I need it to run off a regular 9v batt and be as small as possible.Thankyou for any help you can offer.
 
You may want to use a microcontroller.
I use the "Picaxe microcontroller".
Very easy to program.

'Untested code for the picaxe microcontroller with no syntax errors. eg.
Code:
switch on 1   [COLOR=seagreen]‘ switches on output 1[/COLOR]
  for b1= 1 to 10
   wait 60   [COLOR=seagreen]‘ waits 60 seconds, 10 times (10 minutes)
[/COLOR]  next b1
 
switch off 1   [COLOR=seagreen]‘ switches off output 1[/COLOR]
  for b1 = 1 to 20
   wait 60   [COLOR=seagreen]‘ waits 60 seconds, 20 times (20 minutes)
[/COLOR]  next b1
 
 
 
 
switch on 1   [COLOR=seagreen]‘ switches on output 1[/COLOR]
  for b1= 1 to 10
   wait 60   [COLOR=seagreen]‘ waits 60 seconds, 10 times (10 minutes)
[/COLOR]  next b1
 
switch off 1   [COLOR=seagreen]‘ switches off output 1
[/COLOR]  for b1 = 1 to 20
   wait 60   [COLOR=seagreen]‘ waits 60 seconds, 20 times (20 minutes)
[/COLOR]  next b1
 
 
 
switch on 1   [COLOR=seagreen]‘ switches on output 1[/COLOR]
 for b1= 1 to 10
  wait 60   [COLOR=seagreen]‘ waits 60 seconds, 10 times (10 minutes)[/COLOR]
 next b1
 
switch off 1   [COLOR=seagreen]‘ switches off output 1[/COLOR]
 
Last edited:
Ok, I did a little research and found out about the "picaxe" It seems simple enough, but which one do I need and how would I go about wiring it into my device? Can I still use the toggle switch already installed on the device and have it shut off after the 3rd cycle? What would be the best way to do this?
 
Last edited:
You can use any picaxe chip. The bigger chips just have more outputs.

Downloading the online picaxe manual will tell you all you nead to get started.
 
Dan,

I agree with Screech...A Picaxe could do exactly what you want...cheap and easy. Since you are only turning on only one 9v device, I would suggest the Picaxe 08M. This is an 8 pin Dip with one dedicated input pin, one dedicated output pin, and 3 selectable input/output pins.

Two questions:

What starts the timer?

Since the Picaxe must have power to run, do you want it to continue to be powered after it shuts off the 9v device?

Ken
 
What I would like to do is basically push a button,have the device run through the cycle and turn off completely.If possible I would like to set it up so if the button was pushed while runnung it wouldn't affect the current cycle.
 
Dan,

I have exactly that circuit for the Picaxe 08M. :eek: How much current does the 9V device draw...and do you want the high side of the device (+9v) switched or the low side (-9v or common)?

Ken
 
+ side is switched already(toggle), and as far as draw goes I cant really see it being much. The device is called a "ZAPPER", it takes voltage from a 9v batt and outputs about 9v @ 30khz to two contacts on a dog harness. It is part of a treatment for my dogs heart disease. **broken link removed**
 
+ side switched & not much draw at all.
 
Dan,

Attached is a Picaxe circuit I've used for a pushbutton start and program shut down. This could be used by adding a few program lines to screech's program.

Ken
 

Attachments

  • PicaxePowerSwitch9V.jpg
    PicaxePowerSwitch9V.jpg
    31.8 KB · Views: 273
Im gonna give this a shot.Thank you so much for your help!
 
KMoffett said:
Dan,

Attached is a Picaxe circuit I've used for a pushbutton start and program shut down. This could be used by adding a few program lines to screech's program.

Ken

OK I have almost everything I need to build this but Im stuck on the programming. Ive been playing with the programming editor and using the simulator to check my work but I dont know which pins do what other than p1 & p8 power the picaxe, and p2 is in, and p7(0) is out.Other than that I dont understand how the circuit works to write the program.
I also have one other question, does this circuit have an output voltage of 9v,or will I have to use a relay? Thank you for any help you can give me.

Dan
 
Dan

The first thing you will need to do is make a programming cable. This can be
found in the manual on page 27:

https://www.electro-tech-online.com/custompdfs/2008/01/picaxe_manual1.pdf

I've included a new schematic that includes the cable and two resistors (R6 & R7) that are part of programming circuit. The connectors P1/J1 can be any small 3-terminal connectors such as 3-pin headers, or miniature stereo heahphone connectors. This allows you to program your Picaxe in-circuit, and disconnect the computer cable when you are ready to use your treatment device.

One thing to be carefull about when wiring and programming the Picaxe is the difference between the chip's physical pin numbers, and "pin" numbers in the program. Sometimes it causes confusion.

The transistor Q3 will switch the 9v on and off to your 555 circuit.

P1 will be used to turn on the power hold function.
P4 will be used to turn your 555 curcuit on-off-on-off.

I've added my power function to screech's program and modified it for the appropriate pins.

This should get you started.

Ken
 

Attachments

  • PicaxePowerSwitch9V.jpg
    PicaxePowerSwitch9V.jpg
    44.5 KB · Views: 186
  • Picaxe Power Switch 9V.txt
    855 bytes · Views: 164
Last edited:
Ken,
thanks so much for all the help! I already started building the programmer with parts I had laying around, but I was thinking of just wiring direct instead of using the jack. The only problem I could see about that is that the cable would be dedicated to the 08M.
 
Dan,

3AM epiphany :(...screech's program wasn't using my output transistor Q3, which inverts the output of P4, so I attached the revised program.

Having the programming cable detachable would seem important if the unit has to be attached to a dog harness.

I haven't bench tested my circuit with yours, so it may take a little tweaking of R4 and R5 to be sure you get a full turn-on and turn-off of the pulser.

Since I have a little background in Biomedical Engineering...What's the purpose of you pulser? .........OKaaaaaa, I found this:
**broken link removed**

Code:
Start:	'Turn on power-hold circuit

	High 1
	
OnOffOnOffOnOff: 'Operate pulser circuit

	Low 4   ‘ switches on transistor output
  	for b1= 1 to 10
   	wait 60   ‘ waits 60 seconds, 10 times (10 minutes)
 	 next b1
 
	High 4   ‘ switches off transistor output
  	for b1 = 1 to 20
  	 wait 60   ‘ waits 60 seconds, 20 times (20 minutes)
  	next b1
  
	Low 4   ‘ switches on transistor output
  	for b1= 1 to 10
  	 wait 60   ‘ waits 60 seconds, 10 times (10 minutes)
 	next b1
 
	High 4   ‘ switches off transistor output
  	for b1 = 1 to 20
   	wait 60   ‘ waits 60 seconds, 20 times (20 minutes)
 	 next b1

	Low 4   ‘ switches on transistor output
	 for b1= 1 to 10
	  wait 60   ‘ waits 60 seconds, 10 times (10 minutes)
	 next b1
 
	High 4   ‘ switches off transistor output

Terminate:		'Turn off power-hold circuit

	Low 1
	Stop

Ken
 
Last edited:
LOL!Thats it! I built mine from her book. Back in July my dog became suddenly sick and almost died she was diagnosed with a rare heart disease (vegitative endocarditis)and 2 different vets didnt give her but a few weeks to live. I seriously believe this device and a radical change in her diet is keeping her alive.Zapping her has become quite a chore though because I cant keep her still long enough to use the origional rig and the new"harness rig works great except turning the unit on and off at these intervals has also become a chore.She thinks its a game and makes me chase her for a while, and this is the reason for building the timer. Ive got some pics Ill post later.
 
the first zapper i made in haste but was easy to use because Pearl(my dog) was very lethargic https://i22.photobucket.com/albums/b307/slopagafud/zapper/zapper003.jpg

It used the inner skeleton from some old earmuffs and wrapped it with bare wire and covered with cloth medical tape https://i22.photobucket.com/albums/b307/slopagafud/zapper/zapper004.jpg

The new prototype "the harness" makes things much easier https://i22.photobucket.com/albums/b307/slopagafud/zapper/zapper006.jpg, https://i22.photobucket.com/albums/b307/slopagafud/zapper/zapper007.jpg

This is Pearl modelling it for you https://i22.photobucket.com/albums/b307/slopagafud/zapper/zapper008.jpg

By the way,As far as the programmer goes is it really necessary to build it into the circuit? I was hoping to program it and use the programmer to test it on a breadboard remove the pic from the programmer and install it in my project via an 8 pin retention contact.Would this not work? Keep in mind I want to make this as small as possible.The enclosure im using is much bigger than I will be using for the finished product, and gets her stuck in her doggie door sometimes.
 
Yes, the Picaxe can be programmed on a breadboard, and moved to your final circuit board. This is what I would do on a finished unit. The only disadvantage is if you are tweeking you program a lot.

Cute pup! :)

Ken
 
Ken,
I just have to bother you again with another question.IM thinking of adding a 2nd led to the device as a "system on" indicator, and keeping the original one to tell me when the pulser is on.
 
Good idea...I added R8 and D2 to the schematic. I labeled it GREEN but it could be any color.

Ken
 

Attachments

  • PicaxePowerSwitch9V.jpg
    PicaxePowerSwitch9V.jpg
    48.8 KB · Views: 202
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top