Go Down

Topic: Bare Bones Datalogging (UPDATE) (Read 3888 times) previous topic - next topic

Seedler

My bad. I made a misguided assumption.  Even though your schematic shows the chips, not modules I got it wrong.  I would go with the 4.7K resistors in place of the 10K resistors that you have. Sorry for my confusion.
No prob,  Thanks for your help.

Damien

jboyton

Yes, it writes to the card when the buffer fills, at the point your code calls file.print().

There are advanced writing options supported by SdFat. You could research that. Another alternative would be to compress the information you are writing each time. You could easily cut it down by a factor of three although from previous discussions it seems you aren't interested in that. Post a question on the storage forum; hopefully you will attract the attention of user fat16lib who authored SdFat (and SD).

Unless you call flush (or close) your file will appear empty even though the data is on the card. So how many minutes of data loss would make you cry if your battery died unexpectedly? Pick some interval you'd be comfortable with and call flush that often. Maybe it's fifteen minutes, maybe it's five seconds. It's up to you.

Seedler

Yes, it writes to the card when the buffer fills, at the point your code calls file.print().

There are advanced writing options supported by SdFat. You could research that. Another alternative would be to compress the information you are writing each time. You could easily cut it down by a factor of three although from previous discussions it seems you aren't interested in that. Post a question on the storage forum; hopefully you will attract the attention of user fat16lib who authored SdFat (and SD).

Unless you call flush (or close) your file will appear empty even though the data is on the card. So how many minutes of data loss would make you cry if your battery died unexpectedly? Pick some interval you'd be comfortable with and call flush that often. Maybe it's fifteen minutes, maybe it's five seconds. It's up to you.

Cool, thanks for that.  I'll have a look at the storage forum and have a go at that.

I'll keep yous informed how I get on.

Cheers,

Damien

mrburnette

#18
Nov 04, 2015, 12:57 am Last Edit: Nov 04, 2015, 01:00 am by mrburnette
I did something similar a few years back, but I dropped the 328P to 8MHz so I could run everything at 3.3V (supplied by the regulator on the SD-Card breakout.)

Barebones 328 8Mhz ASCII datalogger

Ray

Seedler

I did something similar a few years back, but I dropped the 328P to 8MHz so I could run everything at 3.3V (supplied by the regulator on the SD-Card breakout.)

Barebones 328 8Mhz ASCII datalogger

Ray
Hi Ray,

Yeah I've got my 328p running at 8MHz too.  It looks like you only had a couple of capacitors.  Did everything work ok.  My biggest problem is trying to get all the recommended resistors and capacitors ftted on the small board I'm designing. 

Trying to route copper traces in EAGLE is a strange and frustrating puzzle :)

Damien.

Seedler

#20
Nov 06, 2015, 02:23 pm Last Edit: Nov 06, 2015, 02:43 pm by Seedler
Ok I have attached a copy of my first design of board.  I got over excited and already ordered a few, but it was only a few £'s.

I forgot to connect the Aref pin, but do I really need it?  I don't use it in the breadboard prototype and everything works ok.

I know its probably not the best looking board, but its a first attempt.

Let me know what you think.

Damien.

groundFungus

I don't see an attachment.  The Aref pin should not be connected to anything but a 0.1uf cap to ground unless you are actually using an external reference.  Do not connect to Vcc, that connection is done internally when using the default reference.
You will save everyone's time if you read and follow the forum guidelines.  https://forum.arduino.cc/index.php/topic,148850.0.html

Seedler

I don't see an attachment.  The Aref pin should not be connected to anything but a 0.1uf cap to ground unless you are actually using an external reference.  Do not connect to Vcc, that connection is done internally when using the default reference.
Attachment should be there now.  Do I need to attach Aref at all?

Cheers

madmattd

#23
Nov 06, 2015, 02:58 pm Last Edit: Nov 06, 2015, 03:00 pm by madmattd
The attachment shows for me now.

