element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Techno Toys
  • Challenges & Projects
  • Project14
  • Techno Toys
  • More
  • Cancel
Techno Toys
Blog This little bug has a bug
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Techno Toys to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: idanre1
  • Date Created: 27 Apr 2017 5:07 PM Date Created
  • Views 3271 views
  • Likes 8 likes
  • Comments 12 comments
  • arduino_projects
  • ttoysch
  • electronictoych
Related
Recommended

This little bug has a bug

idanre1
idanre1
27 Apr 2017

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

image

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:

image

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):

 

image

 

The real deal:

image

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:

image

 

Update 2:

I have soldered the circuit on a perforated board.

This is how it looks:

image

and this is the back

image

 

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.

image

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.

image

 

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 image 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 image RowRowRow.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

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.

image

image

 

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

  • Sign in to reply

Top Comments

  • DAB
    DAB over 8 years ago +5
    Spoken like a true maker. Devices do not become toss away. They just transform into a newer and neater device. DAB
  • idanre1
    idanre1 over 8 years ago +2
    Moved comment to "update 1" section in main thread Idan
  • idanre1
    idanre1 over 8 years ago in reply to balearicdynamics +2
    Hi I agree with you using tip120 is better. I also got recommendation on irfp064n. The problem is that to my place it usually takes 3 week shipment. Using two 2n2222 is intermidiate solution.... The circuit…
  • Workshopshed
    Workshopshed over 8 years ago

    Great progress, glad to hear you got your motor driver problem fixed.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 8 years ago in reply to idanre1

    Got it. Very nice image Look forward to see the progress and some example of the result.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • idanre1
    idanre1 over 8 years ago in reply to balearicdynamics

    Hi

    Thanks for you generous reply and for the support!

    The toy itself have a speaker. I am in the last stage of making a streaming system.

     

    When you refer to reader I guess you talk about sd card reader.

    I have ordered one with 3 to 5 level shifter to support al kind of cards

    For Arduino Micro SD Storage Board Mciro SD TF Card Memory Shield Module SPI | eBay

     

    Since streaming music deserves a different thread I opened one.

    Streaming sound to arduino using serial

    I invite you to have a look:-)

     

    Idan

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 8 years ago

    Hello Idan, thank you for the mention; I am happy to read that the motor now is running. I suggest - if you have some buzzer around you - to complete the project - IMHO it is the worth! - making some notes in the different situations. You are always in time to reborn the project for further more sophisticated versions (i.e. with mp3 playing) as you get the pieces. Don't you agree? Despite the most quality option there are many other easy ways to make sounds, it depends on what is available to you in this moment.

     

    P.S. What is the reader you ordered for Arduino ?

     

    Enrico

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 8 years ago in reply to idanre1

    I see Idan,

    so with the two transistors in cascade we should expect it work (if the batteries have sufficient power). Keep us updated.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube