Raspberry Pi current draw .......

CPD

Well-known member
Joined
20 Sep 2006
Messages
2,995
Location
Hampshire
Visit site
35ft sailing yacht. One start battery, 2 x 110AH domestics. Rutland 913 and 100w solar panel.

I have a plan.

One pi unit will be navigation only - charts, AIS, tides, weather etc etc etc. Only switched on when on board otherwise completely isolated.

Another Pi will be used to send data over a 3/4G network (lets say one request every 2 days or so), and I am thinking battery voltages, temperatures, actual wind, GPS, etc etc etc.

From those "in the know", what sort of current draw should I expect from an efficiently powered (ie 12 to 5.1v) Pi ?...... which I presume would also power the 3/4G card ?

Thanks as usual :)
 

Lon nan Gruagach

Active member
Joined
12 Mar 2015
Messages
7,172
Location
Isle of Eigg
Visit site
35ft sailing yacht. One start battery, 2 x 110AH domestics. Rutland 913 and 100w solar panel.

I have a plan.

One pi unit will be navigation only - charts, AIS, tides, weather etc etc etc. Only switched on when on board otherwise completely isolated.

Another Pi will be used to send data over a 3/4G network (lets say one request every 2 days or so), and I am thinking battery voltages, temperatures, actual wind, GPS, etc etc etc.

From those "in the know", what sort of current draw should I expect from an efficiently powered (ie 12 to 5.1v) Pi ?...... which I presume would also power the 3/4G card ?

Thanks as usual :)

Pends on the Pi.... But they are very very good at shutting down bits that arent used. So good, in fact your question cannot be answered.
If you want a reasonable idea then power it from a USB power bank. If its a reputable one you should have a good idea of its capacity.
So, how to save power on a Pi. Dont connect a display (or have the display turn off) that will shut down the GPU
Do not use WiFi, or at least make the network go silent (turn off the router)

Ballpark for a quiet Pi is less than 1W, so <fag packet calc>0.1A @ 12V allowing for loss in DC->DC buck converter</fag packet calc>
 

Mistroma

Well-known member
Joined
22 Feb 2009
Messages
4,909
Location
Greece briefly then Scotland for rest of summer
www.mistroma.com
That's nice! That is precisely what I was coding on an Arduino, but ... already done. Lovely!

I had a similar plan and blew about £1.65 for an Arduino nano (well a few of them at that price actually). My existing alarm died and I thought I'd re-use the sensors. I'll check the original unit out when returning to the boat but it made sense to buy bits to make a new one as cost is negligible. GSM, GPS,SD etc. are all pretty cheap. I spotted a 4G SIM7000C going for £10 and was tempted by that instead of usual SIM800L going around. Unfortunately, I forgot about it and didn't bid (it went for £11).
 
Last edited:

rszemeti

Active member
Joined
17 Jul 2018
Messages
738
Location
Bewdley, Worcs
Visit site
my "missing things on eBay" came to an end when I started using Gixen to snipe my bids for me.

I have a few sim-card things and GPS devices from various other long forgotten projects. Re-purposing them won't be an issue.

I'm not very good on Python, I seem to be allergic to languages that use white space instead of brackets. C, C++, C#, Perl, Java and PHP are my tools of choice, I can even manage a bit of Lisp/Scheme if I have to, but Python is a closed book to me.
 

gregcope

Well-known member
Joined
21 Aug 2004
Messages
1,609
Visit site
I really like python. Simpler than C/C++/Java. Loads of packages to do hard bits.

Anyhow; the original mopi used 20ma when asleep, so I stopped and started on a low power ardunio clone;

https://github.com/gregcope/ABoatMon

Not quite finished, but is teaching me more C/C++. May never finish.
 
Last edited:

Lon nan Gruagach

Active member
Joined
12 Mar 2015
Messages
7,172
Location
Isle of Eigg
Visit site
my "missing things on eBay" came to an end when I started using Gixen to snipe my bids for me.

I have a few sim-card things and GPS devices from various other long forgotten projects. Re-purposing them won't be an issue.

I'm not very good on Python, I seem to be allergic to languages that use white space instead of brackets. C, C++, C#, Perl, Java and PHP are my tools of choice, I can even manage a bit of Lisp/Scheme if I have to, but Python is a closed book to me.

Totally with you re Python there, but you forgot documentation. Python would be better if it had crap documentation, sadly it dosent even have that.
And then theres "if it looks like a duck and quacks like a duck its a duck" great way to get bitten on the arse by a sheep in wolf's clothing!
 

laika

Well-known member
Joined
6 Apr 2011
Messages
8,173
Location
London / Gosport
Visit site
I'm not very good on Python, I seem to be allergic to languages that use white space instead of brackets.

I too couldn't get over the "formatting has no place in syntax" thing for a long time but late last year I bit the bullet by writing a system for my paid work in python, ostensibly because that was the language best understood by the folks who would end up supporting it but more than a little because there are good reasons for every boat hacker to know python.

