My little daughter threw away this toy and it just stopped working.

Assembled

I had two options:

1. Find the bug and fix it

2. Replace the whole inside with cool stufff.

 

This is the room i have inside:

20170427_193608.jpg

Originally the toy came with 1 motor. There is enough room for two dc motors. Also i have arduino nano and a bluetooth receiver.

The remote control can be my phone, or  i have ps4 remote which is also bt. I just need to figure out if it can be connected to arduino.

 

Update 1:

I have been trying to play with the motor a little bit.

I have been using  2N22222N2222 transistor connected to pwm pin 6 in arduino to drive a simple DC motor driver

I also put IN4007 to protect the arduino against back EMF.

The motol itself was already soldered with 104 capacitor.

 

This is the code i have used:

int MotorPin = 6;  
void setup() {  
pinMode(MotorPin, OUTPUT);  
}  
void loop() {  
analogWrite(MotorPin, 200); //Any value between 0 to 255
delay(4000);//Wait for 10 secs
analogWrite(MotorPin, 100); //Any value between 0 to 255
delay(4000);//Wait for 10 secs

 

 

This is the system I have used (only diff is arduino nano instead of uno and a transformer of 7V instead of a battery):

 

motor.jpg

 

The real deal:

As you can see i am using to original motor from the toy, the black box has a nice mechanism, if you operate the motor with positive polarity both weels turn the same direction, and if you are using reverse polarity each wheel turns a different direction! this way the toy can do acceleration and turn with the same motor.

 

I have been experienced something interesting phenomena that i can't explain:

The code was running for 2 min and after a while, the motor just started operating in a higher speed using the same PWM values.

Is this related to the motor getting warmer or something does it related to  2N22222N2222 operating temperature

I think the increase is about 20% (eye measure)

 

Question for the readers:

The toy itself has a place for 4 AA batteries, it means 7V - PN junction equals ~~ 6V

Do you think I can use a higher operating voltage to make the motor faster or it will be fried?

Without breaking the black box this is the kind of motor i think i have inside:

 

Update 2:

I have soldered the circuit on a perforated board.

This is how it looks:

and this is the back

 

Now I only need the board and stick it inside.

 

The toy face has a cute button that used to make sound when you press it.

I plan on drill a big hole and put all the electronics inside the face, since in the body there is no much space because of the motor.

 

Update 3:

I having a problem with my circuit.

bug.png

 

I hope you could see the circuit.

Basically there is a toggle button, if button is pushed than motor should drive, if popped then it should stop.

The third connection from the arduino (except the power/gnd) is the motor control wire which connected to the board I have made and explained in update 2.

It worth mentioning the board is assembled with  2N22222N2222 transistor and 4.7K resistor as explained above

There is also indication, the arduino led is on every time the motor should drive.

 

For some reason when the motor in drive state, it just making weird buzz and don't turn, in rare cases it does.

If I remove the motor when the button pressed and test the open circuit voltage of the motor wires (in the board) I see 6V, but when the motor is connected I only see 0.5V with the multimeter.

So for some reason the motor itself dropping down the voltage.

 

Does somebody understand what's I'm missing?

Am I using wrong type of transistor? wrong value of current limit (the 4.7K in the board)?

 

Update 4:

Using balearicdynamics help I managed making the motor running.

Changing the single transistor to a darlongton pair did the job!

The motor now running without any issue.

Now I can go ahead and continue the proto typing.

I thought maybe adding some music while the bug is moving forward and another while spinning.

 

I have ordered sdcard reader for arduino but meanwhile maybe streaming the music from bluetooth is a better solution because probably I will not get the module on time.

 

I found someone doing it but more work is needed.

Will keep you posted

 

Update 5:

When I started making this project, I have ordered H-Bridge and bluetooth module for arduino. Shipping to my country takes allot and they havn't arrived yet.

Since time is runnig out, I have made a motor driver from darlington pair (for only 1 direction - no H-Bridge) as mentioned above and the communication to the toy is currently from a wire and not wireless since I don't have the BT module.

I managed to stream sound from serial port to arduino, You can check my post: Streaming sound to arduino using serial

     What more special about the streaming code is that you can command the arduino doing things meanwhile you playing music without interrupting the sound.

For this project I have added two opcodes to the streaming program: 'm' to turn on motor and 'M' to turn off the motor.

In the video below you can see they toy playing the streamed sound and behind the scenes I randomally turn on/off the motor from the computer keyboard.

Also if you have ffmpeg+perl you can actually play every sound/movie file you want which could be nice to have. The gitub readme has the info + scripts for linux

 

I chose for the demonstration kids song which I think suitable for motor like toys RowRowRow.

 

Inner implementation I did:

Only the circuit I am holding is my work.

The big PCB on the purpule part is the old one, I just never bothered to remove it and its disconnected from power and not playing part now.

20170606_083329.jpg

20170606_083403.jpg

 

I think this video and the photos are a proof of work that concluding this project, if somebody think I should add more info please share your thought with me.

This project was allot of fun for me, hope to do more in the future

Thanks anybody who helped me along the way.

 

Regards

Idan Regev