Reducing current of my project

Hi, i'm working on a project for my car which currently have the following features(+modules):

0)Mini DC-DC Buck Converter (ajustable)

1)lock/unlock the car if my phone or family phone is in the area
(Here i used a HC-05 module only on command mode which always check if our phone is connected or not, the HC-05 module is attached to a npn transistor so i can switch it on/off from my arduino) + (a diy module to read if the car is locked and to interact with the central locking to change it)

2)1602 LCD (via i2c) with multiple informations/settings like (car battery voltage/temperature/features status)

3)x1 i/o pins expander (mcp23S17) for buttons/potentiometer which are use to navigate the lcd menu)

4)Interior light (just controlling a RGB led strip with mosfets)

5)Car alarm (using a vibration module + diy module with a relay for the alarm horn)

6)Long code (1300 lines) not very optimized but working (still have to solve little problems)

7)Arduino Nano (328p)

Here comes my question :
Because i want to attach it to my car (with a normal off battery drain of 15mA) i need to make it as low power as it can and this is a big problem because my current consumation is 68mA

First i tried to:

  • lower the voltage to 3.6V
  • remove leds from my Arduino NANO
  • remove leds from the LCD (actualy from the i2c convertor)

and the drain is now 36mA (still a lot from a decent consumation that won't affect my car battery
and beside that i even have a problem with my LCD ( the text have no more contract even if try to ajust it via the pot)

I'm also thinking at the following:
-removing the leds from the bluetooth module
-add a npn transistor for the LCD too and istead using lcd.nobacklight() as a idle timeout solution completly shut it down
-reducting the voltage to 3.1V
-tring to implement sleep into my code(but i'm still a very beginner so i'll start with the simple ones)
-still need to fix the lcd problem and i think i just need to replace a resistor for the background led (need to research)

I want to know your solution

*if anyone wants to have a look on my code here it is:
// Car alarm project G3orG3 @2016/* TO ADD: -MORE PINS -RGB LED - Pastebin.com (as i said i'm a beginner and this is my first medium-big project)*

Turn on the lights with your phone, sound your alarm with the phone :D?

akatchi:
Turn on the lights with your phone, sound your alarm with the phone :D?

(offtopic)
That would be cool but i need to build a android app for that and tp stop using the bluetooth module in command mode so it can listen to the app, and because of that i need to implement a unlock command in the app too which will be less accessible (to enter the application and press the unlock button) Rather than just walk by the car and automatically unlock it, there is still a method of building an android app with a background service that will automatically send this unlock message but then i have to use Android Studio and it's really fuc*ing hard to build it (i tried).

68ma from a 12v car battery typically rated at about 40 -60 A/H and a crank of 300+ A ?

You would have to leave you car unused for a month for it to be flatten by the Ardunio.

Perhaps turn off the lcd backight but think thats all that really needed.

Have a look at Nick Gammon's power saving tutorial.

...R

Did you measure the 12volt current or the 5volt current.
A buck converter would drop the voltage and increase the current proportionally (+ losses).
5volt/50mA could draw 25mA@12volt.
You must use a micro buck converter with low idle losses at those currents.

Leo..

Turning the LCD completely off is relatively simple, for example using techniques from the Nick Gammon tutorials already referred to by Robin above. Just remember that when you turn the LCD back on, you will have to reinitialize it.

Think about what devices really need to be on "all the time" and which are only needed once the device detects your presence. If the car is locked, there is presumably no one in it and the LCD is unnecessary. Attach all the devices that can be completely shut down when the car is not active and those that Need to be on. Using Nick Gammons Approach, turn the power on/off to those devices as needed. You will need two MOSFETs, one turns devices that are "always" needed on when the Arduino Wakes up (for example the Bluetooth detection), the other turns on devices that are only needed when the car is activated (for example the LCD, internal lighting, etc.).

Wawa:
Did you measure the 12volt current or the 5volt current.
A buck converter would drop the voltage and increase the current proportionally (+ losses).
5volt/50mA could draw 25mA@12volt.
You must use a micro buck converter with low idle losses at those currents.
https://www.pololu.com/product/2843
Leo..

I tested it on 12V line
I already have a nano one and the thing is i don't want 5V, 5V consume too much current, i adj mine on 3V and all the pieces work fine( i can't read the name of it, too small) http://thumbs3.ebaystatic.com/d/l225/pict/351733755736_1.jpg

JaBa:
Turning the LCD completely off is relatively simple, for example using techniques from the Nick Gammon tutorials already referred to by Robin above. Just remember that when you turn the LCD back on, you will have to reinitialize it.

Think about what devices really need to be on "all the time" and which are only needed once the device detects your presence. If the car is locked, there is presumably no one in it and the LCD is unnecessary. Attach all the devices that can be completely shut down when the car is not active and those that Need to be on. Using Nick Gammons Approach, turn the power on/off to those devices as needed. You will need two MOSFETs, one turns devices that are "always" needed on when the Arduino Wakes up (for example the Bluetooth detection), the other turns on devices that are only needed when the car is activated (for example the LCD, internal lighting, etc.).

Edit: I successful created a switch(using a npn transistor) for my lcd and it also had a 5V regulator so the text contrast is perfect
I also dropped the voltage of the Nano+expander+bluetooth to 3V
Current drain dropped to 30mA (idle)
I don't know if i can use the sleep commands for my arduino because it constantly communicate with the bluetooth module

beside that the expender can't be turned off since it have all the controls
the other functions like interior lights and others will be turned off by the code when the car will be off, i have a diy module that read that state from the central locking already

