Arduino Forum

Using Arduino => General Electronics => Topic started by: Ajan on Jan 20, 2016, 02:23 am

Title: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 20, 2016, 02:23 am

I was trying modify  an RC car control using Arduino. Figured out 4 lines of control in the original control board using which I can control the motors.

These lines/points need to be earthed/connected to ground  in order to activate an action.
eg; point 1 needs to be earthed to get the motor to go forward. and so on.

It would have been easy if it just needed a digital high to get invoked.But they need to be sinked.

I know Arduino digital pins can sink when they are low,  up to some 20mA.Measured the sink current and it was some 1-5 mA only. ( Connecting the multimeter in series
with ground and the points)

So far good.

But when I measured the voltage between ground and these points , it was around some 9 V.
I think arduino pins cannot handle above 5 V even in low currents.( NOT SURE).


One way to get this done is to use transistors on each line , enabling the grounding by digital highs at base.

Is there any other way without using transistors? A voltage divider will work?



Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Boardburner2 on Jan 20, 2016, 02:44 am
When using an arduino as a sink it is important that the scource voltage is not above the supply to the arduino either 5 V or 3.3.
You need to use an external transistor or you risk destroying you arduino.

You need to post a circuit diagram.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Boardburner2 on Jan 20, 2016, 03:42 am
Is there any other way without using transistors? A voltage divider will work?




Possibly , you may need zeners though, a simple transistor is probably the easiest approach.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: MarkT on Jan 20, 2016, 01:06 pm
Is there any other way without using transistors? A voltage divider will work?
No, but you can use transistors packaged up conveniently in an IC like the ULN2803.
8 channels and handles higher voltages.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: pwillard on Jan 20, 2016, 02:18 pm
There are compelling reasons to consider using transistors.

1) A $0.20 transistor is cheaper than a $3 AVR chip
2) Transistor array *driver* chips are really inexpensive.
3) The solution here screams "open collector", which is  what you get with ULN2003 or discrete NPN transistors.  The wiki explains it all.  Open_collector (https://en.wikipedia.org/wiki/Open_collector)
4) Voltage dividers are not magical and have some real draw backs in general but in my opinion definitely  doesn't belong in this solution.

I urge you to consider using a transistor to do the muscle work and keep your AVR signal pins sending signals to "perform" heavy lifting to parts designed to do so.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 20, 2016, 04:28 pm
Quote
The solution here screams "open collector"  
Of course all of us with 20 years or more electronics experience know what you mean and have experienced that feeling but I don't think the OP appreciates that comment as much as the rest of us. A low tech option for people who should never be seen with a soldering iron in their hand (because of the disaster that would result: see photo)
(http://forum.arduino.cc/index.php?action=dlattach;topic=373199.0;attach=151296)




is a small arduino friendly 5V relay board that can be easily interfaced with jumpers. They come in the 4-relay variety.
4-relay module (http://www.progressiveautomations.com/lc-201?gclid=Cj0KEQiA_fy0BRCwiLaQ5-iFgpwBEiQA884sOckqy7TSrDAZmtn0xsb4WJgvQYLmqKItnbiOVOZjAsgaAswo8P8HAQ)
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Paul__B on Jan 20, 2016, 04:48 pm
Oh please!

Don't advise people to use ULN2003/ 2803!
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 20, 2016, 05:31 pm
(here we go again...)
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: pwillard on Jan 20, 2016, 05:52 pm
Quote
Oh please!

Don't advise people to use ULN2003/ 2803!
Don't just complain. Provide a compelling alternative.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 20, 2016, 06:29 pm
Thank you all for the responses.
I'm convinced that transistors are the best option.

@Paul__B
Oh please!

Don't advise people to use ULN2003/ 2803!

Can you please explain why  transistor arrayULN2003/2803 are not good options?




4) Voltage dividers are not magical and have some real draw backs in general but in my opinion definitely  doesn't belong in this solution.

I tried using two 1K resistors to divide voltage and tried on another control board
which has 2.9 V sink voltage.I got 1.5 V at arduino pin to sink and it worked good.

My friend Tom suggested this about using voltage dividers:
"I thought about that, but when you're not driving the pin, it'll be at 9V, so you might blow up the ATmega chip."

Can you people share your thoughts about using advantages/disadvantages of using voltage divider in this context?

Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Paulcet on Jan 20, 2016, 06:55 pm
A voltage divider is to be used on an INPUT.  The voltage divider happens to be an easy and effective level-shifter, but it has drawbacks due to its simplicity.  In this context (5V device output), it is not a "level-shifter".
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 20, 2016, 09:07 pm
Quote
Is there any other way without using transistors? A voltage divider will work?
Short answer, NO. Voltage dividers won't work.



The OP stated he needs to sink current by pulling four nodes to GND.
As ALREADY stated, this application SCREAMS OPEN COLLECTOR.

@OP,
Do you understand what "open collector" means ?
If not, please say so, so we can bring you up to speed on that.
(or you could just Google it, if you chose to)

On another note, it would be NICE if we knew HOW MUCH current needs to be sinked ? (I want to say "SUNK", but in 30 years of electronics , I don't recall hearing that used in this context.


Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 20, 2016, 09:36 pm
Thanks again for the valuable inputs.

"One way to get this done is to use transistors on each line , enabling the grounding by digital highs at base.
Is there any other way without using transistors? A voltage divider will work?"
I have mentioned already in the original post about the use of transistors and hinted the open collector configuration, as solution. Though I did not use the term ope collector.( in the above quote)

Also I have mentioned the current in the original post, 1 to 5 mA.( I got this by connecting the multimeter between ( in series) with ground and the control points)

I appreciate you all reaffirming the use of transistors as a solution.


But I am still curious why voltage divider should not be used in this case.
A voltage divider is to be used on an INPUT.  The voltage divider happens to be an easy and effective level-shifter, but it has drawbacks due to its simplicity.  In this context (5V device output), it is not a "level-shifter".
I did not understand this comment.

"voltage divider is to be used on an INPUT" -  Why not in output , for sinking - in this context?
"but it has drawbacks due to its simplicity" - What are the draw backs?


Either I am missing some obvious principles of electronics/electricity. My intuition says- do not use voltage divider . But my brain questions it . Please help.

My friend Tom suggested this about using voltage dividers:
"I thought about that, but when you're not driving the pin, it'll be at 9V, so you might blow up the ATmega chip."


Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: DrAzzy on Jan 20, 2016, 09:45 pm
For low current, ULN2x03's are acceptable. I use them routinely myself. But only when I'm dealing with a small load, not when I have to switch any significant amount of current.

If you've got a bunch of things that are getting pulled up to 9v, but you only need to sink a few mA from to pull to ground, the 2003/2803 would IMO be a pretty good option. They don't pull all the way down to zero - it goes to like 1-1.4v IIRC, depending on load - that's probably low enough for the device in question to recognize it as low, which is all you need (since as you've said, the current you need to sink is <5mA - so that means this is just the input for something that then controls the motor)
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 20, 2016, 09:47 pm
Voltage dividers, unlike transistors, are not controllable. I assumed you needed to be able to control the current sinking nodes. If not, why not just jumper them to ground ? Why would you need to post if you didn't need control of the sinking ? You simply jumper them directly to ground and be done with it.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Boardburner2 on Jan 20, 2016, 09:50 pm
My friend Tom suggested this about using voltage dividers:
"I thought about that, but when you're not driving the pin, it'll be at 9V, so you might blow up the ATmega chip."



Your friend is correct perhaps he can explain.
As asked post a diagram of your idea and we can say why its wrong.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Boardburner2 on Jan 20, 2016, 10:05 pm
OP
Try drawing it out.

An open collector 'collects' current not volts.


Consider when it is switched off though what happens to the terminal voltage at  the arduino output pin?


A voltage divider divides volts what you are trying to do is 'divide' current.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Paulcet on Jan 20, 2016, 10:05 pm
Either I am missing some obvious principles of electronics/electricity. My intuition says- do not use voltage divider . But my brain questions it . Please help.

My friend Tom suggested this about using voltage dividers:
"I thought about that, but when you're not driving the pin, it'll be at 9V, so you might blow up the ATmega chip."

That's it.  You are missing some obvious principles of electronics.  Not that I am putting you down.  Asking questions is a good thing, but we don't have time to teach you electronics 101.  Many of the people helping here have studied/practiced electronics for years and the reasons not to use a voltage divider in this application are obvious to us.  
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 20, 2016, 10:07 pm
You have your answer. Are you trying to avoid it?
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: DrAzzy on Jan 20, 2016, 10:26 pm
But I am still curious why voltage divider should not be used in this case.I did not understand this comment.

"voltage divider is to be used on an INPUT" -  Why not in output , for sinking - in this context?
"but it has drawbacks due to its simplicity" - What are the draw backs?


Either I am missing some obvious principles of electronics/electricity. My intuition says- do not use voltage divider . But my brain questions it . Please help.

My friend Tom suggested this about using voltage dividers:
"I thought about that, but when you're not driving the pin, it'll be at 9V, so you might blow up the ATmega chip."


What you're missing is Ohm's law. There are three variables in there, voltage, resistance AND CURRENT.
There is no voltage drop across a resistor unless there is current flowing (that's the issue in whatever Tom was envisioning). And any change in the current flowing will change the voltage drop.

Voltage dividers only work when the current across the two legs of the voltage divider is equal (so you can't be driving a load, or sourcing or sinking any current in the middle - all you can be doing is measuring that voltage, pretty much) - otherwise the voltage at the middle of the divider will change. That's why you normally use it for inputs - an analog input involves negligible current, so it's fine to divide the voltage down, and analog inputs need analog voltages.

You can't use it for powering things, because that load will throw things off.

And you can't use it to control things, like you're suggesting.
How are you even proposing to connect it? I can think of at least three ways, but they're all various shades of wrong, and if you draw them out and look at ohm's law...

So yeah, you need transistors of some sort for this!
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 20, 2016, 11:09 pm
My "Noobie" instinct tells me your plan is to combine a voltage divider with a digital output pin set to LOW (to sink the current coming from the voltage divider).

My response to this is that if you have a meter (which you do) , and know how to measure voltage,
(which you do) and current , (which you do), then WHY do you need to post ?
Isn't it a simple matter of measuring the current from the voltage divider node to ground , and then reconfiguring the meter to measure voltage and measuring the voltage on the divider tap off point and comparing those values to the know maximum allowable values (ie: 5V/40 mA) ?
If the measurements are within spec , what do you need us for ? What could we tell you that you don't already know ? You seem to already be aware of the transistor option, but have yet to make a decision. What are you waiting for ? Either proceed with the above, or go to Plan-B (transistors).
So far you have not made up your mind to do that because you haven't even asked us how to wire the transistors, and if you don't even know Ohm's Law, what's the chance you know how to wire transistors. If you knew how to use Google, this project would have been put to bed a long time ago.
Do you have any idea how many links there are on Google with a search for "arduino driving transistors " or "arduino driving open collector transistors" or "Ohm's Law" ?
Welcome to the forum, now  Do something.

FYI,
In case you haven't figured it out, my role here is "bad cop"... ;D
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: dwightthinker on Jan 21, 2016, 01:05 am
With a voltage divider you'd get two speeds,
slow and slower.
How slow would depend on the resistors used.
There would be no off and no full speed.
What is wrong with using inverted outputs?
It is just code.
Instead of 0 is on and 1 is off,
you'd use 1 on and 0 is off.
rant on:
I see the example of using a switch with a pull
down resistor just so the code would be high is
pressed. That is just silly when using a grounded
switch eliminates the need for the resistor using
the input pullup mode.
rant off:
Dwight
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 21, 2016, 01:12 am
Quote
Figured out 4 lines of control in the original control board using which I can control the motors. 
Just for the record, we do NOT know WHAT the 4 signals are.
Almost any wild guess, would be wrong. Some hackers out there may actually know . Without knowing what the signals are or HOW they work, isn't this entire discussion ACADEMIC ?
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 21, 2016, 01:33 am
@DrAzzy

Thanks DrAzzy for trying to explain the flaw in using voltage divider as a solution here.

ma
That's it.  You are missing some obvious principles of electronics.  Not that I am putting you down.  Asking questions is a good thing, but we don't have time to teach you electronics 101.  Many of the people helping here have studied/practiced electronics for years and the reasons not to use a voltage divider in this application are obvious to us. 
@Paulcet
I think  you do not know how to explain what "obvious principles" I am missing here :-) .

@raschemmel

Appreciate your time and thanks for posting replies , especially the suggestion on using relay switches instead of transistors.

In your replies you are suspicious on if  I understood the "open collector " solution. I do not want to quote from my original post again to prove that.  The question on Voltage divider was there not because , I did not know ( or I did know) transistor wiring , but I was not sure why voltage divider should not work.

@raschemmel
I do not know what signals are there from those control points. I just measured voltage between the point and the ground. Also measured the current when directly sinking to the ground. (When directly sinking one point to the ground I got one side motors working.) I do not have a scope to check the signals.
By "academic" , I do not have a real project in hand ? No.. I have some thing solid before me.
Or did you mean .. that discussion is going too theoretical ? .. sorry I cant help ;-) asking questions.


@dwightthinker
I am yet to digest your answer.


This is my first post. I posted this yesterday. I did not get time to "do" things today.  Thanks for the overwhelming support and information. Will keep you posted.
By the way I am posting the diagram to clarify the voltage divider I was "thinking" about. ( Those who have clarified undoubtedly that VD is not the solution , please excuse me).
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 21, 2016, 03:49 am
By "academic" , I mean that until you post a "working" Truth Table for the four signals/nodes it makes no difference what method you use to ground them.
"working" means a truth table that explains how to get both side motors working , forward and reverse.



"one side motors working" does not a working RC car make.

I think you lack the electronics experience to appreciate the situation you are in. What we think is irrelevant if you able to get it working. There are certain things that are irrefutable, like , for instance,
that a 9V PP3 smoke alarm battery is rated for 350 to 500 mAh, meaning that if the motors draw 100 mA when running , the battery would only last a few hours. If they draw 350 mA, it would only last one hour , and so forth. Aside from that, we are helpless because you have told us next to nothing, and you have discovered only partial information, meaning, you only have one side working, and , if I understand you correctly, you have no idea what relationship exists between any of the four signals/nodes you refer to. You could, at any moment, stumble on something that enlightens you as to how to make everything work. You say that these points draw 1 to 5 mA with no resistors. We don't know if you know Ohm's Law but my guess is you don't, so you do not realize how inserting 1000 ohms of resistance in the signal path of a signal that is designed to connect directly to ground will effect the operation of the circuit, which , for all practical purposes is completely unknown. We , (including you), have no idea what circuitry is on that board. I have seen people completely reverse engineer RC toys and design a uP interface that works. You have not yet demonstrated such hardware hacking skills. Whether or not the voltage divider would work is irrelevant until you figure out how to get the circuit fully functional. If you had started your post with a close up photo of the board , showing the four nodes, and the traces, we might have reverse engineered it by now. I fail to see how having only one side motor working gets you any closer to getting the thing working , unless you are content to watch it run in circles. You need to make a lot more progress before this post is going to go anywhere. You said you know how to wire open collector transistors. How about posting the math for calculating the base resistor. Show your work. Link the datasheet.   It would have taken fewer characters to give an example Base resistor calculation for an Open Collector transistor than it did to say "you think I don't  know how to use open collector transistors but I do..."




Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Paul__B on Jan 21, 2016, 07:32 am
Without knowing what the signals are or HOW they work, isn't this entire discussion ACADEMIC ?
Quite so.

Don't just complain. Provide a compelling alternative.
Dead easy, and should be the first thing that comes to mind - the TPIC6B595 (http://www.ti.com/lit/ds/symlink/tpic6b595.pdf) (or in this case, TPIC6C595 (http://www.ti.com/lit/ds/symlink/tpic6c595.pdf) would be sufficient, but the "B" is likely the most readily available).

This uses FETs as the ("open drain") switching elements with a very low saturation voltage, and uses a fraction of a milliamp supply current making it suitable for battery powered devices.  Like the ULN devices (http://www.ti.com/lit/ds/symlink/uln2803a.pdf), it contains "kickback" protection but does not require a connection to the supply rail of the switched devices.

Now of course, it is in fact a shift register and latch controlling these eight output FETs.  This is hardly a disadvantage; it means you control it - or many of them chained - with only three microcontroller ports and could thus be paired with one of the low lead-count devices.  You can either "bit-bang" at maximum speed, or use SPI functions.  Since almost all applications of the ULN drivers are low-speed (they have to be, the first transistor in the Darlington saturates), the slower performance of using a shift register is moot.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 21, 2016, 11:40 am
This is a good example of what I meant.
Here the poster (Paul) is assuming the four nodes/points/signals are used to sink motor current (due to the almost.non-existent intel)
This is evident by the reference to "kick back diodes" which go in parallel with an inductive load, such as a motor.
I on the other hand think those points are inputs of a chip , and NOT connected to the load. Paul's suggestion hints at a smarter solution though, which is  "screw the onboard circuit " and just cut the motor wires and add your own custom circuit, designed from the ground up ( no pun intended) and be done with it. Then you don't have to.worry about those four points anymore. There is only one reason this has not already been done and Paul knows what I am talking about.
@Paul,
Would you care to explain WHY  the OP has NOT done this and is still screwing around with the four bloody "points" (for lack of a better name for them) ?
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Paul__B on Jan 21, 2016, 01:01 pm
Me?

How would I know what is in his mind? :smiley-eek:

Without the pictures we have requested (haven't we?  Can't imagine why not!), we don't quite know the situation, but he did suggest these control points have 9 V open circuit and 5 mA short circuit.

My point is that whilst the TPIC6B595 outputs are capable of sinking much more than 5 mA, they really do not care how low the current is and have negligible leakage when turned off, so will be as appropriate in this situation as any other.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 21, 2016, 02:07 pm
The reason the OP hasn't opted for a redesign is that it requires prototyping skills, as opposed to simply grounding 4 wires.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Paulcet on Jan 21, 2016, 05:00 pm
@Paulcet
I think  you do not know how to explain what "obvious principles" I am missing here :-) .

You have a point.  I don't have enough time to explain them here.  I could teach them (and have) in a classroom with a lab.

I suggest that you do some reading.  Google "online electronics course".  http://www.electronicstheory.com/ has 75 pages of introduction to electronics and that is just the beginning!  Or better yet, take an electronics course at a school with a lab!
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 21, 2016, 05:36 pm
So much for this post...
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 21, 2016, 05:43 pm
@Paulcet

Thanks for the suggestions and your precious time to suggest courses on electronics.
( as answer to my question on why voltage divider is not a good idea in this context )


How would I know what is in his mind? :smiley-eek:
Without the pictures we have requested (haven't we?  Can't imagine why not!), we don't quite know
I have already posted a diagram which shows the IC control pin being grounded through a voltage divider.
Also mentioned about the feable current in the control lines.

@raschemmel
"one side motors working" does not a working RC car make.
Sir, Both sides of the car / both motors are working . They are controlled by 4 lines.


People here are really trying to help me getting the RC work, more than teaching the answer to the
question on the voltage divider. :-) Thank you all.

I am attaching pictures of the control board. TAIYO 93-R in the IC used- sadly I was not able to find a data sheet online.

I have "arduinoed" a couple of RC cars already. But this new one is a bit of off-roading type, and may require more current than L293d, L298N . That is why I decided to take advantage of the inbuilt controller with good heat sinking.

One side of the board shows my poor soldering skills and hot glue work to attach  and secure a connector to 5 "control - lines" ( @raschemmel   Any better term for this?)
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 21, 2016, 05:51 pm
attaching the images.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 21, 2016, 06:12 pm
Take a look at this  (http://forum.arduino.cc/index.php?topic=22073.0)post.

Quote
The two leads that say "To Arduino" originally went into the integrated circuit,
The chip might be a receiver chip, which means it is not necessary for your application and should be removed as it was in the other post. Trace the connections from the chip to the power transistors.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Paul__B on Jan 21, 2016, 10:35 pm
Well, the pictures made things immediately clear, didn't they?

Could have saved a lot of time!
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: dwightthinker on Jan 22, 2016, 12:58 am
I've looked at your voltage divider.
First, I have to assume the IC pin is some type of input?
What kind of input is it.
Does it source, sink or hi-impedance?

If it sources, the divider is not likely to pull it down
to 0V when D5 is 0 because there will be some drop
across the top resistor. If it is a source, it will be
loaded down by the divider so that it may not reach
a high enough level to work.

If it is a sink, the resistor will limit the current to it as well
as reduce the voltage from the output D5. D5 may not
pull it high enough to be considered a high input.

If it is hi-impedance, it will at most slow the signal down
and may still not raise the level of voltage high enough
for the IC input.

Since you can't find a data sheet, I have to assume it is
an in house number. I suspect it is a driver chip for the
H bridge transistors.
A back trace of the controlling wires might help to
understand how these might expect to be driven.
I suspect there is a transistor and resistor connected
to each and what rails these two are connected too.
Dwight

Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 22, 2016, 01:23 am
It's an RC car. The chip is the radio receiver TAIYA 3-R.  Since the receiver is being bypassed for the project it is unnecessary and can be removed. The H-bridge (the heatsinked power transistors) are normally driven by the Receiver chip via resistors. At this point , we have no further information until the OP traces the pins from the chip to the base resistors and then to the power transistor base pins. This can be done more easily by looking at the number on the power transistor, finding the datasheet and finding out which pin is the base pin and then tracing it backwards from there back to the chip which will tell you which pins on the chip are outputs. If it is indeed a receiver chip, there are no "input" pins per se because the input is the radio signal coming in on the antenna, which is decoded by the chip to FORWARD, LEFT,RIGHT and REVERSE. The steering would be independent of the forward and reverse, unless it uses differential drive. We don't know what the car frame looks like so that's an unknown. We need a picture of the bottom of the car.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: dwightthinker on Jan 22, 2016, 01:27 am
It's an RC car. The chip is the radio receiver TAIYA 3-R.  Since the receiver is being bypassed for the project it is unnecessary and can be removed. The H-bridge (the heatsinked power transistors) are normally driven by the Receiver chip via resistors. At this point , we have no further information until the OP traces the pins from the chip to the base resistors and then to the power transistor base pins. This can be done more easily by looking at the number on the power transistor, finding the datasheet and finding out which pin is the base pin and then tracing it backwards from there back to the chip which will tell you which pins on the chip are outputs. If it is indeed a receiver chip, there are no "input" pins per se because the input is the radio signal coming in on the antenna, which is decoded by the chip to FORWARD, LEFT,RIGHT and REVERSE. The steering would be independent of the forward and reverse, unless it uses differential drive. We don't know what the car frame looks like so that's an unknown. We need a picture of the bottom of the car.
Agreed
Dwight
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 22, 2016, 02:22 am
Quote
@raschemmel
"one side motors working" does not a working RC car make.
Sir, Both sides of the car / both motors are working . They are controlled by 4 lines.
 
What about this ?

Quote
@raschemmel
I do not know what signals are there from those control points. I just measured voltage between the point and the ground. Also measured the current when directly sinking to the ground. (When directly sinking one point to the ground I got one side motors working.) I do not have a scope to check the signals.
By "academic" , I do not have a real project in hand ? No.. I have some thing solid before me.
Or did you mean .. that discussion is going too theoretical ? .. sorry I cant help ;-) asking questions. 
Where's the TRUTH TABLE that shows what function is controlled by what pin/point and what voltage is
on the pin when it is not being jumpered to Ground ?

You tell us you have it working but nothing about what controls what or how you make it do this or that. You need to start by being more organized. Stop referring to the four controls lines in general and identify them specifically. Give each one a name that describes what it does. If you cannot associate a specific function with a speciific pin then name them A,B,C & D and post a truth table showing what conditions on the four control lines result in what actions. We still don't know anything about that. In one post you say you got one side working but no mention about the other side. There has been no mention of steering and now you tell us both sides are working but we still don't have a TRUTH TABLE.  You have a meter. Why don't you look at the numbers on the heat sinked devices and post those and look for the datasheets. Tell what all the functions are and how they operate.(exactly), not in general (ie:" grounding some points makes the motors work ...." is no help at all)
Be specific.
What do you propose to do with a receiver chip if you are not going to use it ? Are you planning to leave it in the board ?
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: dwightthinker on Jan 22, 2016, 05:35 am
Of interest is how much current was involved with shorting places in the circuit
to ground?
Dwight
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 22, 2016, 05:49 am
Of interest is how much current was involved with shorting places in the circuit
to ground?
Dwight

As already mentioned less than 5mA. Mostly 1mA.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 22, 2016, 06:08 am


....both sides are working but we still don't have a TRUTH TABLE.  You have a meter. Why don't you look at the numbers on the heat sinked devices and post those and look for the datasheets. Tell what all the functions are and how they operate.(exactly), not in general (ie:" grounding some points makes the motors work ...." is no help at all)
Be specific.
What do you propose to do with a receiver chip if you are not going to use it ? Are you planning to leave it in the board ?
I could not find time make the truth table.  I did not try all combinations.
Here is what I tried today:
Connected so called control lines to arduino digital pins through transistors ( open collector ).
I was trying to make the RC work through bluetooth app in the android phone.

It worked good for the forward function ie; both side motors worked in the same direction as expected
as response to my forward button press in the android app. ( by the way , it is a differential drive RC car)

I do not plan to use the TAIYO IC on the board. But neither I do not plan to remove it. I think it is NOT going to harm anyway.


Post pic and video only show what car it is.

(http://www.baggystoysbazar.com/EbayPictures/tycomutat-1387425660-25867.jpg)

Youtube link
https://www.youtube.com/watch?v=WEGlsztBOPQ&ab_channel=GrishaBaranovskij

Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 22, 2016, 06:14 am
I am met with a set back on this interesting project a few hours back. :-(
Changed the battery to a new 12 V one ( when the 6V got drained) , without considering the
bluetooth module.

It just got fried. I think only the voltage regulator on the HC-05 board got burnt. ( but not sure if I can
just do some work around)
That was my only BT module and I need to order new one.

So sad .. to lose the flow .. and impatient to get this working.  :-( :-(

Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 22, 2016, 08:20 am
I don't have to tell you how dumb that sounds, even for a noobie.
What were you thinking?
 WHY were you powering the BT module from 6V instead of from arduino 5V with the 6V battery connected to VIN of arduino ?
Here on the forum , we don't whiite wash things. We don't call that a "set back".
We call that a "fxckup".  (I think the British call it a "Stuffup". (you "stuffed it"). A "setback" is   ordering PNP transistors instead of NPN. when there's a 2-week lead time.
Here today, gone tomorrow.
 Why didn't you  recharge 6V battery ?
All RC cars have rechargable batteries.
Still need truth table.
You did all this JUST to control it from your phone?
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 22, 2016, 04:23 pm



You have the freedom to call it whatever you want until it becomes a nuisance. Hopefully people will be considerate for the highly experienced.


Agree.. I was dumb to connect the Bluetooth module directly from Vcc.


I want to use mobile phone for many other sensors and controls , like GPS , accelerometer etc. This will save me from busy separate sensors for each and wiring them, and programming them.
You did all this JUST to control it from your phone?
raschemmel ,I am curious , you did have some great ideas in mind , when seeing my original post? (I can try them too.)

I still can try the OTG connection instead of Bluetooth.


Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: dwightthinker on Jan 22, 2016, 04:43 pm
I do hope you see why the voltage divider won't work.
If the pin is intended to be pulled to 0 volts, you may
not get that close.
With 1ma source, 2K will be at 2V at the top. This may
be enough to partially turn on the transistor to the
motor, when it should be off.
When the Arduino pulls down, there well be 1V at the
top of the divider. Again, that may not be enough to
properly turn on the drive, causing more power loss
in the drive transistor.
Not knowing the circuit of the drive the divider is clearly
a bad idea.
Now, you connect 12V. Again, not knowing the circuit
attached, the 2:1 divider could be putting 6V on the
Arduino.
Dwight
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 22, 2016, 05:20 pm
OTG ?
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: CrossRoads on Jan 22, 2016, 05:30 pm
On The Go
https://en.wikipedia.org/wiki/USB_On-The-Go (https://en.wikipedia.org/wiki/USB_On-The-Go)
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: raschemmel on Jan 22, 2016, 06:11 pm
Quote
Agree.. I was dumb to connect the Bluetooth module directly from Vcc.  
I don't know WHICH Vcc you are referring to.
Technically, when discussing ANY (5V) arduino, Vcc is 5Vdc

What I meant was that your battery (regardless of the voltage as long as it is <12V) should be connected to "VIN" of the arduino (the input for the onboard 5V regulator).
ANY device that runs on 5V (like the BT) should be connected to Vcc (5V).
Had that been the case , the 12V battery would have provided 12V to the onboard arduino regulator , which would then have provided 5V to Vcc , and thus to the BT, and there would have been NO problem.

I have no idea what you are talking about. Please post a schematic of how your BT ,battery, and arduino are connected . (photo of hand drawn schematic )(please don't use Fritzing)

Since the control lines come from the IC, which I am fairly certain is the RF receiver, they are probably open collector outputs that are used to drive ACTIVE LOW motor power transistors. I have no idea if they are NPN or PNP but the OP says the motor turns on when those control lines are grounded , suggesting PNP transistors on the heat sinks. I have repeatedly asked the OP to look at the numbers on the power transistors but my requests have fallen on deaf ears.
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 22, 2016, 07:25 pm
I do hope you see why the voltage divider won't work.
........
With 1ma source, 2K will be at 2V at the top. This may
be enough to partially turn on the transistor to the
motor, when it should be off.
When the Arduino pulls down, there well be 1V at the
top of the divider. Again, that may not be enough to
properly turn on the drive, causing more power loss
in the drive transistor.
........
Thank you for the reply. I have thought about two questions while considering he VD( voltage divider):

1. If the current through R1 to the ground through arduino sink pin is enough to properly ground the so called control point
2. If the R1+R2  good enough to prevent grounding of the same point
I already had tried some R1 and R2 values and found one to be working good. ie; R1 will short it while R+R2 will still keep it high. The diagram is representative , the R values are not exact.

..Now, you connect 12V. Again, not knowing the circuit
attached, the 2:1 divider could be putting 6V on the
Arduino.
Dwight
I was onnecting 12V to Vin or arduino  and used the same tie point in the bread board to connect the BT module.
I did this by mistake ( accidentally / forgot to change the power to 5V point) . I DID know that it will fry the module. 

I agree .. this will cause 6V to my arduino pin -- if I use the Voltage divider. But did not use it and as per the suggestions and discussions I have dropped the idea of using VD and used transistors to control.
( Open collector )
Title: Re: Sinking current - How to pull down a point to zero using Arduino pins
Post by: Ajan on Jan 22, 2016, 07:33 pm
I don't know WHICH Vcc you are referring to.
...
What I meant was that your battery (regardless of the voltage as long as it is <12V) should be connected to "VIN" of the arduino (the input for the onboard 5V regulator)..
.....
I have no idea if they are NPN or PNP but the OP says the motor turns on when those control lines are grounded , suggesting PNP transistors on the heat sinks. I have repeatedly asked the OP to look at the numbers on the power transistors but my requests have fallen on deaf ears.
I connected it to Vin .  I should have connected the BT module to 5V out from Arduiono.
Yet to disassemble the heat sinks and check the driver transistor types.  Will keep you posted.