The main omission I see is there are no programming or ICSP headers (unless I'm just missing them). I assume you intend to bootload this to use through the Arduino IDE? You'll need the serial pins for that, plus access to the SPI pins to actually put the bootloader on (unless you are bootloading before soldering.


I can't speak to the need for the Aref cap, as I always stick in in there. It may not be needed if you aren't doing anything with analog pins? I'll let someone else answer that for sure.

Layout-wise, I've seen far worse first uses with Eagle. We can't tell for sure if the circuit is right without a schematic, but there aren't any right-angle traces, isolation looks good on the pour, etc.

I'm curious what the 2 vias in the middle of the (connected) pads up top are for? Bringing in power? If so, you're going to want one of those on ground, not both on the same net ;)

CrossRoads

#24
Nov 06, 2015, 03:16 pm Last Edit: Nov 06, 2015, 03:16 pm by CrossRoads
Can use an adapter like this, press it in place over the chip & select Upload Using Programmer.  Make 6-pin to 10-pin adapter to your ISP Programmer if needed, some seem to have 10-pin header already.
http://www.hobbyking.com/hobbyking/store/__64417__Atmel_Atmega_Socket_Firmware_Flashing_Tool_AR_Warehouse_.html?strSearch=atmega
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Seedler

The attachment shows for me now.

The main omission I see is there are no programming or ICSP headers (unless I'm just missing them). I assume you intend to bootload this to use through the Arduino IDE? You'll need the serial pins for that, plus access to the SPI pins to actually put the bootloader on (unless you are bootloading before soldering.


I can't speak to the need for the Aref cap, as I always stick in in there. It may not be needed if you aren't doing anything with analog pins? I'll let someone else answer that for sure.

Layout-wise, I've seen far worse first uses with Eagle. We can't tell for sure if the circuit is right without a schematic, but there aren't any right-angle traces, isolation looks good on the pour, etc.

I'm curious what the 2 vias in the middle of the (connected) pads up top are for? Bringing in power? If so, you're going to want one of those on ground, not both on the same net ;)
I was going to program it through the microsd socket on the bottom of the board, which is why I have left access to the reset pin. 

The pads at the top are the grounds for the batteries.  The vias are connecting them to the ground plane on the bottom.

I have attached a schematic.

Cheers.

CrossRoads

3.3V system then? I would change the I2C pullups to 3.3K, will provide quicker low to high transitions compared to 4.7K.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

madmattd

I was going to program it through the microsd socket on the bottom of the board, which is why I have left access to the reset pin. 

The pads at the top are the grounds for the batteries.  The vias are connecting them to the ground plane on the bottom.

I have attached a schematic.

Cheers.
Ah, well that will work for programming. A little fiddly, but certainly functional. This might already exist out there, but perhaps cracking open an old uSD card, removing the guts, and soldering jumper wires to the pads inside of the card body could be done for a click-in programmer, with the reset wire off to the side.

And I now get the vias/pads. I was stuck in soldering wires through-hole to connect power, but you are just soldering to exposed pads. Makes plenty of sense. DOH!

Seedler

3.3V system then? I would change the I2C pullups to 3.3K, will provide quicker low to high transitions compared to 4.7K.
Yes its 3.3v.  I'll change to the 3.3K resistors.

Thanks for that.

Damien.

Seedler

Ah, well that will work for programming. A little fiddly, but certainly functional. This might already exist out there, but perhaps cracking open an old uSD card, removing the guts, and soldering jumper wires to the pads inside of the card body could be done for a click-in programmer, with the reset wire off to the side.

And I now get the vias/pads. I was stuck in soldering wires through-hole to connect power, but you are just soldering to exposed pads. Makes plenty of sense. DOH!
I was going to make a programming adapter out of one of these http://www.miniinthebox.com/micro-sd-tf-memory-card-kit-male-to-female-extension-soft-flat-fpc-cable-extender-10cm_p2305744.html?currency=GBP&litb_from=paid_adwords_shopping&litb_from=&adword_mt=&adword_ct=73307173122&adword_kw=&adword_pos=1o1&adword_pl=&adword_net=g&adword_tar=&adw_src_id=4196617767_313290882_22460591202_aud-79897721551:kwd-111936638835&gclid=CjwKEAiAvPGxBRCH3YCgpdbCtmYSJABqHRVwJCiPOcrT_e-h03qix7YhtDJv0a1x9ZjnbyqRQPXngBoCk43w_wcB

I left a pad for reset on the top of the board.  Just realised I could have used one of the spare microsd socket pins for reset.  That'll be a change for version 2 :).

Damien.

Go Up