"Photomicrosensor EE-SX1131 biasing resistor calculations "

Discussion in 'Embedded Systems and Microcontrollers' started by mishra87, Mar 7, 2016.

  1. mishra87

    Thread Starter Member

    Jan 17, 2016
    166
    2
    Dear All,

    I have used part number EE-SX1131(OMRON make) for one of my application i.e liquid dispenser. My instrument is 3V button cell non rechargable battery operated. As per my application requirement, i need to reduce the current consumption of battery for long battery backup and battery longevity. I want to give at-least one year of battery backup.

    Could you support me the what could be the exact resistance values are to be connected in photomicrosensor to avoid the drainage of battery. I want to fix a resistance values in such a manner so that i will have minimum drainage of battery in sleep as well as operating mode. Please let me know how to calculate resistance values.

    1. Connected with Anode.
    2. Connected with Emitter

    Could we have any option to keep the instrument in sleep mode because i wll be using a micro controller.

    I have some other peripherals used in instrument i.e.

    1. Microcontroller - Microchip PIC16LF1934.
    2. LCD without backup which is directly connected to controller PINs.

    If I talk about overall current consumption reduction of instrumentincluding all peripherals. How I can do.

    Thanks in Advance !!!
     
  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,773
    1,103
    The necessary resistors will depend on what what the supply voltage is, what you are sensing, how you plan to use the photo-transistors in the sensor, and what the ambient light level is. We're a bit short on detail ;).
    That's the most effective way to minimise power use. Activate the sensor etc briefly and infrequently.
     
    mishra87 likes this.
  3. mishra87

    Thread Starter Member

    Jan 17, 2016
    166
    2
    Thanks for your response! !
    Further to your queries,

    1. The power supply is 3V non rechargeable coin cell battery, sorry not to have capacity details of battery.

    2. I have 24 division optical encoder which is placed between opto transmitter and receiver. The encoder rotates by gear saft.

    3. The intrupt signals are taken by dual channel opto receiver and given to MCU, which counts the intrupt and display it in LCD in the form liquid unit like max Aspirations and Dispense capacity is 10ml.

    4. As far as ambient light is cocerned , the sensor is placed inside the plastic housing, so I do not think any ambient issues. Probably it would be partially dark.

    So my am is Overall current consumption reduction .

    Is there any hardware IC available who sense the load current and disconnect the load from battery if instrument is in sleep mode without using MCU.

    Await for your response !!!
     
  4. hp1729

    Well-Known Member

    Nov 23, 2015
    1,939
    218
    Data sheet for the EE-SX1131 attached for others to reference.
    How often a day will this be used and for how long each time? You can save a bit of power putting the processor to sleep between uses and running it ay a slow clock speed.
    What dispenses the liquid? Is that powered by the same battery?
    The sensor is designed for 5 mA on the emitter. It may, or may not, run at 1 mA. You would have to build a test rig and try it.
    Will this sensor be running all the time? Your battery won't last long. Driving the motor, too???
     
    Last edited: Mar 11, 2016
    mishra87 likes this.
  5. mishra87

    Thread Starter Member

    Jan 17, 2016
    166
    2
    I have build up the set up. The sensor baised with Rdiode =75E and RE=3K3 for both txa.

    As far as how often it can be used in a day is totally depends on customer.

    We have already given a push button to put MCU in sleep mode if it is not in used and it has been run in 16MHz clock frequency.

    We do not have motor to dispense the liquid. We have optical encoder 24 division which rotates manually by gearshaft and accordingly sensor gives count to MCU and LCD display volume for the same. Set is fully manually operated and motor is not in picture.

    I have tested 25mA input current and battery lost with 5 minutes. MCU+LCD itself draw 2.8 mA.

    By lowering the If diode i. e. For 5mA MCU misses the count.

    Hope this will help in further analysis! !

     
  6. hp1729

    Well-Known Member

    Nov 23, 2015
    1,939
    218
    If you bring the PIC16 clock speed down to 32KHz current drops to about 7 microamps. But the bigger current problem is the encoder. Are you tied to using that encoder? Something without an LED. A simple switch?
    Maybe use ambient light and a light pipe (fiber optic) and a phototransistor?
     
  7. mishra87

    Thread Starter Member

    Jan 17, 2016
    166
    2
    Thanks !!!

    I bring down clock speed of PIC16 to lower but was facing the problem that MCU was not detecting pulse from sensor ( when optical encoder moving between sensor ). The performance only has been achieved at 16MHz.

    I have not got any other part number related to that. I have tried some other part number that was also a phototransistor but results were not good.
     
  8. hp1729

    Well-Known Member

    Nov 23, 2015
    1,939
    218
    Okay, so we are stuck with high clock speeds and the optics. I assume you do not turn the LED on unless the device is being used. Not knowing how often that is or for how long kind of makes it difficult to predict battery life. Does the LCD have a backlight? There are not many places left to save power.
    Small solar cell and rechargeable battery?
     
    mishra87 likes this.
  9. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,022
    Expanding on what @Alec_t and @hp1729 have suggested, I've done something like what the TS is describeing and had success doing this sort of thing:

    Strobe the LED/Detector with as short a pulse as you can get away with given the speed of emitter/detector pair. The datasheet says 10uS typ rise/fall times. Strobe it with a short pulse, 20uS maybe. Then consider the timing of the dark/light intervals generated by your wheel/disc. For example, maybe its 50ms on/50ms off when the user is really cranking it. If you strobe the detector 20 uS at 10ms intervals, you get a minimum of 5 20us tiks per light/dark interval. If you detect the presence / absence of tiks you can recover the light / dark areas of detection. Meanwhile, your detector power usage drops to .2% of what it was before.

    Wrap the LED drive port to one of the interrupt inputs of the PIC so that it can sample the detector when the LED is on. A simple state indicator in firmware keeps track of the current dark/light state and sets/clears a bit that can be sampled by the main routine.

    You should be able to get away with a lot less than 25ma LED current. The datasheet says 5ma Iforward gets a min 50uA collector current. That's enough to bias a PIC input. Can you increase the value of the resistor on the detector?

    Consider using one of the comparators for detection. That way, your detector doesn't even have to saturate to flip the input state.

    Consider changing clock speeds on the fly i.e. when idle, run at min speed and strobe the detector as sparingly as possible. When you see movement, fire up the faster clock. When it stops, downshift the clock again.

    Consider sleeping the processor when its idle. Use a timer to wake it up, sample the detector and if it is still in the same state, reset the timer and sleep again. You can also sleep the processor between samples of the strobed detector if you have nothing else to do.

    Read up on what you can do to minimize processor current consumption. Tips-n-tricks is attached. Search uCHIP for other application notes. Get the big stuff fixed first (detector) then drill down into the code and see where you can save a few electrons. If you have the budget, a RealICE with the PowerMonitor board is not cheap but will help you find where your current is going and shed some light on what to do about it.

    Keep your math small. The faster you get through it, the sooner you can go the slower clock.

    Finally, when developing my project, I found a big difference in button cells. At that time, Duracell tested best for life and current delivery with Energizer a close second. Renata and others performed much worse.

    Can you post a schematic of your detector hardware?

    Good luck!
     
    mishra87 likes this.
  10. mishra87

    Thread Starter Member

    Jan 17, 2016
    166
    2
    That's alright we are stuck with the same. I do not have any device between the battery and LED that may turn off the LED when it is not operating. I also do not have any idea to do so.

    As we can see in the datasheet of battery max. Discharge rate rate of battery is 2.5mA so we need optimum discharge of battery. I do not find any alternate for that coz if I choose any of phototransistor that will definitely draw more current and which Will not full fill my requirement.

    As we can see in the datasheet of LCD there's no blacklight option and it's drirectly driven to MCU.

    Thanks!!!
     
  11. mishra87

    Thread Starter Member

    Jan 17, 2016
    166
    2
    I will follow the information given by you but i do not think that will bring down the current around less than 1 mA to full fill my requirement.
    For light/dark we have 24 division disk/wheel which angled 45 degree so i think whatever the time will be that is same for light/dark. I do not have data of total diameter of disk.


    Please find the Schematic of detector hardware !!!
    R1=75E
    R2=R3=3K3
    R4=Jumper

    I increase the value of R1 to reduce the forward current, the MCU does not detect the detector output.
     
  12. mishra87

    Thread Starter Member

    Jan 17, 2016
    166
    2
    Please find schematic
     
  13. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,022
    A couple of observations from the schematic:
    One reason that your LED current has to be so high is that the emmiter resistors are only 3.3K. This means that you need 600uA to get to the 2V that the input needs for a guaranteed logic high. (800uA if you use the Schmitt inputs). The datasheet shows that to get even 600uA out of it, you need an LED current of ~15ma. That's why it doesn't work when you reduce the LED current to 5ma - the voltage across the 3.3K resistors does not rise to a minimum logic '1' level.

    You can help this by making the emitter resistors bigger at the expense of response time. At 100K, the response time goes to ~700uS (as compared to ~40uS). If you can live with that or something in between, it would help. At 100K, you only need 20uA to get to the 2V minimum Vih. That means that your LED current can be much lower - way down at the left end of the INPUT/OUTPUT CHARACTERISTICS graph with the LED current maybe 1mA or so. So there are some things you can do with the existing circuit to help.

    But even all of those changes are not going to get you down to 1mA total. Having the LED on all the time at any useful current will eat up your batteries. So will driving the detector's emitter resistors full time when they are both looking through the clear part of the wheel. With your values, the combined emitter current is close to 2mA all by itself. The first thing I would do is look for a better detector. This one has a coupled current transfer ratio of about 4%. That's pretty sorry and not suited for battery operation. The low CTR means (as you are seeing) that you really have to drive the LED with a lot of current to get much out of the detector. That's OK for a line-powered system, not so much for a battery operated one.

    Even with that, I think you will find that the strobing of the LED/detector and clock speed manipulation will be necessary. At the very least, I would supply power to the detector from an output port to turn it off when its idle and if you are making circuit changes, use the comparator inputs for the detector so that you don't have to swing the detector's output voltage to the full 2V minimum input voltage of the PIC. You can set the input threshold to something much lower and that means less drive required of the detector.

    Don't forget that you can run the PIC at lower than 3.3V as well. That can drop the power consumption and lower the input thresholds to boot.

    As it stands with your current values, battery operation with button cells is going to be out of the question.

    Sorry we don't have better news for you.

    EDIT: I attached some tech info about applying the photomicrosensors from OMRON. They say 5mA minimum for any IR LED for reliable operation over temperature etc. I don't see how you are going to get away with anything that doesn't control/pulse the LED and detector.

    EDIT2: You might take a look at getting rid of the whole optical encoder thing and use a simple mechanical encoder like these from BOURNS. No power required. Couple the shaft to the crank. Hook the phaze outputs to input pins that use WPU (weak pull ups) and the common to GND. Sample or use (IOC) Interrupt On Change to read it (there are examples of both methods here on AAC). Turn one or both pullups off to save power when idle. Cheap and (relatively) easy.
     
    Last edited: Mar 13, 2016
  14. mishra87

    Thread Starter Member

    Jan 17, 2016
    166
    2
    Actually my product is " Bottle Top Dispenser" so can anybody Send me the schematic diagram.
     
    Last edited: Mar 16, 2016
  15. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,022
    Of what? The numbers say that your low current requirements can not be met with your hardware unless you do something different. There are several suggestions posted here all of which require a change in your design to varying degrees. Pulsing the detector will require some crafty firmware. That's the only way I can see the opto detector working. Did you look at the mechanical approach? What do you think about that? Can you use a bigger battery at all or a wall wart to power it? Something has to change but you'll have to decide which way to go.

    Maybe another member will have some new thoughts on it but in the interim, pick an approach from the suggestions above that you feel comfortable with, sketch it up and try it.

    Good luck.
     
Loading...