Controlling voltage to components

Go To Last Post
19 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, I am building a circuit using a ATTiny, a 1.3 oled color screen, and two AAA batteries.

The batteries provide enough power to run the circuit, but they don’t run long before the 5v screen gets so dim it’s tough to see.

So I curious, do I restrict the power to the Mini and boost power to the screen. Currently I just have the power from the batteries running directly to vcc and using an output pin to turn the screen on and off.

I need to get 3 months of use out of the small batteries using deep sleep when the user is not using the devise. The users will probably use the devise 5 or 6 times a day fir a minute or two at a time.

I worry about adding any elements to the circuit that will cause more of a drain.

Last Edited: Sun. Mar 7, 2021 - 06:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can keep the power as you describe but add a p-channel mosfet as a power switch, controlled by the micro. Put the micro to sleep and wake it on a button push (probably via interrupt). One secret: turn off all of the OLED logic inputs before you turn off its power or you will have significant problems. Just been through that on my product and it was a really nasty one. In this case, it was a USB bridge IC powered from USB when USB is connected. When power is removed, there is a short time after the power goes away while there is still voltage applied to the interface IC pins from the micro. It was sneaky!

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I assume it's still the same project.

 

and to help you you really need to answer some of the questions in the other threads !

 

I will repeat some here :

 

What need to run when it's off ? 

how does it wake up? (by action of ?) 

when does the display turn on and off.

 

For the info I have so far, I have to ask does it even need to be powered when it's off (in sleep)? 

Last Edited: Sun. Mar 7, 2021 - 11:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the other thread: https://www.avrfreaks.net/forum/which-chip-choose-my-final-project you stated the run current as 32mA with ESP32. I notice that you've swapped ESP32 out for ATtiny for some unknown reason, what is the run current now ?

 

edit: I see https://www.avrfreaks.net/forum/are-nanos-acceptable-retail-products answers why the change to ATtimy. It is no doubt a better choice for a production run of 5000 pcs.

 

Last Edited: Sun. Mar 7, 2021 - 04:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobioknight wrote:
Hello, I am building a circuit using a ATTiny, a 1.3 oled color screen, and two AAA batteries. The batteries provide enough power to run the circuit, but they don’t run long before the 5v screen gets so dim it’s tough to see. So I curious, do I restrict the power to the Mini and boost power to the screen. Currently I just have the power from the batteries running directly to vcc and using an output pin to turn the screen on and off. I need to get 3 months of use out of the small batteries using deep sleep when the user is not using the devise. The users will probably use the devise 5 or 6 times a day fir a minute or two at a time. I worry about adding any elements to the circuit that will cause more of a drain.

Letting the smoke out since 1978

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How is the 5V oled display getting 5V from the two AAA batteries?

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I need to get 3 months of use out of the small batteries using deep sleep when the user is not using the devise.   The users will probably use the devise 5 or 6 times a day fir a minute or two at a time.

Why are you not using an on/off switch?.... simple &  no leakage current.  Don't be afriad to try one.

 

If you want to get everything out of the battery, you need a boost converter...but it takes care & you need to avoid leakage in standby.   Many boost device circuits cannot be turned off, due to the topology.   Leakage is your enemy, since it is present 24/7 (hence use an actual switch if possible).

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok so the oled although it’s a 5v screen still works at the 3v from the batteries. The screen is only on for a short loop to display the current information.

I am using deep sleep modes to keep track of how long the system has been running, without a RTC that saves the start date allowing me to alert the user that their 90 days have expired. I need to wake on timed intervals than add those into non volatile memory until 90 days worth have been accumulated. At each wake the screen is powered down and accumulates the total the. Goes right back to sleep.

I switched from the esp32 which I have used on numerous other projects, but after posting on another thread and getting feedback, I realized it was overkill and much cheaper to use a ATTIny on this project since I was excluding the WiFi and Bluetooth features of the esp anyway. I was able to get the esp running a lower mA but not low enough, after 3 or 4 weeks my oled was so dim I could barely read the details, the ATTiny will run at a much lower mA at the slower clock speeds and their appears to be a higher availability of ATTiny chips available. So I have decided to reprogram and go with the ATTiny.

I can’t use an on off switch as I need it to be ready to monitor activity without having to be switched on so I’m using wake features to wake, run the oled through the different screens then the screen turns off while the user is still being monitored then when there is no activity the system sleeps again.

Last Edited: Sun. Mar 7, 2021 - 08:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

digitalDan

 

Loved the DEC machines, started out on a PDP 11/23, Assembler and C.

 

Shame that went under.

 

Do you still have a machine?

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you still have a machine?

The real question is, do you still play lunar lander or hunt the wumpus?

 

 

 after 3 or 4 weeks my oled was so dim I could barely read the details

You need to boost your Vbatt...also, you could possibly use a few cr2032 coin cells in series.  You are not clear---does the LCD come on each time of wakeup---what do you display? Or only does it come on after 90 days?  Where is the schematic?   You might be able to power the LCD from an I/O pin.   What exactly happens after 90 days?  Does the code save an eeprom value that permanently knocks itself out?

90 days sounds too short---this will be generating a lot of environments waste of scrap units.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, thought I was clear on the oled.

I am using a pin from the controller to power cycle the oled. During the timed wake to add to the accumulated timer the Oled is asleep.

When the controller is activated by the touch of the button the Oked is powered up through a short loop of screens then powers down.

When the sensor wakes the controller, the oked is powered up during the loop through, then is powered down throughout the rest of the time the sensor is reading activity. When activity stops the processor goes back to sleep.

The counter adds to the volatile memory until a few days is accumulated then gets cleared as the counts get written to memory.

90 days is a warning to reload supplies and change batteries. And the 90 days starts over again.

Last Edited: Sun. Mar 7, 2021 - 09:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you going to boost the battery voltage or not?

The counter adds to the volatile memory until a few days is accumulated

So the user can circumvent the timing by pulling the batteries a few seconds every few days? 

 

90 days is a warning to release supplies and change batteries ​​​​​​​..I'd hate a system that required me to throw away batteries every 90 days.  My little indoor/outdoor thermometer can runs a few years on its batteries & it has an rf link to the outdoor sensor & has a digital clock display.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But why don't you use a AVR with RTC that run on a 32KHz crystal ?

(I know it's old but I use a mega324 and that use about 1uA with RTC running).

 

You also need to look into what to do when the voltage get's to low, do you need BOD, if yes then go for some of the never chips that have sampled BOD to save power. (and yes you need BOD if you want to write to the EEPROM ;) )

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do I boost or not, well that’s the question now isn’t it.

Boosting the power to the oked, won’t that just reduce the longevity of the batteries.

I think an lcd reflective screen draws much less power than an oked. I also expect your rf outdoor sensor spends most of its time in a low power sleep mode and intermittently sends the signal to the indoor clock or display, usually the outdoor slave unit is screenless but obviously your has a screen.

Also, yes if the data has not been written then a few hours could be lost but the time is not critical if a few hours are lost because the batteries were pulled from the unit

Last Edited: Sun. Mar 7, 2021 - 09:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Curious about the click speeds. I’m familiar with the RTC as a counter to track and use the Millis features, but not as an actual clock because is only goes so high before starting over again. So technically I am using this feature as a wake and record function

But why did you suggest the 32khz speed. I’m curious about clocking speeds. How do we determine which clock speed to run, lower appears to use less power but what effect does it have on processing sensor data.

Last Edited: Sun. Mar 7, 2021 - 10:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

On a AVR with "real" RTC, it's a circuit by it self, so it's not (in general) the same clk as the one the AVR use.

 

A normal chip in (deep) sleep stop the clk, so you can't keep time.

A chip with RTC it run even when the rest of the chip are stopped. 

 

Add:

if the correct time isn't needed most AVR's have a low power clk (the one the WD use), that also can run in deep sleep, but that is not precise. (so how big an error can you live with)?

Last Edited: Sun. Mar 7, 2021 - 10:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is a thermometer, that you read on the wall.  The batteries last a long time, at least 1-2 years--it has an rf comm to the outdoor sensor.

 

You don't seem to appreciate the battery situation. The boost needed, so the batteries can get down to, say, 0.9V...1.8v total...how are you proposing it?

What exactly are your plans for using all of their energy?

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps the AVR Butterfly board can give you some ideas ?

(It's a AVR dev. board that have a LCD display drive by a MEGA169 and the power is a coin cell.)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well this evening was very enlightening, I uploaded my code and the ATTiny is running at 1kHz only .1mA with a coupe resistors attached. This is great news for my power troubles that I was experiencing with the esp32. I expect I will have the ability to raise the speed and boost power to the screen and still have plenty of power to last for the term required. Now I will need to figure out the best way to either boost power to all or just the screen and figure out what that circuit will look like.