Friday, October 16, 2015

Toy Jeep Makeover

A RC toy jeep is gutted and transplanted with a new controller, a Bluetooth communication module and new sensors.



Toy RC Jeep Newbright Rubicon $9.99
  • One drive motor and one steer motor
  • 49MHz RC
Microcontroller PSOC4 CY8CKIT-049-42XX $3.99


  • PSOC4200 Cortex-M0 processor with digital and analog peripherals
  • USB serial bridge

IMU GY-512 6 DOF MPU-6050 module  $1.94

  • 3-axis gyro and 3-axis accel
  • Motion processor for orientation output







Bluetooth CC2541 Serial Bluetooth 4.0 BLE transceiver module $2.45
  • Bluetooth






Sonar Ultrasonic module HC-SR04 $0.90
  • distance output to 5m





Motor driver DRV8833PWR $0.90
  • dual H-bridges
Power regulator LTC3429

  • 0.5-4.4V input 
  • 3.3V 600mA output


Friday, October 9, 2015

3.3V and 5V Systems

High performance logic has long moved to very low voltages (sub 1V) demanded by nanoscale fabrication technology.  But a lot of systems still use 3.3V and 5V signal interface.  A common problem is interfacing between 3.3V and 5V.  A signal from 3.3V can usually drive the 5V: the TTL minium VIH is 2V, so there is no problem; however, the CMOS is a little borderline, with VIH is usually 0.7*VCC = 3.5V; if the speed is relatively slow, 3.3V can switch correctly.

Going the other way is a little more problematic.  The problem is usually the ESD protection diodes; they will turn on when driven by a 5V signal in a 3.3V supply voltage.  If the drive is robust, it can destroy the protection diode and damage the module.  The safe current limit is usually about 10mA.  So we can place a resistor in series to limit the current.  10mA is actually a lot of current, if the speed is not of concern, the current can be a lot lower, 1-2mA.  The resistance is (5-3.3-0.5)/2m = 600Ohms to 1200Ohms; 1K is a good value.  Sometimes the driver is weak and the output voltage drops quickly when starting sourcing a few milli-amps; it can be connected directly.  However, it is better to be safe.  Other scheme is to use a diode in series, some even suggested using an LED which has a turn-on voltage of 1.7V.  But a resistor has to be used to either pull up or pull down.

Another issue is the voltage supply.  We can start with 5V and drop to 3.3V with an LDO.  Sometimes the system is predominantly 3.3V with only very low current requirement for 5V.  In such a case, a simple charge pump circuit to generate 5V from 3.3V is actually convenient.  Here is the circuit diagram,
an the constructed board (also including a series resistor for signal interface),
It supplies a few milliamps quite nicely.


Wednesday, September 30, 2015

A Cheap Sonar Module

For less than $1, I bought a HC-SR04 sonar module on eBay.  It can't get cheaper than this.

I was a little disturbed first when I saw the circuit board.  Two of the ICs have no labels.  And the layout appears different than other HC-SR04 module.  A quick test seemed to confirm it actually worked.

Sunday, September 27, 2015

A Lithium Ion Battery USB Charger

A simple linear battery charger that draws power from a USB port is designed for 14500 lithium ion battery (which is about the same size as a AA battery).  The circuit diagram is shown below with a Linear Tech LDO, but others LDO can be used.
The actually construction uses an Analog Device LDO, which features a comparator that is used to indicate the charging completion.



Wednesday, June 3, 2015

1W Cool and Warm White LEDs

The 1W cool white (6000-6500K) and warm white (3000-3500K) LEDs are driven by 350mA.  The LEDs are mounted on 20mm Aluminum base heat sink plate. The forward voltages after the temperature stabilizes, which is quite warm are 3.18V and 3.04V respectively.  The difference could be due to that the two types are from different vendors.  The plates are hot, probably over 70C (cannot touch for more than 1-2 seconds).  The LEDs seem fairly tolerant of over current; it survives 1A current with the forward voltage at 4.2V.  That's why some of the cheap LED flashlight can get away with direct battery power with any electronics.


The image is taken with 1/2000s exposure with f/8.0; the center of LEDs are saturated.  If we take the measurements at the rims, the cool white LED has RGB composition of .60, .56, .77 and the warm LED .80, .56, .47 .

Here eight 1W cool white LEDs are mounted to a desklamp replacing a 12W fluorescent tube.  A 350mA constant current power supply module drives the 8 LEDs in series.



After some time, I had two LEDs in the lamp failed.  The faulty LED would started blinking; it shut itself off probably due to overheating then recovered after it cooled off.  The forward voltage of the faulty LED becomes much higher: starts off around 3.8V and would increase rather than decrease as it heats up until shutoff; it is still operable at lower current.  To increase the reliability of lamp, I made them into two parallel strings, so they operate at much lower current at the expense of lower brightness (but still plenty of light).

Thursday, May 28, 2015

BeagleBone Black Display

BeagleBone Black is a nice little board, but mine came with no HDMI display: the monitor could not detect a HDMI signal.  I tried different monitors and cables with same result.  I researched online and tried different versions of software distribution, but no luck.  Although it is not essential to have the HDMI display, it is a little upsetting to miss this feature.  As my frustration grew, I read someone wrote that his problem was with the micro HDMI connector.  With naked eye, there did not seem anything wrong.  When I looked under a microscope, I noticed that one pin might not solder correctly.  I quickly verified the broken continuity.  After slight touchup with a fine solder tip under a microscope, the HDMI display miraculous started to work.  It turned out that Pin 19 (+5V) was loose.  Now it works nicely on an HDTV with 1920x1080 resolution (24Hz).  The connector certainly did not come to my mind as the possible problem; people have mentioned about bad cables, but not the connector.  In my experience, the interconnect contributes to the most hardware problems and should be the first thing to check.  But in this case, the potential software issue seemed to loom large.


On a related one, when using a monitor, the software synergy is very useful for sharing keyboard and mouse.

Wednesday, April 15, 2015

Reading AoE3


I read the 2nd edition from cover to cover in about 10 years.  And I just read the 3rd edition in about one week.  I used to say everything I knew about electronics I could find in AoE.  Now I probably do know a few things that are not covered in the book.

The book cover has been upgraded from silver to flashier gold color.  I don't fault them for considering it as the gold standard in books on electronics.

This book deserves a 5 star rating.  The true value of the book is that it is not an academic text book.  It contains a wealth of practical information, in charts, tables, and graphs, no other books come close. The jewel of the crown is the chapter on precision circuits.  The chapter on noise is equally rich.

However, I did not like the elimination of the circuit ideas section and replacing it with a chapter review.  Omitting the circuit construction is also a loss because prototyping and making the circuit board are an essential art that separates practitioners from theorists.  I also lament the elimination of the chapter on RF.  This book constantly refers the reader to the so-far unavailable "The x-Chapters" book; it is somewhat irritating to me that I'll have to get another book.

I wish it had fewer annoying trivial errors (how could you not catch a flipped diode on Fig 1.78?) ; 25 years ought to be enough to get it perfect.

So if you are a newcomer, you could still choose the 2nd edition because you can probably find a bargain now.  But I won't let go my 2nd edition.

The new edition is 0.7" wider, 67 pages more with smaller font and narrower margin.