General question about converting toys to use Picaxe

I have several motorised toys that I would like to convert to become programmable devices. I have several Picaxe developer boards and thought that it should be possible to use these to turn on/off the various options within the toy depending on the code. The toys in question have several simple push switches. What I would like to do is to keep the functionality of the existing switches but add the functionality of being able to control them via the Picaxe board. Looking around various sites, I believe that I could use a micro-relay or N2222 transistor but would like someone to explain the best way of doing things. :confused:
 
I have a supply of the Picaxe 18 pin project boards (CHI030 & CHI035) that I can use.

The toys are large Tonka toys as in the photograph. The 3 levers are slider switches which control the 3 motors (toy forwards/backwards; arm up/down; shovel up/down). There are also two push switches beneath the driver's door which sets off various sounds and lights.
digger.png

I would like to be able to also add a sonic device (SRF05) to ensure that it does not hit anything when moving forward. What I would like to do is to leave the current leavers/buttons in working order and "piggy-back" the microcontroller onto the existing circuit. There is plenty of spare space in the digger's cab to house the project board.
 

eclectic

Moderator
Sounds interesting.

So, am I right in assuming

The PICAXE controls the SRF05.
Any "obstacle" and the PICAXE stops the motor / reverses.

And, what is the Tonka's power supply?

e
 
Yep - what I would like is that the toy can be programmed to perform various actions eg. move forward until something is found, beep/flash lights, raise shovel and reverse etc.
Currently the toy is powered by 4 x 1.5 (C type batteries). There is plenty of space available in the cab space to have another power supply just for the picaxe or maybe the one could power both?
 

eclectic

Moderator
It's starting to look good. :)

Can you check the current draw / resistance of each motor?

The ULN2003 or the FET's on the boards
are probably OK, but it's always sensible to check.

And as an aside. Four D size cells.
If Alkaline, they'll cost a small fortune to replace.

I suggest 5 x AA NiMh rechargeables.

I assume you're "tooled up"?
Multimeter / soldering gear / breadboard ...........

e
 

AllyCat

Senior Member
Hi Robert,

The 3 levers are slider switches which control the 3 motors (toy forwards/backwards; arm up/down; shovel up/down). ...... What I would like to do is to leave the current leavers/buttons in working order and "piggy-back" the microcontroller onto the existing circuit.
So the switches are wired directly to the motors? In that case you can't (shouldn't) just connect the PICaxe control transistors in parallel with the switches because there is a risk that the PICaxe will try to drive the motor "backwards" whilst the switch is "forwards" (which is likey to damage something).

There appear to be two strategies: The PICaxe could "monitor" the switches or motors and not try to drive a motor if its switch is closed, or (IMHO better) you could disconnect the present switch-motor connections. Then connect the switches to PICaxe inputs and motors to outputs (via transistors and/or relays). However, the latter may not be easy, for example if some of the connections are moulded into the plastic body of the toy.

So we really need not only a basic "circuit diagram" (and typical/max motor currents) but an indication of which parts of the circuit are "modifyable". There's no point in us trying to guess whether motors should be high-side, low-side or H-bridge controlled, or whether the switches are active-high or active-low, etc..

Cheers, Alan.
 
Top