Basic PicAxe Info

pntrbl

New Member
I would like to log data from an anemometer over the next year or so, which led to buying an AXE110 datalogger and an RTC for it. The AXE110 arrived and I was hoping for a CD with some tutorials that resembled what I'm trying to do, but all I got was a little pamphlet with general info. :mad: There are wizards to set how many samples and when, but I'm afraid I need even more basic knowledge of how these things work.

Specifically, I'll have a train of pulses from a hall-effect sensor to work with. I'll need to count those pulses against time for a result that needs to be logged at set times. I'm sure an 18x can do that but I haven't a clue how to go about it ....

Ideally I would like access to more tutorials. Typing in a program and then altering it to see what happens is about the only way to get this stuff thru my thick skull. What I don't want is someone to write a program for me! :D

So , considering my entire PicAxe resume consists of making an LED flash on an 08M proto board, can someone steer me to a "PicAxe for Dummies" website?

SP
 

westaust55

Moderator
I note this is an extension of your earlier thread:
http://www.picaxeforum.co.uk/showthread.php?t=10487&highlight=anemometer
but not to worry.

Typically, no book or on-line tutorial is going to is going to cover exactly what you want.
The PICAXE manuals and in particular part 2 covers all the BASIC commands.

Those on this website will help as well, and likely better than any other forum when it comes to the PICAXE as it is run by the PICAXE manufacturer (Rev Ed) and “manned” by a Rev Ed representative (Techncial) and many PICAXE enthusiasts.

To get you started . . .

Have a look in Manual 2 at these commands:
PULSIN – will measure the duration of one pulse if present at an input pin and give a duration. Max duration 0.6 sec at 4HMz clock frequency.
COUNT – this will count how many pulses occur in a specified duration. Up to 65sec duration at 4MHz and pulses at up to 25kHz.

So, if that is your only process, you could use the COUNT function for 1 minute and then calculate the 1 minute average wind speed and store each value.
 
Last edited:

pntrbl

New Member
Thank You Westaust55! Pulsin and Count huh? If that's not exactly what I'm trying to do I dunno what is ...

I have to admit I didn't spend much time on Section 2. I think it was Infrain that scared me off.:D

Thanx again.

SP
 

BeanieBots

Moderator
So , considering my entire PicAxe resume consists of making an LED flash on an 08M proto board, can someone steer me to a "PicAxe for Dummies" website?
You're exactly where you need to be HERE!
Have a good read through manual 2 (Basic Commands).
Each command has a description of what it does and a simple example of how to use it. It might not obvious at first why/when you need each command but once you know a few of them, it will then start to make sense how they bolt together. That is the time to read it all again.
There are also quite a few 'exampler' projects that are worth reading through. These will help you with how programs are put together. After going through a few of those, you should be in a position to make your questions a little more specific and this forum will be able to answer those questions.
 

hippy

Technical Support
Staff member
Typing in a program and then altering it to see what happens is about the only way to get this stuff thru my thick skull. What I don't want is someone to write a program for me! :D
An excellent attitude and approach and as BeanieBots says; you're in the right place. Welcome to the PICAXE.

That's also the way I like to work; see it, try it, alter it, understand it. Not everyone agrees but whatever suits you is what I say.

You're probably feeling a little lost but, like map reading, if you learn a little at a time you will soon have the skills to getyourself wherever you want to.

The first thing I suggest is getting familiar with is SERTXD command and using the Programming Editor Terminal window. This is great for seeing what's happening inside the chip when running and is far superior to DEBUG in my opinion. There's also the Simulator ( and VSM ) if you want to get a feel for what your code does without running it on a real chip.

With SERTXD you can have your code do something and then report back what it did, so for example your first ever COUNT program could be something like -

Code:
Do
    Count ... , w0
    SerTxd( "Counted = ",#w0,CR,LF )
Loop
From then on it's just a matter of trying new things and building on the knowledge and experience you have gained. Plenty of people here will help if you get stuck, lost or just dazed and confused. For 'weather logging' we even have some people experienced in just that who are usually happy to help out.

A few words of advice ( applies to everyone ); the more specific you can be as to what problem you are having and the more concise you can be with what you want ( a pointer to which manual, example code, the code writing for you, or just advice etc ) the more likely you are to get what you are hoping to recieve.
 

pntrbl

New Member
Thanx for all of the previous responses. I am dutifully studying up in Section 2.

I've just spent a little time in Section 3 looking at interfacing. What I've got is a hall effect generated 12v pulse I'll need to count, so I need to get that down to <5v for my AXE110 datalogger. Will a simple voltage divider do? 4.7K in series with a 3.3K?

The hall effect is an open collector than can sink up to 20 mA so I'm also considering a low power zener to clip it off. A BZX79C4V7 is a 4.7v zener that can run on 5 mA.

Either or? Maybe a better way? :D

Thanx for any and all advice.

SP
 
Last edited:

hippy

Technical Support
Staff member
If your sensor is open collector then ( even if separately powered from 12V ) you can use it direct with a 5V PICAXE simply with a pull-up resistor to 5V and taking it straight to a PICAXE digital input. No need for a voltage divider.

An open collector output behaves as if it were a switch from output to 0V so there's no intrinsic voltage coming out from there.

Also, just like wiring switches in parallel so any can turn on a light bulb, you can connect multiple open circuit outputs in parallel. You could therefore have multiple hall effect sensors placed around the shaft of whatever's rotating to get more pulses per revolution and you'd still only have one signal wire into the PICAXE.

You might not need it in this case but it's very handy in others, such as measuring bicycle speed ( via wheel rotation rate ) which is a variation of what you're doing. Especially useful when something is rotating quite slowly.

The other advantages of multiple sensors triggering per rotation are that any count goes up quicker so you have larger readings and can keep better accuracy when processing the data or sample over shorter periods to keep speed of processing up.
 

pntrbl

New Member
Thanx hip. A 5v pullup it will be. I have this tendency to use 42 parts where one will do. :rolleyes:

Interesting thoughts on the multiple sensors too. I kinda went at it from the other way around for once in my life by using part of a 350 Chevy distributor. It's a magnetic rotor with fingers wrapped around the outside that give it 8 N-S poles around the circumference. Got one sensor pulsing 8 times per rev. :D

SP
 
Top