Main Menu

DIY Moteino design

Started by Tony Weil, January 25, 2018, 07:27:53 PM

Tony Weil

I've been considering rolling my own DIY Arduino/Moteino PCB. The purpose is to a) make sensor nodes on a single PCB with microcontroller, RFM69, circuitry for sensor and b) to practice my KiCad, SMD soldering, maybe learn some reflow, learn/understand Arduino circuit design, bootloaders, etc. I want the nodes to be low power, 3.3V/16Mhz (8Mhz would be OK), built-in Lipo battery charger, and powered by either USB/Wall Wart or Lipo Battery.

A lot of what I want to make is on the Adafruit Feather 32u4 RFM69HCW 915 Mhz RadioFruit. https://www.adafruit.com/product/3076, https://learn.adafruit.com/adafruit-feather-32u4-radio-with-rfm69hcw-module

1) Are there any downsides to using an Atmega 32U4 versus the 328P. The 32U4 is a couple of dollars more expensive and uses slightly more power (10mA vs 8mA typically). Is the 32U4 more difficult to use because the Serial Port disappears during reboot?

2) I noticed Moteino's and even MightyHat have the RFM69 soldered to the bottom of the PCB? Is that just to save space or are there other reasons such as shielding with a ground plane??

3) The Radiofruit uses an AP2112-3.3 that has a dropout voltage of 250mV and max current of 600mA. The Moteino uses an MCP1703 that has a 675mV dropout and 200mA max current which is plenty. Are there advantages to the MCP1703? The two regulators seem similar in price of less than 50 cents or so.

4) I really like the diode circuit the Radiofruit uses to autoswitch between USB and battery power depending on whether or not a battery, USB or both are connected.

Thanks,
Tony

LukaQ

Quote from: Tony Weil on January 25, 2018, 07:27:53 PM
3) The Radiofruit uses an AP2112-3.3 that has a dropout voltage of 250mV and max current of 600mA. The Moteino uses an MCP1703 that has a 675mV dropout and 200mA max current which is plenty. Are there advantages to the MCP1703? The two regulators seem similar in price of less than 50 cents or so.
The AP has enable pin, you probably won't need that. Max voltage is very much lower than MCP. Has high output current, good for H version of RFM. Has good dropout voltage of about 0.25v(0.4V max), good for battery applications. Quiescent current is still ok, but you do want it to be as low as possible

The MCP has pretty high input voltage, still has enough current for H version of RFM with 250mA, has about 0.6V dropout voltage, not the best for battery power devices. Quiescent current is a lot better, if you have long sleep cycles

I think in your case AP would be better for nodes that are active more and MCP maybe for others, that sleep for minutes to hours between sending data

Uncle Buzz

#2
To my mind, nor MCP1703 nor AP2112 are good choice... If you know what you will do with your mote of course.

Moteino is such an universal product, Felix doesn't know what you want to build with it, he doesn't know which power you need nor which source of power you want to use, so he choosed MCP1703 as the best compromise between large range of input voltage, moderate dropout, enough power to build many things, and low quiescent cunsomption for lowpower motes.

In your case, if you know (because you decided it) input voltage will be from 5V USB/wall wart or from a Lipo battery, your compromise won't include a large range of input voltage.
Also, if you need lowpower mote, you can choose very low quiescent LDO like MCP1810 (20nA quiescent current, but only 150mA max current, probably too short for RFM69HW, and not suitable if you need to power something else), or an ultralow dropout regulator with more quiescent current if your power in active status is more important than power in standby status.

As you know your application, you can also choose an other option : use a LiFePo4 battery which don't need any LDO to supply power to your microcontroller nor your radio (LDO from 5V is still needed, but could be include in your charger).

It depends if you want to build like Felix such a framework to build many things, and so make compromise to ensure you will be able to build everything you want with it, or if you want to build many specialized PCB. As you won't have to deal with same constraints, your choice will be different.
Price and availability are also some variable constraints, it's difficult to advise you without knowing what you want to build with this PCB.

Be aware than quiescent current is always given for no output, check the curves for the quiescent current depending of the output, you can find lower quiescent current at no load, but more current at your working output, so check the curves and not only the max/min figures.

Depending of how much power you want to save, an ideal diode could be a good choice.

Felix

Tony,

Quote from: Tony Weil on January 25, 2018, 07:27:53 PM
1) Are there any downsides to using an Atmega 32U4 versus the 328P. The 32U4 is a couple of dollars more expensive and uses slightly more power (10mA vs 8mA typically). Is the 32U4 more difficult to use because the Serial Port disappears during reboot?

I had mixed experiences with the 32u4. Yes it has USB and eliminates the need for FTDI, but also the USB bootloader is much larger, and it would have been a pain to make it compatible with dualoptiboot. If you dug the blog far in the past, you would have noticed I actually made a board called Moteino Leo which had this 32u4 chip on it. The dropping of the USB port was driving me nuts, and same for some users. So no easy path to wireless programming, chip cost more, it had a few nicer features, but the same amount of memory on a 8bit platform - to me not a huge advantage. So I stuck with the much more hobbyist approachable and more ubiquitous 328p. But each person might have a different experience and opinion, this is just my 2 cents on the 32u4. Rather than invest in a 8bit 32u4 I would look into 32bit arm stuff, like STM32.

Quote from: Tony Weil on January 25, 2018, 07:27:53 PM
2) I noticed Moteino's and even MightyHat have the RFM69 soldered to the bottom of the PCB? Is that just to save space or are there other reasons such as shielding with a ground plane??
Mostly space saving (how much bigger would the board be if all on same side?) and a bit more shielding from the digital side although how much that really matters is debatable since it's a 2 layer board anyway.

Quote from: Tony Weil on January 25, 2018, 07:27:53 PM
3) The Radiofruit uses an AP2112-3.3 that has a dropout voltage of 250mV and max current of 600mA. The Moteino uses an MCP1703 that has a 675mV dropout and 200mA max current which is plenty. Are there advantages to the MCP1703? The two regulators seem similar in price of less than 50 cents or so.
Uncle Buzz almost read my mind with his response.

Got low power?
Compare quiescent current. 2uA for the 1703 and 55uA for the AP2112. Which would qualify for truly "low power"?
To me powering your devices from the microcontroller's LDO makes no sense. If you have motors and lots of LEDs and power hungry stuff, sounds like you need a better power strategy than dump it all on the poor LDO which is supposed to keep the 3.3v rail nice and clean for your digital stuff (MCU, radio, etc). I much prefer the 2uA and 250mA (which is still a "ton" for most things) over the dismal 55uA.

Quote from: Tony Weil on January 25, 2018, 07:27:53 PM
4) I really like the diode circuit the Radiofruit uses to autoswitch between USB and battery power depending on whether or not a battery, USB or both are connected.
It's just a shottky to block current going into the Vbat from 5V.

The more stuff you have on a single board the less modular it is. BUT what you could do is have unpopulated footprints which you can use as needed. But anyway you will learn a lot regardless how you approach this.
LDO-wise choose what works best for your app. In my case and most people that I talked to, the Moteino's LDO is perfect and can run years on batteries (ie the 2uA which to some low power "far right-ers" is still too much doesn't really make a significant dent in the long run of a mote if it's properly coded and put to sleep).

Tony Weil

I was wary of using the 32U4. I will now just stick with the 328p. I can easily just program with an FTDI cable.

You make an excellent point about the large difference in the quiescent current of the MCP1703 vs the AP2112. Most of my sensors will use a 4.2V/3.7V LiPo battery and a RFM69HCW. My only concern is getting as much useful life out of the battery as possible as the battery voltage gets lower with usage. With the higher dropout voltage, it seems that the MCP will stop working around 3.9V, whereas the AP will work down to 3.55V, right?. Although, if you use up the battery capacity faster in the AP, it may not matter. Using the schottky diode circuit to to power or charge the battery with a 5V wall wart or power with a LiPo battery would seem to make the situation even worse, with the forward voltage of the diode lowering the voltage available to the regulator even further. My understanding is that LiPo batteries start at 4.2, drop down to 3.7 for the majority of the battery life and are dead around 3.4.

So, let me ask the question a different way. How are people powering a Moteino/RFM69 with a battery that lasts a reasonably long time, assuming you only have 3.3V low power components and use power down sleep modes?

On a slightly different subject, is it possible to lower the transmit power consumption of an RFM69HCW through firmware (radio.setHighPower, ATC setting?)  to the same as an RFM69CW transmit power consumption. It just seems easier to standardize on an HCW so you can raise the power when you need it and lower it when you don't.

perky

#5
True LDO regulators start working at much lower voltages, the top FET is basically full on until it reaches the regulated voltage. The dropout voltage is basically the voltage across the FET's resistance, which is why it linearly increases with current. So an LDO acts more like a voltage clamp. The AP2112 for example starts working at about 0.8V (see Output Voltage vs. Input Voltage graph). However you have to be careful in low power situations, sometimes the quiescent current increases when the input is below the regulated voltage value.

You should be aware though that when the input voltage is below the regulation value plus the dropout voltage it behaves like a resistor in series with the supply, and that resistance is the slope of the dropout voltage v. current graph, in other words there will be a voltage drop whenever it supplies current. Once the input gets above that value the output is fully regulated.

Mark.

Felix

Quote from: Tony Weil on January 27, 2018, 04:16:55 PM
So, let me ask the question a different way. How are people powering a Moteino/RFM69 with a battery that lasts a reasonably long time, assuming you only have 3.3V low power components and use power down sleep modes?
Multitudes of ways. Anything works as long as you got the headroom to keep the LDO happy (see Marks' valuable info above).
If you have to ask, you probably don't have to worry much about it. The crucial aspect here is to properly sleep the Moteino (can't speak to others here but to pick your feather example at 55uA that faucet is reallllllly leaky), into the uAs range - keeping it below 10uA with most low power sensors and you will get bored waiting for it to drain. Just a set of AAs or a small LiPo will last LOOONG!

Quote from: Tony Weil on January 27, 2018, 04:16:55 PM
On a slightly different subject, is it possible to lower the transmit power consumption of an RFM69HCW through firmware (radio.setHighPower, ATC setting?)  to the same as an RFM69CW transmit power consumption. It just seems easier to standardize on an HCW so you can raise the power when you need it and lower it when you don't.
Tom's RFM69_ATC addition is essential and excellent. As it is now included in the RFM69 library it works with both W/CW and HW/HCW, so just set the IS_HW_HCW parameter correctly to match your radio. if you want to standardize, then yes go with HCW, there's plenty of power overlap with the W/CW and you probably will need the extra power, rather than the lower TX power ability of the W/CW radios.

Tony Weil

Quote from: Felix on January 27, 2018, 08:10:57 PM
Anything works as long as you got the headroom to keep the LDO happy (see Marks' valuable info above).
If you have to ask, you probably don't have to worry much about it.

Got it, I think. So, with the MCP1703 3.3V regulator, the 4.2/3.7V Lipo battery should be able to more or less discharge down to as low a voltage as it will go, and still provide power to the Moteino. If the current draw when the regulator is active is low, such as less than 50ma when the RFM69 is transmitting, all the better. As Felix said, if I have to ask, I probably don't need to worry about it. I'll just continue to use the MCP1703 and a 4.2/3.7 Lipo like I have been with the Moteino and not worry about it.

Quote from: Felix on January 26, 2018, 11:17:29 AM
It's just a shottky to block current going into the Vbat from 5V.
Should I bother to try to use the shottkey to be able to automatically choose between wall power and battery? Will the diode 0.5V forward voltage be a problem for the regulator as the battery discharges towards empty? In the past, I have just put in a jumper to choose between battery power/charging or wall power and no battery, which works great.

Quote from: Felix on January 27, 2018, 08:10:57 PM
Tom's RFM69_ATC addition is essential and excellent. As it is now included in the RFM69 library it works with both W/CW and HW/HCW, so just set the IS_HW_HCW parameter correctly to match your radio. if you want to standardize, then yes go with HCW, there's plenty of power overlap with the W/CW and you probably will need the extra power, rather than the lower TX power ability of the W/CW radios.

What happens if you don't include the IS_HW_HCW parameter for an RFM69HCW radio?

Is using the RFM69_ATC addition to control transmit power for the RFM69HW/HCW as simple as choosing an appropriate value for ATC_RSSI to run in the radio.enableAutoPower(ATC_RSSI) command? Is it documented somewhere what values of ATC_RSSI relate to what transmit power settings other than the following comments in the code?

//Auto Transmission Control - dials down transmit power to save battery (-100 is the noise floor, -90 is still pretty good)
//For indoor nodes that are pretty static and at pretty stable temperatures (like a MotionMote) -90dBm is quite safe
//For more variable nodes that can expect to move or experience larger temp drifts a lower margin like -70 to -80 would probably be better
//Always test your ATC mote in the edge cases in your own environment to ensure ATC will perform as you expect

Tony Weil


LukaQ

Quote from: Tony Weil on January 28, 2018, 05:09:13 PM
What happens if you don't include the IS_HW_HCW parameter for an RFM69HCW radio?
From what I was, it works like non H, PA0 on, PA1,PA2 and BOOST off

Uncle Buzz

There is not as much choice than for LiPo battery, but check LiFePo4 lithium ion batteries, they are safer to use than classics LiPo, and they are working between 3.6V to 3V, which almost all radios, microcontrollers or sensors are comfortable with, so no need to use an LDO.
There is also less choice for charger IC.

perky

#11
Quote from: LukaQ on January 29, 2018, 01:16:48 AM
From what I was, it works like non H, PA0 on, PA1,PA2 and BOOST off
Not sure that's true, the schematic structure of the H versions is different to the non-H versions, there's an RF mux that selects between PA Boost during transmit and RFIO on receive. Only PA1/PA2 are on PA Boost and PA0 is in RFIO, so an H version is likely not to work at all without IS_HW_HCW, at least for transmission.

Mark.

LukaQ

#12
Quote from: perky on January 29, 2018, 04:14:57 AM
Not sure that's true, the schematic structure of the H versions is different to the non-H versions, there's an RF mux that selects between PA Boost during transmit and RFIO on receive. Only PA1/PA2 are on PA Boost and PA0 is in RFIO, so an H version is likely not to work at all without IS_HW_HCW, at least for transmission.

Mark.
I don't disagree, it is just what I tries few days ago, I had PA0 on, other ones off, there was link and signal was the weakest as expected. This might be forbidden use and it might not work as expected. I don't say use it in any way, just mucking about.

EDIT:it is just not possible to have PA0 on H version, since it is shown on p.19, figure 5., that only PA1 and PA2 are connected to boost pin (output). Now it is also shown that PA0 in connected to RFIO, which is input as well as output, but not sure how it is all connected on module itself, but as I see it in figure 7., PA1 is also on RFIO