08m2 hall effect. Using an analogue interrupt

steviejay

Member
Hi
I have a kontiki (baitlauncher) timer,using a hall effect sensor. Its on youtube here http://www.youtube.com/watch?v=cu5nI02QUBU

I have the code OK for read adc, and switching the relay ok. But I cant figure out how to use " count" for an analogue input. Nor how to interrupt using another hall effect. I have tried setting up a reed switch, but even with a high value capacitor couldnt get reliable hi/lo.

So Im back to hall effects, as I can read above and below the threshold.
So two questions. Can I interrupt with an analogue number?
And how do I count "magnet swipes" within a given time"

I have read everything, and messed with all sorts of configurations and code

thanks for any help
Steve
 

darb1972

Senior Member
Hello Steve

Welcome to the forum. As e suggests, more detail is needed (so folks around this forum can provide the best help). I recently did a project involving hall effect (the project is in the final stages) and used a hardware interrupt (rising edge trigger) to overcome several issues. I am by no means an expert, but I will have a think about the analogue interrupt. My guess is that this would have to be done as a software interrupt.
 

darb1972

Senior Member
Hi Steve

Me again. Others will have to chime in here as this is probably out of my depth. Hippy (and others) were very helpful with my project and using the hardware interrupt to count "magnet swipes" proved extremely effective.

In regards to an analogue interrupt, if you were using an X2 PICAXE you could have used the COMPSETUP to setup the comparator/s to trigger the compflag and if I am not mistaken use that to trigger an interrupt. I am not sure what you would do with an 08M2.

Again, as e said, more detail please as I am just speculating at this point.
 

SAborn

Senior Member
Can you please supply:


a. A schematic.

b. Your full current program.
That must be Eclectic copy and paste comment as its always his first port of call to any question.
 

steviejay

Member
kontiki timer schematic.jpgThanks everybody for the interest

COde is simply
main: ;
low 2
wait 1
readadc C.1,b0 ; 'read ADC1 into variable b0
if b0 > 131 then tmer
if b0 < 120 then goto main ;

goto main

tmer:
high 2
for b1 = 1 to 3 ; 3 loops
pause 60000 ; wait 60 seconds
next b1


goto main

I found Fritzing for a schematic I which I think is accurate, 12v thru regulator, actuating an auto relayfor the main 12v motor
 

srnet

Senior Member
The diode should be across the relay coil.

You seem to have the 5V output of the regulator connected to a battery.

The regulator should have 0.1uf to 1uF decoupling capacitors between input and ground, and output and ground.

There should be an electrolytic, maybe 200uF or so across the output of the regulator.

There should be a 0.1uF ceramic capacitor across the 08M2 power pins, as close to the chip as possible.
 

westaust55

Moderator
When you use the READADC command , it automatically disables the digital input.
See ADCSETUP command.

Before you can use a digital command such as COUNT you will need to first use the ADCSETUP command.
 

steviejay

Member
THanks,
youre right I should have taken more care with the drawing, and had the artefact in front of me. I'll do it properly, and stop wasting your time. I do have the caps etc in place and there is just one 12v supply.
After work Ill get onto it.sorry
and thanks for the adcsetup..
 

steviejay

Member
kontikitimer with voltage regulator circuit and hall effect..relay.jpg
Thanks srnet, I have added the voltage regulator circuit as I have it on the kiwipatch board, but not the download utensils, which are also in place,
I will mess with the adcsetup command, essentially I want to:
swipe a magnet to initiate a time period to count up to 3 magnet swipes
if 1 swipe then activate relay for 15 minutes
if 2 swipes 20 minutes
3 swipes 25 minutes

but be able to interrupt it to turn the kontiki motor off if it snags a jelly fish or killer whale before I launch...
i will need another sensor maybe, reed switches may not take the dumping onto the sand..
thanks
Steve(not having fish for dinner...yet)
 
Top