For this week, we had to try communicating between various nodes either by wire or wirelessly. The key point was that the nodes had to have addresses, so in other words, the network would be expandible.
Here is Dilijan, the land of milk and honey, shining its green eyes at us in the spring, inviting us to leave the lab and venture outside to see nature's fabrication in full swing :)
And here's the bouquet Mariam made with a sample of nature's bounty featuring anmoruk (forget-me-not), never to be forgotten.
Last week I printed the output device board 3 times, every time dealing with the same problem:
The end mill would start milling fine, but then it would get to certain locations and start polishing the copper. I had this problem once before, and it was due to the board being curved and the middle rising after being taped down and clamped. But this time, no curves could be observed visually.
Another reason might be that while pulling up a previously cut board, the board tapes might have been detached in certain places and that could be causing the empty space underneath leading to the copper only being polished while pushed down.
I decided to clean the board thoroughly, remove any trace of tape glue, and even lightly sand it with a P500 sandpaper.
The I washed a previously used board and taped it on, making sure the tapes didn't overlap. Of course this left a small strip in the middle not covered with tape, so I hope this doesn't cause trouble.
Looking back at the troubled board, underneath the polished traces, I could see bumps in the tape, suggesting the tape had just come up, which could be because of lifting force on the board.
I tried with a new board and changed the bit three times, getting the same results each time.
In the end, it appears that the problem was old and worn bits; once Narek used a completely new bit the problem seemed to correct itself.
Serial Peripheral Interface (SPI), also called a four-wire serial bus, is a synchronous serial communication interface specificication used for short-distance comminication, primarily in embedded systems such as liquid crystal displays (LCD's) and secure digital cards. It works by having one master and many secondary nodes.
It is synchronous because the changes in the state of memory elements are synchronized by a clock signal. The four wires of the bus include:
The SPI interface was developed by Motorola in the mid-1980s and has become a de facto standard.
As mentioned above, the milling wasn't proceeding well until changing the bit to a completely new one. Therefore, the final milled boards I achieved was as follows:
I discovered though that some fine sanding would go a long way in correcting that. I used a P500 sandpaper to gently sand over and around the boards, and even used it to make the sides less sharp and somewhat curved. Here is the result:
Here's how the boards turned out:
All the components were soldered on:
Here are the final bridge and the two nodes:
The programming was easy and straight forward, as Neil already had the c code prepared.
What I didn't understand was what the other two python codes (hello.bus.45.bridge and hello.bus.45.node) were for; are these included in the term.py file that we use?
After programming the bridge while the ISP and FTDI cables were connected, I disconnected both and connected the FabTinyISP to the ISP of one of the nodes to program it, recompiled the C code to name this node "1", and went on to try and flash the node, but alas, kept getting the following messages:
As can be seen, the error message is different every time, but shares the following line at the end:
recipe for target 'program-usbtiny' failed
make: *** [program-usbtiny] Error 1
I kept thinking this was due to my FabTinyISP USB connection with the computer, that it wasn't working well, and the board was not receiving power through that. So I kept tinkering with that, and tried plugging in the FabTinyISP directly to the 2.0 USB port of the computer insteading of using a connecting wire (not to accidentally overload the computer motherboard), but alas, it wasn't working. I tried switching the FabTinyISP and it still didn't work.
Finally, I discovered what the problem was: apparently power is not supplied by the FabTinyISP USB connection, and that is why the bridge was also using the FTDI cable to be connected to the computer while being programmed (certainly no serial data was being transmitted through the FTDI cable to the bridge while being programmed).
Since the node does not have a junction for FTDI connection and hence receiving power independently, I connected the node via the 4-wire bus to the bridge, then connected the bridge to the FTDI-to-USB cable with the USB end plugged in to the computer port, and then connected the FabTinyISP to the ISP junction of the node to be programmed:
This time, the programming worked like a charm:
The same process was repeated for the other node as well: the FabTinyISP connected to the node to be programmed, then code compiled with the right identity/address of the node and flashed onto its memory with one command.
Establishing SPI communication between the three boards was a straigh-forward, joyful business per Neil's example.
Since last summer, we have lost our Samsung AC remote control. I wanted to try something with wireless communication, and was wondering if I can replace the remote. My husband, a major tinkerer himself, came up with the idea that I could use the LOLin new NodeMCU v3 with an ESP8255 wifi microchip to not only replace the AC remote control, but also be able to control the TV, the music station, and even our child's toys via wifi using IR LED's connected to the board :)
He suggested using online libraries for the IR codes of the major appliances, and then using an IR receiver to decode other things such as toys which probably wouldn't be in such libraries. Here is one such class specifically dedicated to Samsung AC's I found online. Here's a dedicated IR code database that my husband found.
I could locate and buy IR LED's, but for IR receiver, this is what I found:
The MH-sensor-series Flying Fish is in fact an IR obstacle and distance sensor with an IR LED and IR receiver mounted on it, so I could perhaps connect to just the receiver without the board components hindering it in some way, which remains to be seen. Let's find out.
ESP8266 The ESP8266 is a low-cost Wi-Fi microchip that allows microcontrollers to connect to a Wi-Fi network and make simple TCP/IP connections. It is made by Espressif Systems[1] in Shanghai, China.
As I mentioned, the board that my husband provided was in fact LOLin new NodeMCU v3, which is an ESP-12E style ESP8266 breakout board which makes it easy to use the ESP8266 microchip: just plug it into a micro USB connector and it is ready.
Here are the components on a LOLin new NodeMCU v3: (from here)
And here are the pin configurations of the breakout board:
And here is the pin configuration of the ESP_12E, similar to ESP8266 microchip located on the breakout board:
Here is the datasheet for ESP8266.
I decided to give this tutorial a go and see what can be achieved. I also used this tutorial when in doubt.
Here are the steps I followed:
Win+x
and
select it). Unfortunately, Ports was not showing up in my Device Manager. To activate it, I followed
these instructions, and
here's what appeared:
Tools
on Arduino toolbar. Clicked on Board
and
selected Board Manager
, searched for ESP8266 and installed it.Sketch
from in the toolbar and selected Include Library
, then
Manage Libraries...
. Then searched for IRremoteESP8266
and installed it.Tools
from the toolbar, went to Boards
, selected
NodeMcu 1.0 (ESP-12E Module)
.File -> Examples -> IRRemoteESP8266 -> ControlSamsungAC
, and since
it was hard to keep looking at it with a phone to see the IR LED turn on or off, I switched it to a
regular LED to see whether it was functioning. It turned out fine, though I'm not sure the power is
just enough.
Tried File -> Examples -> ESP8266WiFi -> WiFiAccessPoint
. Neil also has a similar video
here.
Tried File -> Examples -> IRRemoteESP8266 -> IRServer
. Neil also has a similar video
here.
Getting to the assignment on networking, I think it's high time I'd made my own FTDI :) But since we were missing 470 Ω resistors, will give it a go another week.
A bit late in the course, but this week I discovered what the numbers printed on an SMD resistor mean, and here is a wonderful website that helped in the process.
Each SMD resistor typically comes with a 3-digit number printed on it. The first two numbers are the first two digits of its resistance, and the last (third) digit specifies how many zeroes follow the first two digit if the resistance is expressed in Ohms. So this is 470 Ω:
This is 4700 Ω or 4.7 kΩ:
This is 47000 Ω or 47 kΩ:
And 47 Ω itself can be expressed as either of the following ways:
The files for the NodeMCU remote control board can be downloaded here: