You are here

Engineers and their Toys | Cypress Semiconductor

Engineers and their Toys

What is it with engineers and toys? You can't keep us away from them. Do we ever grow up?

Sure, we tell everyone that embedded applications are changing the future, connecting people, improving lives, saving them even, but we're not really interested. In reality all we want is a battery-operated controller with some flashing LEDs and a toy car to steer around the office when the boss isn't looking.

My mate Rajesh was in town last week and he told me about his latest pet project - and, yup, it's a toy car. Ever on the lookout for a cheap blog topic I asked him to send me a video, which he duly did, but he also made me promise to give out a big thankyou to his team; Sandeep, Rinku and Sriram. Well done lads, now - all of you - get back to those world-changing engineering projects we pay you for! From this point on I have to pretend to be a little indignant about the frivolity of it all when, really, I am a bit jealous that they didn't ask me to help.

Language: 
English

So, here it is. Not the first toy car to be driven by a PSoC and probably not the last. The recipe is simple enough.

  1. Purchase one battery-powered toy car
  2. Break it - this is traditional engineering practice
  3. Rip off the fancy plastic shell - we don't need stripes to make it go faster
  4. Apply liberal amounts of glue to whatever you find underneath and attach a FirstTouch kit (zip ties are an acceptable alternative)
  5. Insert a WirelessUSB (CYRF7936) kit into the 12-pin connector
  6. Do that configuration and software stuff and to program the receiver
  7. Find another FirstTouch kit and CYRF7936 and do more of that configuration and software thing to program the transmitter
  8. Spend hours driving it as fast as you can around the office - blame the cleaners for the damage to the walls

Here's the video - www.cypress.com/ui/2_5/images/blogs/userfile/ToyCAR640x480.mpg

Anyway, Rajesh will get all grumpy if I do not tell you about how it really works so here goes...

The transmitter uses the accelerometer on the FirstTouch kit to detect the orientation of the board and decide how to drive the car. The accelerometer is connected to the on-chip ADC through a software-controlled multiplexer. The software loop simply switches the MUX between the two inputs from the accelerometer (X and Y axes), reads the ADC, and sends a message (via a SPI interface to the radio) to the car if anything changed. The X axis controls steering (left, straight, right). The Y axis controls direction  (forward, backward) and speed from the angle of tilt. Accelerometer block (transmitter)


Turn control (receiver)

The receiver just listens for messages and does what it is told. It uses a control register to drive high/low signals out of pins to set the direction (both off = straight ahead).
The speed is managed with a PWM (pulse width modulator) with a software-variable duty cycle - the greater the duty cycle the faster it goes. Another control register controls a de-multiplexer, which channels the PWM output to the motor, driving it forward or backward at the desired speed. Speed/Direction control (receiver)

So there it is - a $10 toy car for only $150! Only one question remains really... Rajesh, where's MY damn car!

 

ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.