Author Topic: Add flashlight to a smartphone, will I break it?  (Read 2230 times)

0 Members and 1 Guest are viewing this topic.

Offline federicoTopic starter

  • Contributor
  • Posts: 23
  • Country: it
Add flashlight to a smartphone, will I break it?
« on: June 10, 2019, 10:35:14 am »
Hi everyone.  :)
I just bought a 8.4 inch Mediapad M5.

I intend to use it as a mobile phone, I know it's huge, but I love it and I'm getting ready to do two upgrades.

I'm going to add a speaker on the back cover to answer phone calls (it has no speaker because it's a tablet) and a led flashlight.

Taking the current from the USB Type C output of the tablet.

I have already tested the speakers, I have connected two headphone speakers and with a switch I can turn them on and off as desired, so the phone does not always detect headphones (it would no longer play audio from external speakers). Everything ok, it works well.

Then I tried to connect the LED, years ago I had done it from an iPhone and it worked very well, I had taken the current from the same poles where the current entered to charge the cellphone.

But here with this damn new type-C USB port I have a problem, the GND and Vbus power pins that are used to let the current in and charge the smartphone, do not give any output voltage.  |O

I can detect 2.66 volts only from the GND ping and the CC2.

Do you think there is no way to take power from the tablet to power a small external LED?

In your opinion, if I connect a LED, (which absorbs about 250Mah)
 connecting it to GND and CC2 as per attached drawing, do I mess up?
do I damage the new tablet I just bought?  :scared:
Is there any way to take the current out of this tablet?

Thanks to all in advance.

 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15797
  • Country: fr
Re: Add flashlight to a smartphone, will I break it?
« Reply #1 on: June 10, 2019, 12:56:02 pm »
In your opinion, if I connect a LED, (which absorbs about 250Mah)
 connecting it to GND and CC2 as per attached drawing, do I mess up?

Yes.

do I damage the new tablet I just bought?  :scared:

Probably not (but I'd still be wary), as the CC1/CC2 pins from a host can only provide little current, but they are used to configure the role of the plugged device (with pull-down  resistors), not provide any significant amount of power. I wouldn't do that under any circumstances. Use VBUS and configure CC1/CC2 properly so the host knows what kind of device it is and can provide power to VBUS.
(Side note: I don't know if your LED module has an integrated series resistor or constant current driver - otherwise you'll need to add one: don't connect a LED directly to VBUS!)

I suggest starting there: https://www.embedded.com/print/4458380

USB-C is significantly more complicated than previous USB connections.
 

Offline federicoTopic starter

  • Contributor
  • Posts: 23
  • Country: it
Re: Add flashlight to a smartphone, will I break it?
« Reply #2 on: June 16, 2019, 10:45:59 am »
Ok, if I understand correctly, it's a big mess ..

Thanks for the reply, I had not yet found such a complete text on the subject!
Sorry for the delay in my reply, but I wanted to take the time to read the text carefully and translate it, (because English is not my language), now i understand how these USB Type C works, yes, they are really complicated.

Language problems aside,
I'm at too low a level, I had to search on goggole: pull down resistance, then I looked for: logic circuits, then I searched: impedance, then I searched: Ohm's law, then I searched: electronics for looser..
I finally searched for: chill out music, and I paused, because I was too frustrated by my incompetence. |O

As always, I will look for alternative routes, so I ordered this:


I checked, and it is compatible with the OTG port of my device, technically I can eliminate the motor and connect the light I think ..

about that:
Quote
don't connect a LED directly to VBUS!

I have always connected the LEDs directly to the current sources, I never put the drivers, either on the old cellphone where I had made this change, or on external batteries, etc.
I know I will get a shower of insults, but why do I have to use these drivers? to improve efficiency?

Thanks for the help. :-+

I am very obstinate, I want to do it. :-/O
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Add flashlight to a smartphone, will I break it?
« Reply #3 on: June 16, 2019, 11:50:21 am »
You do not need an LED driver, instead you need an LED current limiter, maybe a power resistor. The LED datasheet will say its maximum allowed current.
Your LED is mounted on a round metal that gets hot. The heat is removed by mounting the metal on a heatsink that has cooling fins in the air.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3925
  • Country: de
Re: Add flashlight to a smartphone, will I break it?
« Reply #4 on: June 16, 2019, 04:51:04 pm »
I know I will get a shower of insults, but why do I have to use these drivers? to improve efficiency?

Yes, you are running from the battery of the device which likely has crappy battery life to begin with. So you don't want piss that little energy you have into heating some resistors.


Thanks for the help. :-+

I am very obstinate, I want to do it. :-/O

The Power Delivery document posted above is a good start, you can actually get a small module from AliExpress (and elsewhere) that will handle that power negotiation for you.

However, the mere fact that the connector is there does not mean that the device is actually capable of powering anything through it or that it can deliver significant current - usually the OTG capability is pretty limited in that regard. Tread carefully there because you could blow some USB power handling circuitry inside of the tablet.
 

Offline federicoTopic starter

  • Contributor
  • Posts: 23
  • Country: it
Re: Add flashlight to a smartphone, will I break it?
« Reply #5 on: June 23, 2019, 03:27:42 pm »
Here I am !  8)
I disassembled and identified the configuration of the type-c usb adapter circuit to audio jack for headphones and input to charge the smartphone.
and the type c usb fan.
I enclose the diagrams of how the two accessories are connected.
Yes, you were right, to give consent to the smartphone to supply the current, there is a 5.1K resistor, exactly one second from the fan connection, 5V are delivered perfectly stable from the smartphone to the fan motor.
I wonder if changing the value of this resistance, it is possible to change the output voltage, but I'm happy with the 5V. :phew:
I made a circuit of how I believe I have solved the situation. >:D
Practically a 3-way switch, creates two modes, in the first, the connections are like the original of the adapter, and you can connect the smartphone in charge from the female adapter.
and through another switch you can activate the headphones when you want.
In the second mode, it excludes part of the adapter connections and I connect the resistor, supplying power to my torch.
How does it look like?  :box:
I squeezed my brains, it's a good puzzle, being able to do everything with as few switches as possible, nothing better came to mind.


 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Add flashlight to a smartphone, will I break it?
« Reply #6 on: June 23, 2019, 05:05:53 pm »
Does it not have a flashlight built in? I thought a flashlight function utilizing the camera flash LED was pretty much standard in smartphones for years.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3925
  • Country: de
Re: Add flashlight to a smartphone, will I break it?
« Reply #7 on: June 24, 2019, 09:18:50 am »
Yes, you were right, to give consent to the smartphone to supply the current, there is a 5.1K resistor, exactly one second from the fan connection, 5V are delivered perfectly stable from the smartphone to the fan motor.
I wonder if changing the value of this resistance, it is possible to change the output voltage, but I'm happy with the 5V. :phew:

Nope, those resistors only control available current at 5V (basically tell the other device that your "phone" is capable of charging at higher currents and that it should supply it if able). If you want higher voltage (9-20V) you must implement the USB Power Delivery standard.


EDIT: Actually nope, the pull-down resistor you have put in only indicates to the host that something is connected and the orientation of the plug. The host provides some pull-up resistors that can tell you how much current is available for you device.

(see here: https://community.cypress.com/docs/DOC-10779 )

If you want more current/voltage than this you need to implement Power Delivery.

Sorry for the confusion.

« Last Edit: June 24, 2019, 01:59:30 pm by janoc »
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 29810
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Add flashlight to a smartphone, will I break it?
« Reply #8 on: June 24, 2019, 09:34:01 am »
Does it not have a flashlight built in? I thought a flashlight function utilizing the camera flash LED was pretty much standard in smartphones for years.
This ^^^

Standard fare for the modern smart phone and when not find a flashlight app and install it.
Avid Rabid Hobbyist.
Some stuff seen @ Siglent HQ cannot be shared.
 

Offline federicoTopic starter

  • Contributor
  • Posts: 23
  • Country: it
Re: Add flashlight to a smartphone, will I break it?
« Reply #9 on: June 24, 2019, 11:40:56 am »
Thanks for your answers.

do you really think I'm doing all this work because I didn't know about the existence of the torch app? :o
Mediapad M5 8.4 it is not a smartphone, it is a tablet, but it has fantastic performance, incredible external speakers and fast processors, plus it has 8.4 inches which is just what i was looking for.
But does not have a LED for the camera, and does not have a speacker to be able to make front calls.
This is why I want to turn it into a "smartphone".
I practically created a new smartphone category for megalomaniacs like me. I called it TaPhone. ;D

Quote
If you want higher voltage (9-20V) you must implement the USB Power Delivery standard.
I have no idea how to proceed

what about my connection scheme? no one thought of a simpler system? :-+
Thank you all for your cooperation
 

Offline Ysjoelfir

  • Frequent Contributor
  • **
  • Posts: 543
  • Country: de
Re: Add flashlight to a smartphone, will I break it?
« Reply #10 on: June 24, 2019, 12:55:52 pm »
When you're done I would love to see a picture of you holding that thing on your ear and making a phone call. Please. I'm really curious.
Greetings, Kai \ Ysjoelfir
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3925
  • Country: de
Re: Add flashlight to a smartphone, will I break it?
« Reply #11 on: June 24, 2019, 01:51:12 pm »

Quote
If you want higher voltage (9-20V) you must implement the USB Power Delivery standard.
I have no idea how to proceed

http://www.ti.com/interface/usb/type-c-and-power-delivery/getting-started.html#

The question is why would you want higher voltage from the tablet? It isn't even sure that the tablet can actually provide it or whether it even implements PD. It is the part of the standard intended for device charging from a charger, not one device powering another.

Quote
what about my connection scheme? no one thought of a simpler system? :-+
Thank you all for your cooperation


USB C standard is complicated, there is no way around that.

In fact, if you wanted to be properly compliant and wanted to make sure that e.g. you headphones actually work with another device and not only your tablet, you would need a microcontroller that would negotiate the proper alternate mode for the sideband (SBU) pins. Analog audio is not the only thing that can be present there, by far. Also many devices may not even be capable of providing analog audio and you need to provide your own codec/DAC if you want to connect headphones.

The same for drawing power from VBus - you are not supposed to draw more than 100mA before your peripheral is properly enumerated and actually sends a descriptor to the host saying how much current it will need. A lot of devices don't bother with this because they assume they will be connected to a PC/laptop/wall charger where there is plenty of current available. That may not be the case for a battery powered device like a tablet or a phone and you could get a surprise when the power gets shut off suddenly. That the connector/standard is designed for delivering a lot of power doesn't mean that it is actually available.
« Last Edit: June 24, 2019, 09:16:05 pm by janoc »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Add flashlight to a smartphone, will I break it?
« Reply #12 on: June 24, 2019, 04:12:05 pm »
Meanwhile here I am wishing someone would make a midrange smartphone a bit smaller than the iPhone SE I have, 3.8" would be just about perfect. I really don't understand the current obsession with gargantuan phones with razor thin bezels that give you nowhere to hold onto the thing without obstructing part of the screen.

Years ago I had a tiny Motorola gumstick phone, it was feather light, fit easily in any pocket and ran days on a charge. Now all we have are pointlessly gigantic things that struggle to go a full day.
 

Offline federicoTopic starter

  • Contributor
  • Posts: 23
  • Country: it
Re: Add flashlight to a smartphone, will I break it?
« Reply #13 on: June 30, 2019, 10:50:33 pm »
here I am, thank you all for your support.  ;D
thanks janoc, I believe I will make the 5Vs go well  ;D

Quote
When you're done I would love to see a picture of you holding that thing on your ear and making a phone call. Please. I'm really curious.
I know, it's ridiculous, it's as big as my head, but honestly I don't care what people think ...

Meanwhile here I am wishing someone would make a midrange smartphone a bit smaller than the iPhone SE I have, 3.8" would be just about perfect......
about the battery, just take a smartphone with a big battery ......
I never take smartphones with less than 5000 Mha, before I had a mediapad X2, and it lasted 2 full days, this lasts almost two days .. and it has 5100 Mha.
Why this obsession?
I use it as a game, for work, to see emails, to browse online, to watch videos on youtube, to read, watch movies and play pubg or similar, ...
I don't want to go around with a smartphone and with a tablet as many do, I want a single device with which to do everything. I'm already used to this, since the X2 mediapad I had before was 7 inches, now I have taken this and I am fine.
Of course if you don't need any of that, for you even a Nokia 3310 will be too much.


ok, I found the switch that's right for me, I order the PCB to be milled and I also have the USB C-type plugs, I also found the right LEDs, I just need one thing...



I want to use this piece of strip:
this strip goes to 12V, there are these resistances: 151 format 1206, they are 150Ω, 0.25W
According to a simple reasoning
I instead feed them with 12V, i have to feed them with 5V, i just replace the resistors, with these from: 62Ω, 1206, 0.25W.
quite right ?
I made:
12V - 58% = 5.04V
150 ohm - 58% = 63Ω
So I want to put these:
SMD 1206, Panasonic 62Ω, 0.25W
and I should be able to feed the strips with 5V, right? 8)
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Add flashlight to a smartphone, will I break it?
« Reply #14 on: July 01, 2019, 08:48:30 pm »
I want small, I prefer multiple devices each optimized for a specific purpose. Not a single device that does everything badly. Most phones on the market now are crazy huge, uncomfortable to use one handed and difficult to fit in a pocket. It's stupid that the whole market has gone that way.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf