I think it is a combination of wanting to explore as I am becoming more experienced in electronics/embedded software, momentum behind devices using BLE to chatter amongst themselves and testing the wantcurrent Ladybug experience that got me to ask:
Does it make sense to replace the Arduino and Red Bear BLE Shield with a BLE module? If so, which module?
Where the definition of a BLE module comes from this page on BLECentral:
…a small form factor PCB, ready to use, where not only the IC or SoC is already soldered, but also the required RF components (filters, antenna), oscillators and passive components. To top it off, many available modules also include a metal shield to prevent EMI and are certified according to the regulations in place in one or many regions of the world: Europe (CE mark), USA (FCC), Canada (IC), Japan (VCCI)…
and the comparison of IC to SoC is:
- SoC: (from the BLECentral page) A SoC is a single chip where the vendor has packaged all features one will usually need to address a specific market…one or more microcontrollers, static RAM memory, Flash memory, Bluetooth controller, RF transceiver, voltage regulators and tons of extra peripherals (analog to digital converters, timers, cryptographic processors…)
- IC: the op amps, ADC, etc. that are mixed and matched…for example, all the active components of the pH and EC circuits.
The goal of this post is to start the exploration in answering the above question. This post will focus on the module.
Thanks to Those That Went Before
- I am extremely grateful for Elicia White’s guidance. I am a fan of her podcast Embedded.fm and her book “Making Embedded Systems: Design Patterns for Great Software” as well as her element 14 blog posts, like the one she recently did “Bluetooth Low Energy, Three Ways.” I had been getting up before the crack of dawn the last two days trying to get example apps to run on the nrf51 dk. I asked for advice on the embedded.fm web site and WHOA…Elicia’s advice got me unstuck and running the example apps in an extremely short time. Talk about a gracious and gifted technologist!
- I will always be grateful to Chris Gammell for his Contextual Electronics courses and mentoring. I would not be able to be able to design a schematic, do a PCB layout, or problem solve circuits without his guidance.
- Adafruit continues to be an amazing resource for the maker community. Adafruit is more than a place to buy a breakout board. The folks there invest heavily in helping us learn about electronics, providing libraries so that writing sketches that use chips on the breakout boards extremely easy-peasy, and providing a community with tremendous support, enthusiasm. I happily buy from Adafruit even when a breakout board might cost more because Adafruit provides not just a chunk of hardware, but a sense of quality and caring. I recently purchased the Bluefruit which has emboldened me to jump into exploring the software/hardware around BLE – the communications method I use between the Ladybug iPhone app and device.
- I can’t think of a company that I would rather do business with than OSH Park. The OSH Park service, support, and team are role models on excellence other small businesses should work towards.
The Ladybug Shield Kicad schematic and layout files are located at this GitHub repository.
The current hardware contains stuff that you might expect to see in a prototype:
The Ladybug iPhone app talks with the Ladybug device using BLE. BLE is provided by the Red Bear BLE Shield that sits on top of an Arduino. The Ladybug Shield sits on top of the Red Bear BLE Shield providing pH and EC voltage readings. Many (at this point most) of the posts on this blog are about the evolution of design, testing, and implementation of the Ladybug Shield. The The ADS1015 ADC sends voltage readings that represent pH and EC measurements over I2C. The sketch on the Arduino sends a HIGH to one of three pumps when the control logic determines if the pH or nutrient amounts need to be adjusted within the nutrient bath.
The Prototype Accelerated Progress
I am happy with this prototype approach. It has allowed me to:
- indulge my voracious appetite for learning. I am very happy with the amount I have learned this past year that would otherwise not have been possible.
- enhance my hydroponics setups with automatic adjustment of pH and EC. I am currently using and improving on the software as the prototype hardware is being tested in situ.
- solidify the hardware of the protagonists – the pH and EC circuits.
Evolved Hardware Design
While I continue to evolve the Ladybug iPhone app, I want to also evolve the design of the Ladybug Device. I do not see a current need to evolve the pH and EC circuits. There is a great opportunity to evolve the micro controller and BLE components. Instead of the Arduino as the micro controller and the Red Bear BLE Shield as the BLE component, I will be exploring using a BLE module like Raytac’s MDBT40 (data sheet).
Potential benefits of replacing the Arduino and Red Bear BLE Shield with the BLE module module include:
- Simplification of the Ladybug Device. Instead of an Arduino Uno with the ATmega328 + Red Bear Lab BLE Shield with the Red Bear BLE land nrf8100 library from Notdic, the device shrinks down to be the BLE module (replacing both the Arduino and the Red Bear Shield) plus the current pH, EC, and pump circuits of the Ladybug Shield.
- Cost: current costs:
- Learning: More YIPPEE!! moments ahead. I’m already excited.
- Evolved BLE: The Red Bear BLE Shield I am using uses the nrf8001 for BLE. The nrf8001 is an earlier generation chip. Besides correctly handling the BLE advertising packet (for example, currently I limit the name of a Ladybug to 10 characters and can’t use the advertisement packet to broadcast sensor readings), it integrates the ARM Cortex-M0. This post provides a high level comparison between the two chips.
- OTA-DFU (Over-The-Air Device Firmware Upgrade): From Nordic’s post: This feature allows application, protocol stack or, application and protocol stack to be updated wireless, over the air.
Testing the nRF51822
I looked at two options:
get a Jlink and connect to the SWD/SCK pins on the back, you’ll need the nordic SDK, available @ http://www.nordicsemi.com/
please note: we have zero support or tutorials for bare-programming the nrf58122
The nRF51 DK
I ended up going with the nRF51 DK (link on digikey).
There is A LOT that comes with the development kit:
- The Jlink is included on the board. Nothing else is needed to program or debug.
- As noted on the Nordic site: “The kit gives access to all I/O and interfaces via connectors and has 4 LEDs and 4 buttons which are user-programmable.”
- Also from the Nordic site: The kit is hardware compatible with the Arduino Uno Revision 3 standard, making it possible to use 3rd-party shields that are compatible to this standard with the kit. I read this to mean I can test the Ladybug Shield using the nRF51822 instead of the Arduino and Red Bear Lab BLE Shield….YIPPEE!!!
- mbed is supported if I wanted to give mbed a twirl. For now my focus is on the nRF51822.
Time to Blink
That’s it for Now
I need to get back to my Contextual Electronics work/study as well as the Ladybug iPhone app. Not to mention I designed a PCB for an LED system I’m working on. I am excited to continue exploring an nRF51822 module as a replacement for the Red Bear Lab BLE Shield and the Arduino within the Ladybug device.
THANK YOU for reading this far. Please find many things to smile about.