Posts

Showing posts with the label Arduino

Microcontroller - service connections and acquisition patterns

Image
I ended up with some crosscutting content when I wrote up some patterns for getting data onto and off of microcontrollers. The consumption and generation patterns are cross-matched with implementation details.  You may know where you want to send data or in how many directions you want to send data. Now you have other concerns.  Connecting the devices, triggering transfers, and balancing latency with overhead. The next step is to understand how you are going to handle the connectivity and connection initiation.  That depends on the connection types, network topologies, and tools you have.  You then need to figure out how you are going to know when to capture data or receive commands.  Is it time-based or event-based?   Then you need to understand what your payloads look like and balance that against CPU, latency, and other constraints. This was just a subset but should give you the idea. Related Video Moving IOT data onto the controller Moving IOT data...

Patterns for Moving data onto a Microcontroller

Image
Microcontrollers can operate independently in complete isolation. They can operate independently while sharing data with dashboards or other applications.  They can operate under guidance or based on information provided to them by external systems.  They can coordinate operations with other controllers, or remote applications by passing data back and forth.  Let's break this down and talk about moving information onto an IOT from remote systems or other devices. We're talking about information transfers   from  a microcontroller to  other devices, applications, and data sinks.  Transfers can be   self-initiated  or   externally initiated .  Both approaches have their advantages and disadvantages. Video Moving IOT data onto the controller Moving IOT data off the controller Microcontroller - service connections and transfer patterns Related Blog Articles Patterns for Moving data onto a Microcontroller Patterns for Moving data off of...

Patterns for moving data off of a Microcontroller to somewhere else

Image
Microcontrollers can operate independently in complete isolation. They can operate independently while sharing data with dashboards or other applications.  They can operate under guidance or based on information provided to them by external systems.  They can coordinate operations with other controllers, or remote applications by passing data back and forth.  Let's break this down and talk about moving information from an IOT to remote systems or other devices. We're talking about information transfers from a microcontroller  to other devices, applications, and data sinks.  Transfers can be self-initiated  or externally initiated .  Both approaches have their advantages and disadvantages. Video Moving IOT data onto the controller Moving IOT data off the controller Microcontroller - service connections and transfer patterns Related Blog Articles Patterns for Moving data onto a Microcontroller Patterns for Moving data off of a Microcontroller Microcontr...

Can you spare a 200 bytes? When enabling Serial is enough to crash an Arduino app

I have an old piece of Arduino code that doesn't work if I enable Serial Output.  The code consists of 3 main pieces:  Ethernet/Web server Neopixel driver 5110 LCD display The code runs fine if I disable Serial output or if I remove the 5100 LCD display code and libraries. Note that the Arduino doesn't actually boot correctly and initialize the displays so this is even before any web server requests.  I couldn't figure out what was happening until I looked at the compiler output. It turns out that Serial() reserves about 200 bytes for input/output buffers. This makes sense but pushed me over the edge. I don't have a good way to figure out the minimum I need but obviously, 234 bytes isn't enough.   Code Used https://github.com/freemansoft/build-monitor-devices/tree/main/arduino_ethernet_NeoPixel Compiler Messages This is the Arduino compiler output with just the following line in the code or commented out.  These numbers were captured after moving all c...

HTTP control, relay control and OTA/HTTP firmware updates using an ESP8266 for just $11

Image
The ESP8266 came out a few years ago and people were really excited about its capabilities. I stayed away from it because there were no tools, no decent peripheral libraries, and a questionable supply chain.  Fast forward to today and the situation has dramatically changed. Software development is now supported in the Arduino IDE, the PlatformIO development platform and by NodeMCU. Microcenter stocks several different ESP8266 boards by AdaFruit, Link Sprite, and others. They had the LinkSprite with mounting holes, a relay and onboard voltage regulation for sale at $11 so I bought one. The board is smaller than a playing card but larger than many other ESP8266 SBCs. I like the Link Sprite because it is case ready and has soldered-in headers for peripherals. The  Link Sprite LinkNode R1 is essentially compatible with the Wemos D1 retired from a programming point of view. A video version of this blog is available on YouTube . A Simple Program for Relay Control This progr...

Combining Arduino Ethernet and Adafruit NeoPixel shield to create web controlled LED goodness

Image
Someone asked how hard it would be to swap the NeoPixel shield in place of the LED strip in an earlier Arduino based Web LED control project.  The Embedded web server and LCD panel control chew up a lot of memory so I wasn't sure there was enough program space for the Adafruit NeoPixel library.  It turns out there is just enough space while still retaining some Bonjour functionality.   You can get the source code on GitHub Hardware and Software This project uses the following hardware Arduino Ethernet  I picked mine up at  Microcenter.  They describe this unit  as an Ethernet Shield but it is a full Arduino Ethernet for $49 (as of 2014/06). The Arduino IDE supports this board.  I used version 1.0.5. Adafruit   NeoPixel Shield  is a 5x8 matrix of individually controllable RGB LED.  The software library is available on GitHub .   A simple protoshield with pass-through connectors.  The Ethernet conne...

The simple but awesome NeoPixel Shield with an Arduino

Image
The folks at Adafruit have put out a nice "NeoPixel shield" which is essentially an 8x5 addressable RGB LED strip built into an Arduino shield.  They have created a nice library available on github. You can see the project on their product web page .  Here is a picture of the board mounted on an Arduino Uno. The LED in the bottom right corner is LED 0.  The LED in the the bottom left corner is node 7.  The second row up is node 8-15 and so on.  The LED in the upper left corner is node 39. This picture shows the LED panel on my desktop. It totally overwhelmed the camera to the point that the rest of the room looks dark. Firmware I've created simple Arduino firmware that lets you send LED blinky commands over the Serial Port via USB.  You can set each pixel color individually along with one of 10 blink patterns.  Pattern 0 is off and pattern 1 is solid on so there are 8 actual blink patterns.  The firmware is located on github . The ...

cctray.xml Continuous Integration Build Monitor Update

I've updated the sample Java based build monitoring program to add support for some of the LED feedback lights I've built in the last year.  The program obtains build status from Hudson, Jenkins, Cruise Control and others by parsing the very common cctray.xml format originally provided by Cruise Control. Code is available on Git Hub  .  It was a messy combination of older hacks.  Now it's marginally improved. Configuration happens via properties files instead of with bunches command line arguments.  Properties files provide flexibility to increase the number of configuration parameters for various devices.  The best way to do fix this is  to use Dependency Injection like I did for the C#/Spring.Net TFS build monitor I built last year. In the mean time you can configure the properties file in the tree or create an external one that you pass in on the command line. Device support includes. Ambient Orb with serial port Ard...

Web control an addressable LED strip using ArduinoEthernet

Image
Edited 12/18/2011: Added Perl script and made displayColors(); call fix in event handler. Edited 12/19/2011: Added bulk update POST behavior and updated Perl script to demonstrate. Edited 12/26/2011: Fixed quoting javascript quoting problem. Edited 1/3/2012: Added support for Nokia 5110 style LCD and display bonjour name and IP. Most of my build and status "blinken light" type projects are USB or Bluetooth (Serial) controlled requiring a direct connection to the machine feeding the project it's values. I wanted more standlone device that could be remotely updated. Microcenter has the ArduinoEthernet and Netduino Plus boards, both of which have onboard ethernet. I still can't get my head around the .Net MF framework and which libraries apply to the Netduino vs some other .Net board.  The RaspberryPi is probably the biggest newcomer in this space because of its aggressive pricepoint, large feature set and broader set of developer tools.   The Arduinos are primitiv...