Author Topic: Build a circuit that shows the current. Any suggestions?  (Read 12547 times)

0 Members and 1 Guest are viewing this topic.

Offline BotanicTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Build a circuit that shows the current. Any suggestions?
« on: April 07, 2006, 03:06:02 PM »
I need to build something that shows the current going to my two motors on my robot that I am going to build.
So far I have no ideas of how to build it, so I figured that I will ask here before I start searching. Maybe someone has made something similar before.
I am going to drive the motor with 12 V and it's going to need max 500 mA. I've been thinking of having three 7 segment LED displays (I think that's how they are called).
Any suggestions of how to build such a thing? The circuit should not affect the current to the motors in any way.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Build a circuit that shows the current. Any suggestions?
« Reply #1 on: April 07, 2006, 06:40:37 PM »
Way ahead of you . . .
http://www.societyofrobots.com/sensors_currentsensor.shtml

When I get off my lazy butt, Ill actually post a pic of what the final product looks like too on that page . . .

Offline BotanicTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #2 on: April 08, 2006, 05:25:04 AM »
Great, thanks!

Unfortunately that MAX471 circuit is not manufactured anymore. It's been replaced by MAX4069, MAX4070, MAX4071 and MAX4072.
I ordered them as samples from Maxim. Hopefully they will send them to me for free. I could't find any retailer here in Sweden that has them.

Offline BotanicTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #3 on: April 28, 2006, 07:03:59 AM »
I got the circuits as samples the other day. They can be used somehow although they are very small...

Anyway, does anyone have any suggestions on how to show the current? The current range goes from -1,7A - 1,7A.
Are there any ready circuits that I could use, instead of a microcontroller?

I know that I oould have a PIC with an analogue pin going to the MAX4070, then from the PIC to a 7-segment LED. But this would require programming of the PIC. Maybe there is a cheaper and smarter solution?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Build a circuit that shows the current. Any suggestions?
« Reply #4 on: April 28, 2006, 10:03:06 AM »
Use a simple volt meter to measure the output from the chip. A particular voltage represents a particular current. The spec sheet should give you an equation.

Offline BotanicTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #5 on: April 28, 2006, 02:19:51 PM »
Yes but how do I build a simple volt meter, that looks nice and is simple to build?
It should be possible to read it while the robot is moving.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Build a circuit that shows the current. Any suggestions?
« Reply #6 on: April 28, 2006, 02:21:43 PM »
What does your robot need the current info for?

Offline polar bear6

  • Full Member
  • ***
  • Posts: 98
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #7 on: April 28, 2006, 03:54:28 PM »
i dont know if this will help but its a little cool thingy thats called 1381, it turns on when it detects a certain Voltage. you can get them in diffren "flavors" so they turn on at diffrent Voltage. you can get them at www.solarbotics.com at the IC section, they are at the top.

« Last Edit: April 29, 2006, 08:53:19 AM by Admin »

Offline BotanicTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #8 on: April 29, 2006, 04:15:06 AM »
The current is for two motors. The absolute maximum current that is ever going to be needed is 1,7mA. That is a theoretical maximum when both motors start at the exact same time.
I am probably going to use MAX472 and build a similar thing as on the link that you linked to earlier. I have that pretty much covered now.

The problem right now is that I don't know how I am going to show the current, or actually voltage, after it has passed the MAX472.
It needs to be with an accurace of 10mA. Would be nice to have it numerical.
What I need to do now is to calculate what voltages I will get out from the MAX472. Then I need to build a simple voltmeter that is accurate enough, and easy to build.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Build a circuit that shows the current. Any suggestions?
« Reply #9 on: April 29, 2006, 08:52:38 AM »
I meant, what is the current data used for? What does your robot do with this current information? Is it to limit maximum current perhaps?

And when you say 1.7mA, do you mean 1.7A? As for an accuracy of 10mA, that wont happen. The noise generated from motors is usually at least 10mA. You could put a like a 10uF cap across the leads of your motors to reduce noise though . . .
« Last Edit: April 29, 2006, 09:02:11 AM by Admin »

Offline BotanicTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #10 on: April 29, 2006, 10:57:34 AM »
The current used is 1,7A. I should read what I type...

The thing is just for show. It's something that my examinator wants me to do. The robot is supposed to show the current used by the motors in realtime with an accuracy of 10mA.

I did not know about the noise issue. I will have to do some more resarch on that issue. Thanks for informing me :)

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Build a circuit that shows the current. Any suggestions?
« Reply #11 on: April 29, 2006, 11:07:46 AM »
If your robot is tethered, is that a problem? You could output the voltage to your PC, either using DAQ hardware+software (potentially expensive), or using a microcontroller and outputting to HyperTerminal. My electrical engineering ability is weak, so I like to balance it with software sometimes.

And if not doable . . .

Although you will need some form of logic between your current sensor and your output display, this device (or some other LED number display) might be useful for you . . .
http://handyboard.com/cricket/bus/4digit.shtml

If you can buy something to do it for you, go for it. Simplicity always works.

Offline BotanicTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #12 on: April 29, 2006, 12:06:27 PM »
That display is exactly what I am about to build. The robot is not restricted by any cords. So hooking it up to a PC is not an option.

I need to find some kind of logic that translates 0-2.5V to such a display. I know that I could program a PIC. But that feels too complicated. I am sure there are circuits that can do the same without any programming.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Build a circuit that shows the current. Any suggestions?
« Reply #13 on: April 29, 2006, 12:36:58 PM »
To me, a robot without a microcontroller is just blasphemous :P

Is your robot remote controlled, or possibly B.E.A.M like?

Offline BotanicTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #14 on: April 29, 2006, 05:23:27 PM »
I wrote a description of the robot here in this other thread: http://www.societyofrobots.com/robotforum/index.php?topic=43.0

There is going to be a PIC that decides where to drive based on the information from three sensors.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Build a circuit that shows the current. Any suggestions?
« Reply #15 on: April 29, 2006, 05:29:57 PM »
Any reason why you cant use the same PIC for the current measurements? It would be no harder than your other sensor measurements. You just use the digital output pins for your display.

Offline BotanicTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #16 on: April 30, 2006, 04:31:38 PM »
There are not enough free pins on the PIC that we use for other things.
I guess that I will go the PIC route. I will have to decide on which PIC to go with. I need 10 free digital ports and one analogue port.
Then I'll get a 2x7-segment led display and connect it directly to the PIC.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Build a circuit that shows the current. Any suggestions?
« Reply #17 on: April 30, 2006, 05:01:59 PM »
whoa why so many digital ports?

some analog pins on pics can be configured as digital ports, check the pic spec sheet.

if you need more output pins, you can also use the pwm pin(s) on a pic as a digital or analog output.

use this circuit:

pwm out pin ----- 10kohm resistor ------ device that gets output
                                                  |
                                            ~10uf Cap
                                                  |
                                                GND

just change the pwm rate to max to get a high out
if you vary the pwm, you can get an analog output

Offline BotanicTopic starter

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #18 on: May 20, 2006, 02:57:35 PM »
Does anyone here have a ready program for a PIC that reads an analog value from one port and then displays something on two 7-led displays?
I just need something to start from. I am not a good programmer :(

I am going to use a 2x7-led display with two decimal points to show the current.
I am still not completely done with the stepping up of the coltage to the motors and time is running. Still only two weeks until the robot needs to be completely finished.
So it would help a lot if I could find some code that I could cut and paste to fit my need.

Still haven't settled on a PIC model yet either...

Offline cjwillms

  • Jr. Member
  • **
  • Posts: 44
  • Helpful? 0
Re: Build a circuit that shows the current. Any suggestions?
« Reply #19 on: May 21, 2006, 03:53:49 PM »
I haven't done any work with PICs, but it seems like you can just do Adc_read(x) where x is the port that you want to convert analog to digital.

As for the LED Screen, I really have no idea. You might want to try to just use a few leds to start off with, and then just light them up, based on the voltage. From there, you should be able to add algrothems to control the 7 segment displays.

Heres a PIC project that uses Analog to Digital conversions, and seems like it'll be helpful to you
http://www.robodyssey.com/resources/PICProject/Chapt17.pdf

Heres a tutorial on how to control a 7 segment display. It's meant for the AVR series, but it gives you a good bit of information, based on where to apply voltage to light up each segment.
http://www.iguanalabs.com/7segment.htm


Anyway, here's what I pieced together from these sources. I don't have a PIC chip, or a emulator for it, so I don't have a clue if it'll work or not

A few notes though. I have no idea how to access each pin on each port, so I'm just using binary to control which pins are on and off. The analog input is going into Port A 3, and a bunch of leds on Port B. Adc_read give you a number between 0 and 1024. The number is based on the v, and your refrence v. If you microcontroller is running at 5v, a 5v analog input will be 1024, 2.5v will be 512, and 0v will be 0.

Code: [Select]
Dim AnalogData as word 'where you store the analog data
TrisA = %00001000 'Set PortA 3 for input
TrisB = %00000000 'Set all of PortB to Output

while TRUE 'start of the main loop
AnalogData=Adc_Read(3) 'coverts analog data into digital, and stores in AnalogData variable


If AnalogData = 0 Then  '0v Checks to see if it is 0v.
PortB = %00000000 'All lights off
End If

If AnalogData > 918 Then  '~5v
PortB = %11111111 'All lights on
AnalogData = 0 'Sets variable to 0, so the lights don't change
End If


If AnalogData > 816 Then  '~4.5v
PortB = %11111110 'All light on, except PortB 0
AnalogData = 0
End If


If AnalogData > 714 Then '~4v
PortB = %11111100 'All lights except PortB 0 & 1
AnalogData = 0
End If


If AnalogData > 612 Then '~3.5v
PortB = %11111000
AnalogData = 0
End If


If AnalogData > 510 Then '~3v
PortB = %11110000
AnalogData = 0
End If


If AnalogData > 408 Then '~2.5v
PortB = %11100000
AnalogData = 0
End If


If AnalogData > 306 Then '~2v
PortB = %11000000
AnalogData = 0
End If


If AnalogData > 204 Then '~1.5v
PortB = %10000000
AnalogData = 0
End If


If AnalogData > 95 Then '~1
PortB = %00000000
AnalogData = 0
End If

If AnalogData > 0 Then 'Makes sure we don't turn off all the lights at the end
If AnalogData < 95 Then 'Less then 1 V
PortB = %00000000
AnalogData = 0
End If
End If

wend 'While End (goes back to the top, and starts over)

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Build a circuit that shows the current. Any suggestions?
« Reply #20 on: May 22, 2006, 08:21:14 AM »
Search google for 'pic lcd display' and you will get tons of useful goodies:

http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLD,GGLD:2004-37,GGLD:en&q=pic+lcd+display

 


Get Your Ad Here