Zobrazují se příspěvky se štítkemhw. Zobrazit všechny příspěvky
Zobrazují se příspěvky se štítkemhw. Zobrazit všechny příspěvky

neděle 10. května 2020

Wireless headphones Thomson WHP3001BJ doesn’t charge

I got these headphones from second hand and out of warranty, but it seems the model is still manufactured (year 2020). It's old good analog technology - simple, reliable and budget friendly. It will probably not satisfy you if you are Hi-Fi purist, but for occasional TV watching or for parents it‘s quite OK. It comes with a base which can be used as a stand and it should charge the two AAA batteries in the headphones. But unfortunately in my case the charging didn’t work.

At first I checked the contacts on the base and on the headphones - both seemed OK. Then I measured voltage on the charging pins of the base, it was also OK. So I connected variable resistor to the charging pins to verify the charging procedure. It seems it’s simple constant voltage charging (I didn’t expect anything else in this price range). It can do max cca. 100 mA charging current and the charging LED indicator goes out when the charging current lowers bellow cca. 25 mA. So it didn’t stop the charging and the batteries are charged all the time when connected to the base. This means two things: the charging of fully discharged batteries can take pretty long (10 - 20 hours or it may be even not possible to charge old batteries at all) and the life of the batteries will be probably slightly reduced by the low current which flows into the batteries all the time. This is interesting observation, but it didn’t help me with my problem.

Next, I disassembled the headphones. The power supply PCB is pretty simple, just the power switch, one diode and some condenser filters. By checking the PCB the problem was clear. Despite of being so simple, the power supply wiring seemed a bit over-engineered. There are second contacts for the battery GND (the "-" contact) that are offset from the battery end. These contacts are not apparent without disassembling the headphones. After a bit of thinking I realized that it’s probably ugly protection from insertion of non-rechargeable batteries. It seems you need specially modified rechargeable batteries with protracted GND strip. If you insert unmodified non-rechargeable batteries (1.5 V), the second GND pins will not connect and it will not charge. Also the diode will lover the voltage by cca. 0.6 V, so the resulting voltage will be 2 x 1.5 V - 0.6 V= 2.4 V, which is the same voltage as if powered by the re-chargeable NiMH batteries (1.2 V), i.e. 2 x 1.2 V = 2.4 V. The problem is that if you insert unmodified rechargeable batteries it will not charge them and the voltage will be lowered by cca. 0.6 V which will shorten the operational time. Also with the modified batteries for the charging to begin the headphones has to be switched off.

battery mod

To be 100% sure, I tried to google the original manual on the internet. Luckily it is still there (year 2020), but there is written nothing about the special batteries. There is just a small picture of the batteries where the GND strips are visible. Fortunately, after more research it seems they added the problem to the FAQ section on their web pages - lessons learned: google first then fix problems :). They describe the reason behind it as: "To prevent a user of the wireless headphones from inadvertently inserting non rechargeable standard batteries and from trying to charge them". And they also describe how to modify the batteries: "Cut off the heatshrinking sleeve which covers the rechargeable battery on the side of the negative terminal at a length of about one centimetre and remove it." Personally, I can’t imagine myself trying to insert non-rechargeable batteries there - fortunately I am still sane enough :). It’s also quite unhandy for me to modify the rechargeable batteries each time they need to be replaced, so I simply modified the PCB - I added two white wires shorting the additional GND contacts and added label to the battery compartment stating "do not insert non-rechargeable batteries" - just in case my sanity would worsen during time :). If I would have any need to use non-rechargeable batteries in the future (which is unlikely), I will just cut the two added wires and everything will work as before.

headphones mod

pátek 18. září 2015

How to get Chinese 2.4 TFT LCD ILI9341 based Arduino Uno shield working

These Chinese Arduino Uno TFT LCD shields are neat and very cheap, so I couldn't resist and got one from Banggood. As with nearly everything Chinese, there are several versions and revisions around and it's usually surprise which one you will recieve. It seems my shield came with ILI9341 controller although there is written ILI9340 on the board (I didn't disassemble it, but I assume it according to the shield behaviour). I tried to get it working with Adafruit TFTLCD-Library, but it ended with "Unknown LCD driver chip: C0C0" and white screen. So I dug a bit deep into this problem. It quickly turned out that the chip needs a bit longer delay for reset to start responding. For my shield it seems that additional 5 milliseconds are enough. Then it correctly identified itself as ILI9341. But it still didn't display anything, there was only the whitescreen.

I read both ILI9340 and ILI9341 datasheets and found out that my chip has extended registers which are not handled by the original code. I verified content of these registers with the datasheet and it revealed that the "Pump ratio control" register is set to 0x0 after the reset. According to the datasheet this is 'reserved' value and after the reset the content of this register should be set to 0x20 (which means 2xVCI). Maybe my chip revision is newer than my datasheet or maybe this is some HW glitch but this again validated the basic rule known to embedded developers: "never ever rely on the default values after the reset". So I added initialization for the extended registers. I also improved chip select (CS) handling in the code which allows sharing of the data ports with other peripherals. I did some other minor improvements and bug fixes to the code. All of the changes should be harmless to older HW. Even the initialization of the extended registers should work on chips without extended registers, because according to the datasheet, such initialization should be handled as NOP commands. I pull requested the changes to Adafruit, there is the direct link to the related commit. It seems the shield has different orientation of the display than the Adafruit library expects, thus you need to uncomment #define ILI9341_MIRROR_X 1 and comment #define ILI9341_MIRROR_Y 1 in Adafruit_TFTLCD.h to fix the orientation.

Regarding the touchscreen it's classic 4 wire resistive digitizer which can be handled by e.g. Adafruit TouchScreen library. The only thing that you need to setup is which pins the touchscreen is connected to. Unfortunately it is not written on the kit, but it's possible to locate the connections visually and with the multimeter. The wiring of my shield is following:

A1Y+
A2X-
D6X+
D7Y-

Unfortunately my shield came with broken electrode, so my touchscreen didn't work, but I checked the correct functionality of the code on my friend's shield. I was refunded by Banggood without problems, so I ordered another shield and will keep this broken shield for projects that do not require touchscreen. You can see the detail of the broken electrode here:

There is picture of the working shield kindly lent me by my friend:

I downloaded the code for this simple painting application somewhere on the internet and modified it to work with my shield. The modified code is available for download. There was no licensing information in the original code, so hopefully the license status of this code is OK (free/public domain). If not, please let me know. In the application you can draw by your stylus/finger, select colors on the side and clear the display by tapping on the opposite display side.

Update 2015/10/07
I received replacement display and the shipment was pretty fast. This time there is written ILI9341 on the PCB. It again proved that the development runs pretty fast in China and they usually finish new iteration sooner than you receive your previous order. The display works correctly now. But it seems the digitizer X/Y pins are reversed in comparison with the previous display. I am not sure whether it is wanted feature of the new PCB or bug, but it doesn't matter. The digitizer wiring is now following:

A1X-
A2Y+
D6Y-
D7X+