I was new to the Arduino thing about 2 weeks ago, prior to that I hadn’t even heard of an Arduino.
Firstly, if this is posted in the wrong place, mods please move to the correct place.
By way of background Im restoring an old car and wanted a temporary logging system that would show live engine (EGT & rpm from W terminal on alternator via a PC817), GPS, outside temperature data on a display and log to an SD card.
After a lot of googling around and making a long story short, this is my setup:
- Arduino R3
- Nokia 5110 Display - SPI
- Adafruit Ultimate GPS - SPI
- Adafruit BMP280 Temp & pressure sensor - I2C
- Adafruit MAX31850 Thermocouple amplifier - 1-Wire
- DFRobot SD Card - SPI
- PC817 octocoupler
- power supply and Sparkfun 5V <–> 3V shifters
If I ignore the SD card logging function and remove SD.h from the sketch I can make everything work just as I want, i.e. collate the data from the sensors and display on the screen. Ive even managed to get a momentary switch wired in to change the display for 10s and revert back to the primary screen. Very happy!
Now, when I add SD.h into the equation I run straight out of memory (110%). Ive rationalised the code as much as my inexperience will allow.
To try and develop this further I created another sketch based on Jeremy Blum’s GPS logging tutorial (No 15). This gets the GPS data logging to the SD card. I can also include the BMP280 sensor and get that printing the data to the serial monitor and include my LCD5110_Basic.h. At this point I run into two problems:
- No more memory so cant include my remaining sensors
- The sketch won’t write to the card once I initialise the Nokia display - I think this is because Ive needed to share some pins between the SD card and the display (CS are different). I had to share them because I ran out of digital pins on the UNO.
As I see it, even though my sketch is a collection of bits that Ive cobbled together from others and then rationalised a little, I cant see how I can get enough memory to be able to write to the SD card - assuming I could get the shared (Nokia & SD Card) pin control sorted.
I know the Mega has more pins and more memory, so assume this would solve my problem by keeping the display and SD card on completely seperate pins and allowing me more programming space.
Any thoughts of words of wisdom from this newbie:)
I can supply code if needed but not sure what the protocol is!