Electronics

Background

Electronic circuitry design and fabrication.

Electronics posts...

  • Eagle : Export PCBs quickly with this script
  • Exporting image files for milling PCBs is a tedious operation. Fortunately, Eagle has a built-in scripting interface. Customized scripts, spanning multitudes of operations, can be launched from the file menu. The following script, based on this one, will output two PNGs, one for traces and the other for the outline and holes. The PNGs can then be coverted to milling tool paths via Fab Modules. DISPLAY ALL; RATSNEST; DISPLAY None; DISPLAY Top Pads Vias; SET DISPLAY_MODE NODRILL; SET PAD_NAMES OFF; SET PALETTE BLACK; EXPORT IMAGE /*/pcb_traces.png MONOCHROME 1500; DISPLAY None; SET DISPLAY_MODE REAL; DISPLAY Pads; EXPORT IMAGE /*/pcb_outline.png MONOCHROME 1500;...

  • Environmental monitoring with online data logging to Thingsv
  • Over the past few months, I have continued to develop the electronics and programming aspects of this project. I now have a system for evualating power potential and environmental sensing, and logging all that data online to Things Speak, an open Internet of Things Platform. Previous to using Things Speak, I was logging data to an SD card. However, with an SD card, I need to periodically pull the data from the card. Extra work. Using Things Speak, the data is available to me and everyone else instantly, everywhere. There have been some issues with wifi stability and internet connectivity...

  • Grow monitors | What watches the watchers?
  • Simultaneous to the module development, I will produce some grow module monitoring equipment. Previously, I worked with a phototransistor sensor, an LCD output and wrote a basic graphical interface for live monitoring the phototransistor readings. Today, my goal is to combine these with voltage sensoring so I can begin tracking the correlation between sunlight and power generation in the bioelectrochemical testing modules. Starting with a little research, I found that by simply connecting an input voltage to an open ADC pin, I could take voltage readings. Duh. I have been doing this for weeks via the phototransistor. I returned to...

  • Infrared networking
  • Now I that I have a master-slave network setup, I would like to see if I can get the two boards to send signals back and forth autonomously. First, I extended the sensor test sketch to react via its LED and the serial monitor. I kept the serial monitor so I could debug along the way. One board is transmitting IR signals at random intervals. The other board is checking the IR receiver and when a signal is sensed, it triggers the LED on the board to illuminate for a short time period, then resumes loking. First the code for...

  • Processing : coming around.
  • In graduate school, I had the fortune of learning a bit of Processing, which I used in an interactive design project called FIZZLE in Hollywood. That was then, this is now. Now is a time when I have forgotten everything. Until today. From the processing website: "Processing is a simple programming environment that was created to make it easier to develop visually oriented applications with an emphasis on animation and providing users with instant feedback through interaction. The developers wanted a means to “sketch” ideas in code. As its capabilities have expanded over the past decade, Processing has come to...

  • Testing the electrical components of the IR network twins
  • Infrared light is invisible to the human eye, so it is a challenge to know if the infrared LED is operational. Further, the sensors need to be operationally tested. I setup some simple arduino sketches to confirm the board. First, you need to match the ATtiny44 pins to Arduino speak. Look at this graphic and compare it to the schematic. The LED is on ATtiny 12, irLED 11 and irSensor 10. One, two, three. I will add those as integars. Now, many cameras can see infared light. The front camera on newer iPhones is one such camera. const int irPin...

  • Chinese calligraphy G-code encoder
  • When writing Chinese characters, there are rules. You can either abide or you will be revealed a fraud. When we first tested the machine, we tried several online g-code generators (link?). One thing we did not find was a good way to specify stroke ordering and directionality. I was excited to show some Chinese people the first successful tests of our machine and everyone criticized the machine's stroke order! I started to investigate the possibility to write code we could use to generate g-code which follows the basic principals for patterning strokes in Chinese characters. And, this was a good...

  • Networking light : Twin PCB
  • I was introduced to a project by Enrico Bassi which uses two ATMega boards connected to IR Sensors and IR LEDs to network by reading pauses in IR light (low). Upon seeing it, I was immediately impressed with the visceral qualities of networking with light. It is visible to our eyes! And, we could control a light in our hands to communicate to a machine. Admittedly, low tech stuff here. Remote controls... Plus, technically, we cannot see the light, the red LED on Bassi's board is for human reference, the IR LED is invisible to us. Regardless, as a first...

  • Phototransistor : reading
  • I will try a variety of programming languages until I get readings. I am pulling VCC and Ground connections from the ISP so my order of operations: program with my fabISP, disconnect fabISP and connect phototransistor VCC and GND. That looks like this. I thought this might be simple... I first tried this Arduino sketch for getting readings via the serial monitor. Unfortunately, I am not yet able to get any reading from the serial monitor, let alone light levels. // Using an ATTiny44 #include <SoftwareSerial.h> SoftwareSerial mySerial = SoftwareSerial (1,0); // RX PA1 12, TX PA0 13 // Pin...

  • Phototransistor breakout board
  • In a previous project based on an ATtiny44 I added an expansion pin on PA2 (ADC2/AIN1/PCINT2). I think I can use that pin to take readings from a phototransistor; making this a nice little project to get generate some momentum. Remember: spiral development. First I examined Neil Gershenfeld's ATtiny45 schematic, the ATtiny45 datasheet, the ATtiny44 datasheet, andthe OP580DA phototransistor datasheet. Because both pins are compatible with Analog to Digital Conversion (ADC), the phototransistor should work with my ATtiny44 board. The first step is to design a board for the phototransistor, resistor, voltage, ground, and logic connections. I use Autodesk's Eagle....

  • EAGLE pt2 : Fabricating the circuit board
  • I need to export the board design from EAGLE, generate the mill paths and solder the electronic components. The board is ready to be cut; EAGLE's job is complete. Time to export. From the View> Layer settings... menu, set all the layers to invisible except Top, Pads and Dimension. Export the file as a monochrome PNG at 1500 dpi. The PNG may not be exported in perfect condition but can quickly be edited in a PNG suitable editor, i.e. Photoshop, Inkscape. I did not find a good way to export a PNG for the outline cuts. EAGLE has a thin...

  • Fabricating, wiring, learning
  • This dance is as follows: mill, solder, wire. Familiar aesthetic for the board. Milling the traces at 0.10mm depth once again was unsuccessful so I dropped the depth to 0.15mm and milled on top of the previously milled stock. Soldering was significantly faster. This time, when heating the connections I kept a count in my head which varied from an one to three count according to the size of the components. Worked well in terms of pace. Checked all the connections with a multimeter. No problems. Initially I connected an incorrect resistor in front of the LED which took me...

  • LCD x Arduino
  • Arduino has a built in libary, "LiquidCrystal.h", for programming this type of LCD. I thought it would be fun to imagine a prototype of HAL 9000 prior to artificial intelligence using the LCD display to communicate and the LED to hint life. Arduino IDE is packaged with many sketches of LCD functions. Browse to File > Examples > LiquidCrystal and you can check those out. First, write in the sketch the command to send the library for the LCD. #include <LiquidCrystal.h> Then, you need to dictate which MCU pins are connected to the RS, E, DB4-7 pins of the LCD...

  • LCD ATTiny44 PCB
  • I am using a Lumex 16*2 character LCD Module. This LCD only requires 5v and six data pins to get up and running. I do not have a PCB with the free pins or proper configuration to use with this LCD. Not a problem however, because I have learned my way around designing, milling and stuffing PCBs. Get it. I started by inspecting Neil Gershenfeld's example LCD board. I posted a low resolution copy of the image here for convenient reference. The linked version is better. While following this is great for a beginner like me, I quickly became aware...

  • Programming "Hello to the World" with C
  • I tested the effectiveness of my build with a C program written by Neil Gershenfeld. The contents of the make file are mostly the same as my previous ATtiny44 board. Because I used the same resonator, the timing fuses are the same. Only the name of the C accompaning C file has changed. Create the hex and out files. make -f hello.LCD.44.make Using my FabISP... make -f hello.LCD.44.make program-usbtiny-fuses and then send the program... make -f hello.LCD.44.make program-usbtiny This feels good. Download project files

  • Breathing light : An arduino experiment
  • I now have a grasp of making slight adjustments to code and uploading code to my board. Now that I have a little taste, I want more, so I imagined a simple idea to go a step beyond the tutorials and example codes. An interesting thing to me about coding is how the process is not linear, like what can often happen in other design fields. I can start layering in code and then make a little game of optimizing that code for editing, total number of executions, or number of lines, for instance. In fact, speaking of games, I...

  • Datasheet Atmel ATtiny24/44/84
  • Datasheets are hardcore product manuals for instructing makers on how to integrate specific products (ie electronic components) into systems. Datasheets are typically created by the product manufacturer and include technical and performative characteristics, connectivity information, coding examples, etc. A datasheet for an electronic component, such as an MCU like the ATtiny44, typically contains the following: Feature list and overview Pin configurations and descriptions Timing diagrams Reset and interrupt handling Register description Memories details Input/output informations Clock system Power management Packaging details and configurations and much more! This is the first time I have read a datasheet and I have only...

  • EAGLE pt1 : Designing a circuit board
  • EAGLE is a scriptable printed circuit board (PCB) computer aided design (CAD) program for 1. creating relationships between electronic components, for which you may download and curate libraries, then 2. positioning the components on a PCB and drawing traces. EAGLE stands for Easily Applicable Graphical Layout Editor. As of 2016, EAGLE was acquired by Autodesk Inc. The EAGLE is split into two primary GUIs: Schematic and Board graphs. You will use the schematic graph to select and interrelate the electronic components to be soldered on the PCB. The board graph is used to arrange the components and draw traces, pads,...

  • Stuffing a circuit board
  • Freshly produced PCB in hand, it is now time to solder the electronic components. Soldering is tricky. Repetition is key. I am beginning to find an effective method varying my practice, trial and error. This is a road map of component placement from the FabTinyISP page. First, gather the components, or do not. I soldered two boards. The first, I gathered everything beforehand, the second time I grab componenets from their storage as I went along. Whatever, both worked. Just be careful not to lose any or return to the wrongly marked storage. The microcontroller and diode components are directional;...

  • Programming a programmer
  • An in-circuit serial programmer (ICSP) is capable of programming microcontrollers on various boards with only a universal serial bus (USB) cable and 6-pin insulation-displacement contact (IDC) to 6-pin IDC cable. The ICSP vastly simplifies what would otherwise be an expensive and laborious process across different chip types. First I installed Crosspack on my mac. Crosspack is a development environment for AVR microcontrollers and necessary to give the terminal app capability for the upcoming task. Next, from the FabTinyStar page, I downloaded the firmware source code. I added a link here as well. You can open the Makefile with a neutral...

  • Milling a circuit board
  • The PCB is composed of a thin layer of copper, measuring in just microns of thickness, laminated onto FR1, phenolic paper. The pattern of copper connects a series of electronic components with electricity. If any unintentional connections are made, the whole system may be fried. While in subsequent posts, I will explore designing the etching patterns, this time around, I am using an open-source project developed in the FabLab ecosystem: the FabTinyISP version of an AVR ISP programmer/board. You can download the same PNG files I used for the traces and the board outline and read detailed build instruction on...

  • Design, Materials and Methods
  • I would like to build a small moss (dominate) garden which has an electrical outlet of a contrasting color to green sitting on a small pole in the center. The electrical outlet is connected to a battery that is hidden in the base. The moss is organized in power modules which are connected and charging the battery. When something small is connected to the electrical outlet, the battery discharges electricity. The whole garden can be dissambled and reassembled with relative ease. A secondary objective is to make (most likely) independently powered monitoring equipment (lux, temperature, humidity, soil moisture, watt output)...