Author Topic: Thanks Felix - love that Mega  (Read 1040 times)

syrinxtech

  • Sr. Member
  • ****
  • Posts: 346
  • Country: us
    • Syrinx Technologies
Thanks Felix - love that Mega
« on: June 29, 2020, 11:53:15 AM »
Been using the Mega for a long time now, just finished round 1 of building h/w and s/w for a project.  Mega has HW radio and the following components:

N/O  switch
BME280 temp/hum/pressure - I2C
BNO055 9 DOF IMU - I2C
Adafruit GPS - Serial1
Adafruit GA1A12S202 analog light sensor
ML8511 UV sensor
MAX9814 microphone
SD card reader w/card not present indicator- SPI
Buzzer
Tri-Color LED

I still need to add an I2C INA-219 board to measure current.  All sensors sample and send data back over HW radio to another Moteino which captures and displays data.  Will soon add ability to send commands to the device to request specific actions.  Also need to add sleep functionality to preserve battery life.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6620
  • Country: us
    • LowPowerLab
Re: Thanks Felix - love that Mega
« Reply #1 on: June 30, 2020, 01:17:16 PM »
Very cool, yes that's where the MEGA would shine because you can hook up all kinds of extra stuff to it, and it has the same usage familiarity as the ubiquitous 328p.

syrinxtech

  • Sr. Member
  • ****
  • Posts: 346
  • Country: us
    • Syrinx Technologies
Re: Thanks Felix - love that Mega
« Reply #2 on: June 30, 2020, 03:01:53 PM »
It's still amazing to see the entire breadboard covered in parts and wires and watch the remote screen flying by with all of the various measurements coming in from the radio.

syrinxtech

  • Sr. Member
  • ****
  • Posts: 346
  • Country: us
    • Syrinx Technologies
Re: Thanks Felix - love that Mega
« Reply #3 on: July 07, 2020, 10:52:55 PM »
Update:

1.  Adding the Adafruit SI1145 UV/IR/Visible light sensor to get a "true" UV Index reading.
2.  Converting the RFM69 radios to LoRA for greater distance at slower speeds.
3.  Finished the menu system so I can send remote commands to the unit and have it respond with data to the logging device.
4.  Just received the INA3221 so I can start getting electrical telemetry readings.

john4444

  • Jr. Member
  • **
  • Posts: 71
  • Country: us
Re: Thanks Felix - love that Mega
« Reply #4 on: July 08, 2020, 05:00:38 PM »
Hi Syrinxtech,
I've started a project similar to the project you describe.
Can you share your code?
I will be using the RFM69, Adafruit BME680, TSL2591, and VEML6070
but won't use: your BN0055, GPS, microphone, or card-readerr.
Still, there are a lot of parts to connect.
Using your code as an example would be very helpful to this old, novice programmer.

Best of luck with your project.
John
John AE5HQ

syrinxtech

  • Sr. Member
  • ****
  • Posts: 346
  • Country: us
    • Syrinx Technologies
Re: Thanks Felix - love that Mega
« Reply #5 on: July 08, 2020, 10:18:02 PM »
@john4444, I'd be happy to upload my code when I finish a few more items.  I'm not a professional programmer by any means, and I know there are always better ways to perform any task.  The only thing I ask is that if you find a better way to do something, let me know so I can make my code better.

Kylix

  • Jr. Member
  • **
  • Posts: 65
  • Country: ro
    • Omologazioni veicoli
Re: Thanks Felix - love that Mega
« Reply #6 on: July 09, 2020, 05:02:35 AM »
@syrinxtech I'd also like to see how you manage the microphone in the code.  ;)

syrinxtech

  • Sr. Member
  • ****
  • Posts: 346
  • Country: us
    • Syrinx Technologies
Re: Thanks Felix - love that Mega
« Reply #7 on: July 09, 2020, 06:41:07 AM »
@kylix, I can show you what I managed to cobble together from lots of other examples.  I'm using the MAX8914 in two ways, 1) As a simple measure of sound level, and 2) To record sound onto the SD card.  I've been back and forth between the SD and SdFat libraries, and have currently settled on SD.  I know SdFat is supposedly smaller and definitely offers more options, but for what I'm doing SD is currently meeting the needs.  There were the usual challenges of getting an SD card reader to work on the Mega with the radio, and sometimes it requires a hard reboot when loading new code and the SD card fails to initialize.

From the menu I can choose to display the sound level, start/stop recording, perform a file directory (limited to WAV files), and delete files.  I toyed around with adding a format option but punted that one.  I initially wanted to be able to transfer the WAV files over the RF radio but gave that up after figuring the drain on the batteries of transferring multi-megabyte files.  For now, when the rover "goes home", I will simply remove the SD card.  I'm using Audacity to experiment with cleaning up the sound quality, which is actually pretty good for a cheap microphone.  I also added a "card not present" function that is checked to make sure there is an SD installed before every write.

I didn't play around much with the gain and AR, since my rover is being designed to live outside 24/7 and I figured I wanted to get as much sound captured as possible.

You'll get to see more when I post the code.

syrinxtech

  • Sr. Member
  • ****
  • Posts: 346
  • Country: us
    • Syrinx Technologies
Re: Thanks Felix - love that Mega
« Reply #8 on: July 16, 2020, 10:21:37 AM »
What to add to the rover that has everything?

Why, a vibration "theft sensor" of course.  Right before the MCU goes to sleep, I read a vibration sensor for 1.5 seconds.  If it detects vibration (calibrated to exceed normal movement), it will send out a log message and sound the buzzer.  I know it's over the top but I am trying to cram every conceivable option into the design.  I'm officially out of pins on the long breadboard but the Mega is still running strong.

Hopefully swapping out the RFM69HW for the LoRa this weekend, along with upgrading the UV sensor.

syrinxtech

  • Sr. Member
  • ****
  • Posts: 346
  • Country: us
    • Syrinx Technologies
Re: Thanks Felix - love that Mega
« Reply #9 on: July 25, 2020, 09:15:30 AM »
In case you're following this thread, I have moved all updates to the Projects folder so I don't have to update two threads.

Thx