Also, as you said the bluetooth device must be on so it can detect my presence (this device already have a npn transistor to turn it on via arduino but i can't turn it off because then it will have a big delay detecting my phone, i only build it to switch from normal mode to command mode(where i can detect phones)

I understand that your Bluetooth sensor Needs to be able to respond "quickly" as soon as your phone Comes into range of the car. Whether or not you can use sleep modes lies in the exact Definition for this Project of the word "quickly". Do you really Need to test the sensor every few milliseconds? Would testing once per second be sufficient? Would testing every 5, 10, or 15 seconds be sufficient? For this case, itÄs obvious that testing once every 5 minutes is way to slow. Where exactly is the "sweet Point"? Once you know that, you can figure out if you can use sleep modes or not.

I've posted my findings on current saving here. I was testing with a Mega but some things might be helpful for a Nano. As suggested in a previous post Nick Gammon's power saving tutorial suggests that you should be able to get it much lower than where you currently are. I would look at disabling any on board hardware components you don't need, powering down the Arduino when not in "use" and waking on interrupt if you can and potentially using a lower voltage and CPU clock speed.

I found I got quite a bit of a saving (15mA) by putting the USB communications chip into reset mode by jumpering the reset and ground pins on the ICSP header. I haven't used a nano so I don't know how the USB communications work and whether this will work for you.

FTDI's Reset on a Nano is not broken out to be accessible, pin 19 is not connected to anything. Would have to tack a wire to the pin to try it.

CH430 equipped Nano, who knows.

CrossRoads:
FTDI's Reset on a Nano is not broken out to be accessible, pin 19 is not connected to anything. Would have to tack a wire to the pin to try it.

CH430 equipped Nano, who knows.

davidrh:
I've posted my findings on current saving here. I was testing with a Mega but some things might be helpful for a Nano. As suggested in a previous post Nick Gammon's power saving tutorial suggests that you should be able to get it much lower than where you currently are. I would look at disabling any on board hardware components you don't need, powering down the Arduino when not in "use" and waking on interrupt if you can and potentially using a lower voltage and CPU clock speed.

I found I got quite a bit of a saving (15mA) by putting the USB communications chip into reset mode by jumpering the reset and ground pins on the ICSP header. I haven't used a nano so I don't know how the USB communications work and whether this will work for you.

actualy is CH340
and by it's datasheet it consume 0.08mA maximum

so this won't be a problem

JaBa:
I understand that your Bluetooth sensor Needs to be able to respond "quickly" as soon as your phone Comes into range of the car. Whether or not you can use sleep modes lies in the exact Definition for this Project of the word "quickly". Do you really Need to test the sensor every few milliseconds? Would testing once per second be sufficient? Would testing every 5, 10, or 15 seconds be sufficient? For this case, itÄs obvious that testing once every 5 minutes is way to slow. Where exactly is the "sweet Point"? Once you know that, you can figure out if you can use sleep modes or not.

OPTIONAL TO READ
"the sweet point"
There are 3 phones and each if those need to be tested.
to test a device i first send a command via the serial which ask if there is any device connected with that bluetooth mac
after a few ms i receive the answer with the name of the device, and if this is also the correct one it passes and the car starts to unlock (if is off and unlocked) and things
However, unintentional delay(due to my bad code optimization or serial limits) is already 4-5s
and i can't make it bigger 10 sec would be too much (it's bluetooth 2.0 with a small area+ not exposed to air when it will be in the car)
he still to check if the device is connected to the bluetooth because i may just open the car to take my jaket and go back.
/OPTIONAL TO READ

I don't know if you know about the hc-05 module but after taking into consideration of using sleep modes i realise that there is a pin on my bluetooth module that suggest whenever a device is connected to it, so i can wake up my arduino using that pin and then check with my arduino if the bluetooth mac is the same with my phone ( as a second security mode beside the 4 digit pin)
But then there is another problem, i also have a alarm module ( a vibration module from an older alarm ) that also send a signal to my arduino BUT because of the lack of pins is attached to my expander (mcp23S17) which communicate via SPI, on the same expander is attached the car ignition signal and the buttons from the module which also need to wake up my arduino. I'll do future reseach to see if and how i can wake up my arduino via spi, and also wait for your answer

on the other side i'm still trying to lower the voltage to 1.8-1.9 because seems like the atmega328p on my nano supports it !!
ALSO, my expander does it too

And also the bluetooth module ( but the cip inside the module, not the module itself, because it has a external regulator

,i could connect the supply voltage directly to the cip and cut the line from the regulator, but i'm afraid to do those things since i only have 1 module and i will take another 40 days for another one.

anyway:
my current voltage is now 3.0V
the lcd is turned off by a npn transistor
and i have a 30mA drain in idle mode

Summary: How i can wake up my arduino via a SPI device (mcp23S17)

prologikus:
Summary: How i can wake up my arduino via a SPI device (mcp23S17)

  1. The easy way: connect wake up signal directly and some other signal via the port expander
  2. More difficult way: the expander has extra pin that you can connect to Arduino and that may inform Arduino when chosen input(s) of the expander is changed. But you need one extra pin for this anyway so the first way looks better to me.

Smajdalf:

  1. The easy way: connect wake up signal directly and some other signal via the port expander
  2. More difficult way: the expander has extra pin that you can connect to Arduino and that may inform Arduino when chosen input(s) of the expander is changed. But you need one extra pin for this anyway so the first way looks better to me.

I don't get the second way
, what pin ?

INTA or INTB (or both) ... see datasheet.