New to PICAXE (and PIC's in general)

Calamitie

Member
Hi all,

First-time poster:
Name: Michael
Age: 15
Location: London, UK

I'm totally new to PICAXE and PIC's in general, but I've always loved electronics and never knew that such a device (a PIC) existed!

I can't wait to start playing around with one and testing out things such as the LDR...

Although I understand how to connect up and program a PICAXE chip, I still can't understand how I would use DC motors.

I realise (after reading manual two) that I can't directly connect motors to the PIC (due to the power issue), but how would I control the motor, from the PIC, via a seperate circuit?

Another question, based on the last, would be how children's toys (Furbie's, etc) can power a PIC and all of the motors from one battery pack?

I'm ordering the PICAXE-08 Starter Pack (with USB-to-serial cable), as well as a PICAXE-08M chip and a few devices (an LDR, a couple of LED's, a DC motor and a Piezo), to get to grips with the basics.

Thanks in advance
 

MORA99

Senior Member
If the motors require 6V, you can connect a diode in series with the picaxe and it will get around 5.3V
Several diodes will drop even more if needed, thats a simple way of using one supply to both.

If you just need to turn on and off the engines you can use a transistor.
Dont know if that works with pwm too.
 

atharvai

Senior Member
for more info try searching the forum. I remember this topic being posted ages ago.. worth a try

good luck with the PICAXE's
 

BeanieBots

Moderator
For simple on/off control of a motor, you will need a transistor as suggested by MORA99. Have a look in manual1 interfacing circuits.
A transistor can be driven with PWM to give speed control.
To be able to control the motor in both directions, there are two options. Either a relay to reverse direction and transistor for on/off/speed, or a circuit known as an H-Bridge. I would not recommend building your own H-Bridge to a beginner but there is a very handy IC that does it for you. The L293D. Several of the PICAXE boards come with a socket ready wired to take one. Check out some of the ready made boards from Rev-Ed. eg Motor Driver board for 08M.
 

Calamitie

Member
Thanks for the replies.

I hate people that post a basic question without searching too, but I didn't realise that the PICAXE forum had a search feature...

I read manual 1, but I don't remember seeing anything about motors.

Also; is it possible to program PICAXE's to play pre-recorded sounds/voices - if so, does it need to be encoded into a special format for compatibility (without a decoder)?

Thanks again
 

hippy

Technical Support
Staff member
Forum Search is top right of the page if you haven't already found it.

Interfacing motors is described in PICAXE Manual 3. As to how Furbies etc get by with just one battery pack controlling everything, that really boils down to the choice of motor and designing the circuit to avoid any interference it may cause. The Furby is a stunning piece of clever engineering using just one motor; it's well worth checking out the "Furby Autopsy" sites.

The PICAXE can play sounds ( SOUND and TUNE commands ) but if you want to get speech or other real-world sounds it needs to use external hardware and decoders. That's not necessarily as expensive nor as complex as it may sound.

And one final thing ... Welcome to the PICAXE.
 

Rickharris

Senior Member
In addition to transistors you want to have a look at Darlington drivers and also some of the dedicated motor driver chips such as the L293D intended to drive stepper motors but also good to drive 2 separate DC motors forwards and Reverse. great if you get a yearning to build robots or similar.
 

Calamitie

Member
Thanks again for the great replies :)

I just have a few more questions (which probably sound so stupid to you all...)

1) Does the programming editor compile (into HEX?) the BASIC source code, or does the raw source code get sent to the chip and then the chip interprets it on-demand?

2) Apparently a solar motor can be connected directly to a PICAXE chip pin (unlike a generic DC motor?); is that true?

3) This probably depends on if the source code gets compiled, but; can the PICAXE chip be re-programmed by a seperate program (not the programming editor) to add the ability of a firmware upgrade/update for PICAXE products? - I could program a Visual Basic serial connection program, so the actual program wouldn't be an issue, just the possibility of it actually working...

I hope I've explained that sufficiently and I realise you all have better things to do than helping a 'newbie'(?), but I would really appreciate it.

Thanks in advance
 

hippy

Technical Support
Staff member
<i>I just have a few more questions (which probably sound so stupid to you all...) </i>

Not at all.

<i>1) Does the programming editor compile (into HEX?) the BASIC source code, or does the raw source code get sent to the chip and then the chip interprets it on-demand? </i>

It's not the exact source code which gets sent, but an encoded and compressed representation of the source code. That 'tokenised' code is then interpreted on-demand.

<i>2) Apparently a solar motor can be connected directly to a PICAXE chip pin (unlike a generic DC motor?); is that true? </i>

Pass. Trying to draw more than 25mA from any I/O pin can destroy the PICAXE.

<i>3) This probably depends on if the source code gets compiled, but; can the PICAXE chip be re-programmed by a seperate program (not the programming editor) to add the ability of a firmware upgrade/update for PICAXE products? </i>

There is no mechanism available to upgrade PICAXE Firmware.

There is no program available other than the Programming Editor which can be used to download a user program into a PICAXE. The details required to allow that to be done have not been, and probably will not be, published by Rev-Ed.

Edited by - hippy on 03/05/2007 20:53:12
 
Top