Lots of people who are not hardcore programmers are picking up raspberry pis and having a go because they've got interested in boat projects. Python seems to be the designated pedagogical language for the raspberry pi. Tutorial examples are written in it and there's good gpio support. If you're writing something as an example to demonstrate something, it will be better understood by more people if you do it in python. If you're writing a bit of code you want to share for others to extend or refactor to their own purposes, it's best done in python. Even if folks don't know python, so long as you avoid tricksy pythonic idioms it looks pretty much like pseudocode.

So I'll argue that regardless of dogma, or whatever your favourite language is (and mine's certainly not python), python is the best vehicle for the open source spirit of co-operation and mutual aid in the boat hacking community.

Totally with you re Python there, but you forgot documentation. Python would be better if it had crap documentation, sadly it dosent even have that.

I disagree. The documentation may not be up there with the hallowed teachings of K&R but I found it to be a decent base onto which to layer judicious googling for modules I needed to support some of the operations I needed to do.
 

rszemeti

Active member
Joined
17 Jul 2018
Messages
738
Location
Bewdley, Worcs
Visit site
For something intended to run a) reliably and b) for an extended period of time, I would go with C. Memory leaks are a PITA and while I might trust a Python script to run for a day or so, for an application such as a boat position/sinkage monitor, which could be running for several months, I think C is the way to go.
 

Lon nan Gruagach

Active member
Joined
12 Mar 2015
Messages
7,172
Location
Isle of Eigg
Visit site
For something intended to run a) reliably and b) for an extended period of time, I would go with C. Memory leaks are a PITA and while I might trust a Python script to run for a day or so, for an application such as a boat position/sinkage monitor, which could be running for several months, I think C is the way to go.

If thats yer worry then write code that doe sits bit and quits. Keep triggering it via cron. Thats probably a better way of doing it regardless of memory leaks since you just never can trust these programs to stick to the plot.
 

gregcope

Well-known member
Joined
21 Aug 2004
Messages
1,609
Visit site
I too couldn't get over the "formatting has no place in syntax" thing for a long time but late last year I bit the bullet by writing a system for my paid work in python, ostensibly because that was the language best understood by the folks who would end up supporting it but more than a little because there are good reasons for every boat hacker to know python.

Lots of people who are not hardcore programmers are picking up raspberry pis and having a go because they've got interested in boat projects. Python seems to be the designated pedagogical language for the raspberry pi. Tutorial examples are written in it and there's good gpio support. If you're writing something as an example to demonstrate something, it will be better understood by more people if you do it in python. If you're writing a bit of code you want to share for others to extend or refactor to their own purposes, it's best done in python. Even if folks don't know python, so long as you avoid tricksy pythonic idioms it looks pretty much like pseudocode.

So I'll argue that regardless of dogma, or whatever your favourite language is (and mine's certainly not python), python is the best vehicle for the open source spirit of co-operation and mutual aid in the boat hacking community.



I disagree. The documentation may not be up there with the hallowed teachings of K&R but I found it to be a decent base onto which to layer judicious googling for modules I needed to support some of the operations I needed to do.

+1 to all of that.

I find the docs okay/good. The raspberry pi name (the pi bit) is for python. Its target language for children/learners.

Any hoooooo Those SIM7020E modules look good. Some are quite cheap. I see there are Raspberry Pi hats for $20 too;

https://www.waveshare.com/SIM7020E-NB-IoT-HAT.htm
 

lw395

Well-known member
Joined
16 May 2007
Messages
41,951
Visit site
For something intended to run a) reliably and b) for an extended period of time, I would go with C. Memory leaks are a PITA and while I might trust a Python script to run for a day or so, for an application such as a boat position/sinkage monitor, which could be running for several months, I think C is the way to go.

I think for a system that needs to run unattended for extended periods, a hardware watchdog is the way to go.
I've seen code written by professionals go wrong in most languages from Ada to Vee, if there are language names beginning with W to Z, I've either forgotten or escaped them.
 

prv

Well-known member
Joined
29 Nov 2009
Messages
37,361
Location
Southampton
Visit site
I too couldn't get over the "formatting has no place in syntax" thing for a long time

Consider the reason for it.

Unless you're very strange, you indent your C-like code to help whoever's reading it to keep track of scopes, loops, etc.

But the compiler doesn't pay any attention to that indentation, only to the braces. Which, if wrong, mostly won't be noticed by a reader, who goes by the indentation.

So now you have two different systems expressing the same thing, one for use by the compiler and one for use by people. And we all know that in software, if you have the same information in two places, there's a risk that sooner or later they'll get out of sync.

Python seeks to remove that risk by only using one system to express scoping, loop bodies, etc. And given the choice of which to use, it obviously makes sense to pick the one that's preferred by the humans, and modify the interpreter to deal with it.

Now you only have one system in use, and it can't get out of sync with itself.

Seems rather elegant to me.

Pete
 

gregcope

Well-known member
Joined
21 Aug 2004
Messages
1,609
Visit site
Agree a watchdog is way to go. Will be including a reboot / watchdog on my ABoatmon version.

The mopi powercycles the Pi so this is less of an issue (although you have to trust the mopi)
 
Top