Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need a circuit to distinguish between 10mA and 100mA

Status
Not open for further replies.

lonfire

New Member
hi,
i'm building a system using a PIC micro at the moment and for part of it i need to trigger something when a part of the circuit can delivery 100mA.. this part of the circuit will normaly be limited to 10-20mA but at other points its limited to 100-150mA.. i'm really only interested when the line can deliver 100mA otherwise i'm not bothered if its limited to 10mA or whether it has no voltage on it at all..

idealy this will change the status on an I/O line.. but i could possibly use the ADC on the PIC to read in a value instead..

any ideas how i could acheive this? its very important that its reliable.

thanks
chris
 
hi,
sorry to confuse you.. reading back its not very clear!

ok here goes..

the input to my circuit has three states:
1: 0v
2: 12v limited to 10-20mA
3: 12v limited to 100-200mA

i need to know when its in state 3..

thanks
chris
 
hmm not sure i follow.. my analogue electronics isn't great :-(

so between 0v and my input line i put a load resistor..

sorry dont follow..

chris
 
Simply apply ohms law, with a 50 ohm resistor the 100mA will read 5V, but with only 20mA will read 1V - you probably need something smaller than 50 ohms though to give a reliable logic triggering.
 
hi,
yup got ya.. with a quick play on a simulator.. ok how about this.. the input is not known.. so it could be 6v-36v DC.. what i do know is that the state 2 current will never go above 20mA but the state three current could be anything from 100mA upto the maximum the power supply can deliver..

rgds
chris
 
lonfire said:
hi,
yup got ya.. with a quick play on a simulator.. ok how about this.. the input is not known.. so it could be 6v-36v DC.. what i do know is that the state 2 current will never go above 20mA but the state three current could be anything from 100mA upto the maximum the power supply can deliver..

This is all too vague to give clear answers, please tell us EXACTLY what you are wanting to do! - it sounds quite strange?.
 
hi,
ok..

i build f1ring systems for big f1reworks displays and i'm currently building some new units that can be programmed by a PC using the USB port.. each unit will be able to fire 16 f1reworks.. it will hold 6 standard patterns and 2 custom patterns downloaded from the PC.. it will also have 8 standard speeds to run these patterns..

for example it could fire all channels sequentialy@1 second intervals:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16

or:
1 + 9, 2 + 10, 3 + 11, 4 + 12, 5 + 13, 6 + 14, 7 + 15, 8 + 16

..etc

going to have three push buttons.. one that selects the Pattern, one that selects the speed (for the built in patterns), and one that when you press it it will preview the pattern on the output leds.. two of the 8bit I2C bus expanders will just have the status leds on them.. 8 for pattern and 8 for speed.. when the preview button is hit it will sequence through its sequence outputting it onto the LEDs.. the other two 8 bit I2C bus expanders get connected to darlington arrays..

ok so thats the unit.. the idea is that this unit can be plugged into any other f1ring system.. some use 6v other 12v, others 24v..etc when these f1ring systems test the system to check that there are f1reworks on the channels there are supposed to be it test fires the circuit with the f1ring voltage but limited to 10-20mA just to show continuity..

these units then get wired into one of the channels on the main f1ring system.. when the system tests that channel it puts say 12v @ 10-20mA down the line.. the PIC needs to know NOT to fire the sequence.. when the display comes along and the system presents 12v at as much current as it can get through its darlington arrays the unit needs to fire its sequence. the f1ring voltage is only on for 500ms which is enough to fire the f1ring caps.

thanks
chris

p.s. sorry for the secrecy and the funny numbers, this sort of thing is important to keep quiet from other companies.. (as he posts the whole design of the system on the net ;-))
 
I'm presuming all the different units use internal resistors to set the two different current levels?, so you should be able to do it with a single resistor - as I said before something under 50 ohms is likely to be needed, depending on the switching point of the PIC inputs. I suspect your best idea is to try measuring what voltage the inputs change from 0 to 1 at - it won't be perfectly constant, but it should be good enough to select a suitable value resistor for reliable operation.

You should also be aware that sone PIC inputs are schmitt triggers, these will probably be different.
 
hi nigel,
thanks for the help..

just doing a few calculations.. on one of the systems we use when the system fires the fireworks the circuit is switched by a darlington driver directly connected across the battery, so at fire voltage there is no limiting resistor.. on other manual systems its just a push button connecting the +12v to the correct channel so again no limiting resistor.. both however use the 10-20mA test current to show continuity..

so should i assume that that i'll be disapating the full firing current through the load resistor?

for example:
12v system
10mA test current
1200ohm limiting resistor

if i were to use a low value resistor i would be drawing alot of current, probably more than the firing system could draw..

if i assume that the wires from the battery round the system have a resistance of 4ohms and i use a 100ohm resistor i would draw 115mA and the voltage at the + end of the load resistor would be 11.54v

so when the system is in test mode the system resistance is 1300ohms which will draw 9.2mA which would mean i get a voltage of 0.92v at the + end of the load resistor..

the only problem now is that the high voltage is too high to be fed into the micro? i guess i can just put a current limiting resistor before the micro?

although aren't you supposed to pull the i/o lines to 0v rather than pulling them up? or are their different sorts?

thanks
chris
 
If you're using a higher value load resisitor, and thus a higher voltage output, you could use a potential divider to feed the PIC inputs. Bear in mind, a simple series resistor would be no good, as it would then trigger from the 10-20mA as well as full power.

Also bear in mind, the resistor has to be low enough to provide a suitably reduced voltage with 20mA through it.

You can pull PIC pins either high or low, the most common use is pulling them HIGH.
 
hi,
been looking into this more. what some people's systems do is have a large 22ohm resister then relay switchs to 1.8k when it detects a firing voltage..

what about using a 4.7v zener diode to feed the io line on the pic? it would give a clean switch and limit the voltage going to the pic?

if i used a 150ohm load resistor with a cable resistance of 4ohms at 12v that gives 11.69v ish which fed through a current limit resistor and a 4.7v zener would trigger the io line.. and with a 1200ohm resistor to limit the current to 10mA for a test current that would give around 1.33v which wouldn't get through the zener and trigger the io line..

what ya think?

rgds
chris
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top