-
Components, NeoPixels, and Arduino IDE
12/08/2014 at 03:24 • 0 commentsOver the past week, Black Friday/Cyber Monday sales were a great excuse to purchase all the parts. The only things outstanding are a few 47pF caps that need a newark or mouser order. I'll post the formal component list later in the month once the schematic is finalized.
One mistake so far- I accidentally ordered a Trinket non-pro from Adafruit instead of the correct "Pro" part. Rather than pay $8 shipping to order a replacement, I bought a Pro-version off a fellow maker from the local Makerspace, so I know its got good juju.
I also took the opportunity to start populating the headers on the Neopixel board and the Trinket Pro, as well as to start writing some of the code.
The Neopixel display was also assembled this week, which basically came down to soldering three wires onto a PCB. It was harder than it sounds, because Adafruit was not nice enough to put through holes for connectors on the NeoPixel sticks. A coating of hot glue will help to reinforce the joints.
I basically had to solder the wires to the board twice, as the first round of wires had the wrong gender connectors on the other end. I soldered male connectors, when I needed females to connect with the header on the Trinket.
On the software side, my first task was to learn how to upload images to the Trinket Pro. After messing around with Linux for a few hours, I gave up and fell back to the pre-packaged OS X Trinket Pro Arduino IDE. This worked on the first try. I also wrote a quick program that will manage the LED display. With 8 LEDs, an "alert level" between 1 and 8 is provided to a function. This determines how many LEDs are lit up and the color of the LEDs. The colors progress from green (just one or two LEDs) up to red (all 8 LEDs). There is also a fade effect, which will slowly turn the LEDs off over the next 2 seconds.
/** * * Trinket Radiation Detector * * Written for Adafruit Trinket Pro * Uses a PN photodiode to detect gamma radiation. Radiation levels * are displayed on an 8-pixel NeoPixel board. If things are especially * hot, a vibrating motor activates to alert the wearer. * * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2014 Eric Friedrich */ #include <Adafruit_NeoPixel.h> #define COUNTER_PIN 2 #define VIBRATE_PIN 3 #define NEOPIXEL_PIN 3 const uint32_t colorMap[8] = { 0x000000, 0x008000, 0x00ff00, 0x80ff00, 0xffff00, 0xff8000, 0xff4000, 0xff0000 }; /** * Track current state of the LED array */ #define NUM_PIXELS 8 static unsigned int lastLevel = 0; static uint32_t lastLevelTime = 0; Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM_PIXELS, NEOPIXEL_PIN); /** * Initialize NeoPixel library and global pixel state */ void initPixels() { pixels.begin(); pixels.setBrightness(24); } void setup() { initPixels(); pinMode(VIBRATE_PIN, OUT); digitalWrite(VIBRATE_PIN, LOW); } /** * Update NeoPixel strip with current radiation level. * * @param level - 0 to 7 inclusive */ void displayLevelOnPixels(unsigned int level) { pixels.setBrightness(24); for (int i = 0; i <= level; i++) { pixels.setPixelColor(i, colorMap[level]); } lastLevel = level; lastLevelTime = millis(); pixels.show(); } void updatePixels() { uint32_t now = millis(); uint32_t age = 12*(now - lastLevelTime)/1000; if (age > 24) { return; } pixels.setBrightness(24 - age); pixels.show(); } void loop() { for (int i = 0; i <= 7; i++) { displayLevelOnPixels(i); for (int j =0; j < 200; j++) { updatePixels(); delay(10); } } }
-
Theory and Purchasing
11/29/2014 at 04:48 • 0 commentsAfter spending a few hours reading through the linked articles below, I'm beginning to get a better idea of the theory behind using a diode to detect radiation. There are still more questions than answers at this point. Most of them revolve around component substitutions (whats the need for that now obsoleted JFET in the Improved Radiation Meter circuit?) and how I will be able to test the in-progress circuit and final device. I'm also doubtful that the 5V reverse-bias voltage across the diode will produce enough signal to amplify. I may need to get another step-up convertor or add a second power source such as some coin cell batteries.
I'll be basing my design largely off of the Improved Radiation Meter circuit (image above copied from the PDF), with a few subsitutions. Instead of the Atmega88, I'll be using a Pro Trinket. I won't be using an LCD for output, rather a small Neopixel strip and a vibration motor. The whole circuit will be powered by a LiPo battery and stashed inside an Altoid tin with some windows cut for the Neopixels.
Adafruit's BlackFriday sale gave me the kick in the rear needed to buy the parts, also 15% didn't hurt.