pin 13

I'm brand new đồ sộ this. I'm trying đồ sộ get two Arduinos with LORA radios đồ sộ talk đồ sộ one another. I've done that following this guide.

Now comes the task of modifying the code ví it does something useful for má.

Bạn đang xem: pin 13

To start with, I noticed that every time the communication is occuring, the LED on pin 13 blinks. But WHY? I've searched through the sketch code and the SX1272 h and cpp files in the library and there's no definition for that pin that I can see at all.

I'm wondering if it is something with the Arduino core?

Hints on where đồ sộ look?

Goal: After debugging, I'd lượt thích đồ sộ disable that LED đồ sộ save power.

2

The on-board led for several Arduino modules is connected đồ sộ pin 13 for reasons of code portability. This i the "Blink" sketch led. If you're toggling pin 13 for other reasons, the led is going đồ sộ blink along with (and draw a little power). Some people go đồ sộ the trouble of unsoldering the led. Others (like me) put a dab of enamel on the led when its blink (but not its power consumption) is bothersome.

best,
Michael

While that solves the problem (remove LED)... I also want đồ sộ learn.

I don't see anywhere that Sạc 13 is used. What should I be looking for?

4

What should I be looking for?

The stickies at the top of the diễn đàn, specifically the one that says POST YOUR CODE and links đồ sộ any non-standard libraries.

I'm guessing that SPI is involved.

OK, I'll go read. Thanks.

6

Removing the led will not compromise the operation of your Arduino--assuming you can vì thế ví without breaking or cooking any traces or components. It's only there đồ sộ be used in sketches and đồ sộ flag SPI traffic (but its removal shouldn't affect SPI otherwise).

--Michael

7

It's on pin 13, and you're using SPI communication. Sạc 13 is SCK for SPI.

Depending on the board, the LED may be the least of your problems for battery use. The Arduino boards aren't very good for use on batteries, which is sort of strange considering what people want đồ sộ use them for. The full-sized boards (Uno/etc) are hopeless. Pro Mini's are the best, but you still have đồ sộ pull the LED off, and people usually recommend pulling the regulator too - the quiescent current on those is often high enough đồ sộ matter, and you're not using it on battery.

Save power - that's funny. The LED draws maybe 2mA when it is on.
The parts you can't turn off use more - the 5V regulator, the 3.3V regulator, the USB/Serial interface, the op-amp that drives the LED, the autovoltage sensing circuit, the power LED, the Rx & Tx LEDs with the USB/Serial chip.

If you really want đồ sộ save power, program a Promini with an FTDI Basic, unplug the FTDI Basic when your project is running standalone, and power the Promini with 5V from an efficient switching regulator and vì thế not use the onboard regulator.

DrAzzy:
It's on pin 13, and you're using SPI communication. Sạc 13 is SCK for SPI.

Depending on the board, the LED may be the least of your problems for battery use. The Arduino boards aren't very good for use on batteries, which is sort of strange considering what people want đồ sộ use them for. The full-sized boards (Uno/etc) are hopeless. Pro Mini's are the best, but you still have đồ sộ pull the LED off, and people usually recommend pulling the regulator too - the quiescent current on those is often high enough đồ sộ matter, and you're not using it on battery.

OK, I'm smacking my face. I misread the pinout and didn't realize (rather "remember" since I hooked it up đồ sộ begin with) 13 was the SCK. So that answers that, thank you.

I am using the lowest power option: 8Mhz 3.3V Pro Mini with the power LED and regulator removed. I can also easily remove this LED, I just thought it would be easier đồ sộ simply not have it active. I presumed (dumb) that the code somewhere was actively turning it on and off.

CrossRoads:
Save power - that's funny. The LED draws maybe 2mA when it is on.

Now THAT's funny, if you think that's not significant! 2mA can mean weeks, if not months, of operational time in between battery changes, ví yeah... I want đồ sộ eliminate it.

Clearly context matters, and I didn't provide that (my bad)... but no need đồ sộ get flippant without the details (yours)

:wink:

Well, the LED is not even on all the time, ví the it's not 2mA of draw all the time. Using an Uno is not the way đồ sộ go đồ sộ save power - more stripped down hardware will get you there.
Running a bare '328P at 8 MHz from a 3.7-4.2V LiPo with no regulator or LEDs will really save you power, with use of Power Down Sleep mode during periods inactivity đồ sộ really cut down current draw. Here are some small minima component boards I offer: '328P, crystal, 22pF caps, 0.1uF decoupling caps, and DTR cap/reset pullup resistor on the back. Plenty of Gnd pins and 4 Vcc pins.
http://www.crossroadsfencing.com/BobuinoRev17/

Xem thêm: thịnh hành

Will you also be powering down the LORA radios?

Flippant - tone intended behind a thought is often lost in mạng internet text.

Yes, eventually I'll power down the radio too.

The end-goal here is a remote monitoring device that needs đồ sộ sit in the field for months or preferably years without battery maintenance. It isn't a constant monitor, ví I can get really frugal on the power. Ultimately what I want đồ sộ vì thế is post a "go" command đồ sộ a trang web and have the device wake up daily đồ sộ kiểm tra if today is a "go" day or not (which will be rare - perhaps 6 days out of the year). On a "go" day, it will begin gathering data from some otherwise inactive sensors and report that data once an hour for that day.

I'm currently using a Pro Mini, not an Uno. Actually I'm using both but the Uno is the gateway/base station and isn't power constricted. The Pro Mini will be in the field. At least for prototyping. Once I get it working I'll probably make a custom board with a space for the LORA module and antenna and then I can vì thế what I want w.r.t. LEDs

I've never before used Arduino. I'm just going this route due đồ sộ the sparse LORA documentation. I figured it would be easier đồ sộ learn Arduino-speak and utilize existing LORA tutorials vs. starting from scratch.

Might look into coin cell battery backed RTC also, DS3234 (SPI, no pullups needed lượt thích I2C needs), create an alarm that can wake the '328P đồ sộ kick off the "go" kiểm tra. Use P-channel FET đồ sộ control power đồ sộ the LORA.

Watch out for modules for DS323x testing - apparently some have a battery charging circuit, but either don't ship with a rechargeable battery, or don't monitor the charging and can overcharge.

I hadn't really thought about external RTC. Is the inbuilt that bad?

I'll have đồ sộ consider this some more. If it can't operate the timer in deep sleep then I'm sure I'll need something. Otherwise, my thoughts are I don't need it đồ sộ be battery backed and drift shouldn't really matter ví long as I'm not out by more phàn nàn a couple hours every 24 hour period (it can't be THAT bad, can it?).

I don't need absolute wakes. The device needs đồ sộ wake up every 24 hours (give or take a couple hours is fine) and see if it has a "go" command. If it doesn't, sleep another 24-ish hours. If it does, then wake up ever hour-ish and send back data.

The receiving side knows what time it is, ví I can timestamp on that.

I can appreciate that in many applications, exact timing is critical. Unless I'm missing something on the Arduino/programming side, there is no practical need in this case.

Thanks for the food for thought!

After some quick reading, I think I'm gleaning that the internal Timer 1 can only be stretched đồ sộ about 4 seconds while the WDT can be stretched đồ sộ about 8 seconds. Nowhere near 24 hours :slight_smile: it may be a lot more efficient đồ sộ use an external RTC

18

bcsteeve:
The end-goal here is a remote monitoring device that needs đồ sộ sit in the field for months or preferably years without battery maintenance.

Easy peasy.

Modify a Pro Mini (easy) ví it operates direct from 2 or 3 AA batteries.

If you wanted đồ sộ 'wake up' once every 24 hours, read a sensor\switch and transmit the result via LoRa, you should get around 5 years life from Alakaline AAs, 10 -15 years with the Lithium ones.

The range of the LoRa would vary depending on the location, anything from 400m in an urban area đồ sộ 400km with good line of sight.

I have reasonable line of sight (foliage in the way depending on season) with a range need of just over 1km. Base station has a directional patch antenna ví it really shouldn't be a problem I wouldn't think.

I think I'll just have đồ sộ experiment and see if it is more efficient đồ sộ wake up every 8 seconds (WDT), increment a counter, and go back asleep (and repeat some 10800 times) vs. running an external RTC. If someone knows the answer đồ sộ that... I'd love đồ sộ skip the work. Otherwise, I've now got the RTC on order and until it arrives I'll test door #1.

But đồ sộ get đồ sộ door #1, I have đồ sộ figure out how this thing even works. I've been at this for hours and I can't see how đồ sộ send a command from the gateway đồ sộ the kết thúc device. Grr.

20

The LowPower library works well, at max 8secs power down a counter for the number of 8second sleeps takes about 1mS đồ sộ increment and uses 4mA at that time.

So during a day the Pro Mini uses an average of 20uA itself ví an average 0.48mAhr per day and 0.01mAhr per day keeping count. So average battery use is around 0.5mAhr per day.

To wake up once per day just put;

LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

Inside a loop that runs 10,800 times.

Add an RTC as well if you lượt thích, but if one kết thúc of the links already has one, when the remote calls in once per day, send it back via LoRa an adjusted loop counter value (nominally 10,800) đồ sộ keep it on time.

Xem thêm: bạn muốn hẹn hò facebook

There is a picture of my tracker boards being used as a remote sensor on page 2 of a document called;

"Long Distance Tracking and Monitoring with LoRa - Introduction - April 2016"

Which you will find here;

Tác giả

Bình luận