I want to design a battery powered device that detects proximity (through an IR LED and a photodiode), and displays information on a small screen. As it is an autonomous device, it must be low-power. I chose to work with a digispark dev board that seems to fit my requirements, in terms of power, pinouts, and memory. Here are the components i chose to use:

  • Digispark dev board (ATtiny85)
  • BPV10NF photodiode
  • IR LED TSFF5210
  • 0'96 Adafruit 128x64 OLED screen
  • a 9V battery
  • a push button (it will drive power (software function) on the OLED screen)
  • some resistors.

Here is the schematic that I made for this project:Proximity Detection Device

pinouts of the Digispark will be configured as follows:

  • P0 --> SDA
  • P1 --> Digital output (Reset pin driving)
  • P2 --> SCL
  • P3 --> Analog input (button pressing detection and pull-up)
  • P4 --> Digital or PWM for IR LED (I am not too sure here)
  • P5 --> Analog input

So, as I am a beginner in electronics, I am not too sure about my design, particularly concerning the resistors. I made some calculations, for the IRled that led to a 225ohm resistor, in order to avoid damage on micro, but concerning the pull-up resistor and the photodiode one, I am not too sure. Could anybody verify if there is a problem on this design ? Thanks !


So according to what st2000 said, i changed my dev board for a MSP-exp430G2 (that seems to draw less current). I chose a ADM1602K as LCD (with a potentiometer to monitor the contrast), and a TSSP4P38 as IR proximity sensor. As i want to use a Lipo (3v7), i added a XC6206 voltage regulator that seems low-power (around 1µA current draw). the wiring on each pinout of the MSP430 is not definitive, as i only need 2 analog input, and the other are digital output (if i'm not mistaken).

Here is the schematic: (sorry if it's a bit messy :S) proximity device

Could you please give me inputs on that circuit ? Thanks !!

  • \$\begingroup\$ I don't know your DIGISPARK board, but my guess would be 9V is far too high a supply voltage. \$\endgroup\$ – Marcus Müller Oct 21 '17 at 13:23
  • \$\begingroup\$ The OLED display will be the biggest energy eater, 20mA@3.3V. A 9V block only has about 300mAh, this gives you 45h of operation, no losses considered. \$\endgroup\$ – Janka Oct 21 '17 at 13:25
  • \$\begingroup\$ I was planning on making it work only about one minute per day. \$\endgroup\$ – Bibindoum Oct 21 '17 at 15:46

If concerned about battery life, consider not using any COTS micro controller board with an on board analog power regulator:

On-board 500ma 5V Regulator (MC78M05BDTRKG)

If you must use a regulator, consider a more efficient switching power supply.

Also, to extend the battery life you should use an LCD with no back lighting.

The technique you are using (amount of reflected light?) requires all target surfaces to be identical. Instead, use a parallax infrared IR / LED distance sensor. It will be much easier as there is no calibration. And the distance is in the form of an analog voltage.

Programming a processor & designing hardware for long battery life operation is not trivial. It requires good hardware design techniques and detailed low level processor knowledge to get down to uA levels.

  • \$\begingroup\$ Thank you for your advices ! As for the MCU, all i want is a low-cost and small board that offers pinouts for the proximity sensor, and the display. No additionnal element is required. But my knowledge in MCUs is not enough to properly choose one. Do you have some hints to give about that ? \$\endgroup\$ – Bibindoum Oct 21 '17 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.