Posts

Showing posts with the label IOT

A power and ground backplane to simplify IoT component connectivity

Image
IoT projects are fun until you move them off the breadboard and then have to solder create reliable connections and power and ground connections.  Some people solder some people use small super-cheap breadboards. I tend to use jumper wires and connectors because most of my stuff is a one-off or super-small batch. It makes rework easy and reliable. The downside is that connectors take up space. The rest of this demonstrates a simple way of making this happen. Video  This discussion on YouTube Schematic Three sets of headers are soldered to a breadboard and joined to each other jin banks. Power (5V) is injected at the jack.  There are power and ground connectors for each device that requires power or ground. Power (5V) and ground lines run from each device and from the jack to the distribution connectors which are plugged into the headers. 3.3 Volt is not on the jack. It is supplied from a voltage regulator on the board and available on its own header row. It is supplied in...

Belay - Interface with hardware from your PC from within a single Python program

Image
Belay lets you write and run Python code on a host like PC and execute pieces of that code down on a connected microcontroller from inside your host Python session.  You write python code and mark up which code will run on the microcontroller (MCU).  The rest of the code runs on the host.  At runtime Belay will transfer the MCU targeted code down to the microcontroller.  The host Python code can then call that downloaded MCU based code as if it were running locally.  MicroPython CircuitPython and host Python Belay runs on Python3 on the host. It can download and interact with MicroPython or CircuitPython runtimes on the microcontroller. Belay GitHub repository Read the Docs: How Belay works MicroPython CircuitPython Code on both the Host and the Microcontroller Belay Python examples on GitHub All the Python code starts on the PC on the left. For this example, everything is in one file like the led flasher above. Both PC and MCU code is in the same Python source ...

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...

The serial nature of microcontroller communication with hosts and peripheral devices.

Image
Most communication between microcontrollers and the outside world is some type of serial connection. I'm talking about host,  server, cloud communication, and peripheral device communication. Wireless devices may transmit or receive in some parallel fashion but the communication between the wireless chip/board and the MCU is actually a serial protocol.  Input and output devices, sensors, and actuators or displays can often be directly wired to microcontroller pins or they can be serial I/O attached.  Direct connection gives finer control at the lowest cost.  Serial allows for more devices with fewer pins extending the distance a peripheral can be from the microcontroller. This content primarily is backing images for the video talk.  Content may be expanded over time This is the foundation for a couple articles that will be specific to control/data patterns and device communications.  It started like many others as a different talk and I realized I wanted to...

Freemometer V2.1 - Hacking the IKEA DEKAD into a notification device with a Pico and MicroPython

Image
This is V2 of a project I did a few years ago.  The IKEA DEKAD is a pretty package that makes a nice project case and comes with awesome mechanical bells. The Freemometer replaces the clock mechanism with a Servo and adds a couple status LEDs.  A microcontroller is added to run the servo, LEDs, and the motor that drives the alarm bells.  It is really the alarm bells that make the project.   The Pico is a lot more powerful than the Arduino-based first version of this device.  It is powerful enough to write code in Python which I find less stressful for a project like this that is not real-time in nature. This project uses a Pico W which means it can reach out  to some site or socket to get data and then run lights on the servo or the bell.  It also means you can stand up a web server or some other inbound listener that external parties can call.  I tend to Bluetooth into the virtual serial port on the HC-05 so I don't have to enable WebREPL or...

Fail: My old HC-05 Bluetooth module was an HC-06 and it only took me a week to figure it out.

Image
Sometimes you make bad assumptions and they lead you into the alley for a week.  Then you figure it out and get back on the path to getting stuff done. I spent a week trying to reconfigure my Bluetooth HC-05 module to a higher data rate. I tried the key pin.  Then I tried strapping the mode switch pin to 3.3 volts.  Nothing worked.  My devices were 8 years old so I assumed the missing buttons on my devices were just a versioning thing My HC-06 Devices JY-MCU I was just stuck with 9600 bps which is not cool because causes its own issues  https://joe.blog.freemansoft.com/2023/01/replicating-micropython-repl-across-hc.html I did notice something weird it always responded to the AT command when connected to a terminal prompt.  It just didn't respond as expected  to the AT commands.  I couldn't type any of the expected commands. HC-06 Bluetooth board JY-MCU Eventually, I ran across this instructable that said that the board with my markings was probab...

Failure Analysis - Not thinking through connector locations

Image
Failure happens from time to time when building projects or creating things.  I'm lucky that most of my mistakes are fixable after the fact or that the cost is negligible. I have a 10 year old project I wanted to update.  It is a stack of three boards. The bottom board is an Arduino Ethernet The middle board is a spacer that raises the third board above the ethernet connector.  The middle board has been cut to avoid touching the Ethernet connector The top board a NeoPixel 8x5 LED array I wanted to add a Nokia 5110 LCD to the board to show status and configuration. This Arduino Ethernet board has some stuff going on.  The left side of the board looks like it is the side that we would expose through a bulkhead panel.  The right-hand side has a programmer connector. I made that a 90-degree right-angle connector so that I could plugin in a serial-to-USB adapter while a shield was stacked on top. The thing is to remember that the left-hand side is going to be mounted...