[SOLVED] Trash in serial monitor when battery powering... (trying to troubleshoot a hang)
stevebus last edited by Yveaux
I'm still trying to solve the hangs that I described in http://forum.mysensors.org/topic/2841/mysensor-hang-on-gw-send-and-possibly-roasting-radios
however, I have a separate question. I'm trying to hook the Mini up to the serial monitor, while still powered by battery. so have I my FTDI USB cable plugged into the computer, and then just the Tx/Rx lines connected to the Tx/Rx lines on the mini. Then, separately, I hook my batteries (two AA's) to the GND and VCC pins on the Mini. I get gobblegook in the serial monitor. I know the settings are right (board type, baud rate, etc), because if I pull the battery, and run wires from the GND and VCC plugs on the FTDI cable (to GND and RAW), and don't change anything else, I get good data in the serial mon.
I have cut the power LED as outlined on the "battery powering" page, but haven't disconnected the regulator yet.
This is all with fresh batteries (3.19 V across them).
So my questions:
- if battery powering, is the VCC pin the right place to connect the positive battery lead?
- any reason why I get the trash on the serial line vs. real data when powered via the VCC pin by battery vs. 5V into the raw pin?
- what is the lowest voltage the batteries can get to and this thing still work? (unrelated to this issue, but curious).
flopp last edited by flopp
- Isn't the lowest voltage for a Mini 3.3V?
- See 2
Did you connect grounds? Otherwise you will only get garbage.
Also the pro mini works with less than 3.3v (depending on the fuse settings) down to 1.8V as far as I remember. Take a look at the manual.
thanks for the reply... there are stories including the web site (http://www.mysensors.org/build/battery) of folks powering mysensors with Minis from two AAs, which will never reach 3.3V, so there has to be some tolerance below that in which everything still works (and even my sensor works, it just hangs after 12 hours or so).
So 3.3V can't be the minimum. Must be something lower.
good question, @LastSamurai .. I don't think I did. will check that when I get back to my machine.
I think the brown out detection will reset the pro mini 3.3 V at around 2.8 V, with "default" fuse settings. You can change the fuse settings to get around that. I'm no expert in these matters but there are plenty of posts in the forum about this and a couple of guides.
@martinhjelmare is correct, 2.8V is where the brown out detection kicks in by default. The datasheet figure 35-2. ATmega328P: Active Supply Current vs. Frequency (1MHz - 20MHz) has information on which voltage levels different clock frequencies require (8MHz is only guaranteed to work down to 2.7V, at 4MHz it can be used down to 1.8V). The nrf is rated for minimum 1.9V.
@LastSamurai - good catch on bonding the grounds. totally missed that. brain fart on my part. Getting good data in serial mon now.
@martinhjelmare and @mfalkvidd - thanks. I thought it was something like that. While the hang described in the original thread occurs regardless of power source (even powered from PC) and appears to be a separate issue, I did see some different erratic behavior earlier and the batteries measured at 2.91V. So probably getting close to threshold or something. And maybe it gets drug down when the radio transmits or the DHT11 reads or something, resulting in erratic behavior.
ToniA last edited by ToniA
Are you using the 115200 baud rate (I guess you are)? Try lowering the baud rate down to 38400 if you are running on 8 MHz. On 1 MHz you may need to go down to 4800. Well, this doesn't explain why you get total garbage, but at 115200 you get corrupted characters every once and a while, frequently enough to make serial transfer from PC to Arduino a mess.
For the same reason you can't use Sensebender or Pro Mini 3.3V as the serial gateway, unless you set the baud rate down to something like 38400.