Bitten by the Electronics Bug

So recently I’ve been bitten by the project bug again. And quite a bit by electronics hobby-type stuff again in particular, though not exclusively. More blog posts and updates to come soon.

dscf8030

On the left is my old homemade DIY arduino based avr high voltage programmer made on old Hewlett Packard Engineering Protoboard based off of Jeff’s original design that i made in 2011. On the right is my brand new updated model named the AVR HV Rescue Shield 2 from MightyOhm.com. It’s main function is to help reset the fuses on AVR chips when you program them wrong. My old one came in handy and has saved a few chips from time to time. The new one obviously is better, mostly because now that i’m tinkering more with attiny85V chips i now have a High Voltage Rescue shield for them too, though it also does not require an external 12VDC power source as it has some sort of built in surface mount step up voltage chip.

dscf8031

So as briefly mentioned above i’ve been tinkering with trying to program attiny85v AVR chips. I’ve dug out my old trusty USBtinyISP AVR Programmer and I’ve recently gotten a Sparkfun Tiny AVR Programmer.

What i’m really intending to do is make a shrunk down version of my old Mystery Project by re-purposing and reprogramming my Adafruit TV-b-gone kit. I just need to get the frequency right. I’m starting by seeing if i can compile and upload the tvbgone AVR/arduino code to a blank attiny85 first. If i can do that i can work on changing the code. So far though i haven’t gotten the AVR fuses correct yet to use the tvbgone’s external 8mhz oscillator, though i think the program has uploaded correctly. That’s why i needed the HV Rescue Shield 2 mentioned above.

In addition, i finally ordered the parts to finish my DIY Arduino MENTA boards. They are cool Adafruit designed Arduino compatible boards that fit into an Altoids mint tin.

dscf8032

Some of the other items I’ve been tinkering with have been Raspberry Pi’s, including various Linux-based Operating Systems including Raspian (a debian based distro), Octopi (debian running Octoprint – 3D printer software), and RetroPie (an emulator to play old roms for NES, SNES, Playstation, Atari, Gameboy, and other popular gaming systems). The tiny $5 Raspberry Pi Zero. Tinkering with automatic plant lights and a gardening moisture sensor. And my fancy new SparkFun Vernier Interface Shield an upgrade to interface my Vernier sensors with Arduino. More on that in another post soon!

dscf8033

I also recently ordered a USB cable in order to salvage a scrounged barcode scanner that my brother saved from the Barnes And Noble dumpster. The USB cable works! Now i just need to figure out a use for it. Not bad for a $10 cable on ebay to a functional $200 value barcode scanner.

Continuing Progress on the XYZZY Motor Controller

bottom_board_v1.0top_board_v1.0

I think i’ve finished the design for the XYZZY Motor Controller, which for me is a big statement. I embarrassingly probably even said it before too. But anyway both the top board and the bottom board are done in Eagle Cad and i think i’m satisfied. The top board relatively stayed the same since it’s design was fairly sound. All that was needed was a few safety diodes for the mosfets, some led’s, and some minor resistors which were not critical. The bottom board was another story however.

It required a complete redesign except for the basic underlying parts. Many of the items i had on the board were just potential “goodies” that were extraneous and non-critical, so i removed them. Not only did it help remove extra unrouted wires, it helped clear up some much needed room. In the end i ended up with some extra room that i turned into a tiny proto board area that i’m quite pleased with. Along the way i fixed a few errors on the schematic and routed things nicer than they were before. I think all that it needs now is to order up some PCB’s and do some more testing and programming.

The only things i would like to change are the screw terminals. The ones that are on the schematic now are much too small for a large amp motor. The problem is i can’t seem to find an Eagle Cad footprint for one. I may have to end up creating my own part in eagle cad eventually. If you know of one please let me know in the comments below! I’m looking for something like these: photo1, photo2, photo3.

The XYZZY Motor Controller is a modular open source hardware mosfet speed controller h-bridge. It has been designed to be able to handle high current motors with the parallel mosfet design. It has been designed to be hackable and DIY accessible (hence the all through hole design). It has been designed for flexibility. Since it has been created with the hope in mind of a built-in arduino brain it can be easily programmed for many things. I’ve routed one PWM capable I/O port to function as a PWM directional input (modeled after the IFI Victor 884 servo input design). But one feature i’m happy to include is an easily accessible I2C port. This port gives the motor controller many potential abilities. One idea is to use the I2C port to expand it’s capabilities (such as a current sensor), or i think it would be cool to use I2C to daisy-chain several motor controllers together to help save wiring and to provide real-time feedback to a master microprocessor or computer. Another cool “feature” is that possible boards could be fixed with half the parts. If for example the mosfets died for some reason, but the bottom components were fine (or vice versa) you could use the good parts with other good parts. Since my old top board is basically the same i plan to test it with a new bottom board sometime in the near future. I expect it to work fine.

The schematics are somewhat rough. I’ve tried to clean them up as best i can. But don’t expect them to be pretty. The reason one schematic has floating wires going nowhere on one side is that at one point these were part of one schematic. To create the two board system with the pluggable pin headers i had to split them into “two projects” at one point in time.

bottom_sch_v1.0 top_sch_v1.0

If you would like a copy of the current Eagle Cad files please let me know. This is an Open Source Hardware Design. I would love to see these in the wild or even improved versions of it. Perhaps someone with surface mount experience can create one with smaller parts. More prototype testing to come soon, i hope! 🙂

Update (9-15-15): I’ve updated it again only slightly. I’ve changed the resistors to have bigger pads using the adafruit eagle cad library parts, and instead of screw terminals i’ve decided to use spade connectors or quick disconnects. These make it less cumbersome to disconnect motors and power and no loosing of screws, but also saves space (which was more critical). I couldn’t find a library that had a spade connector already, i had to make it myself. It actually wasn’t too hard.

top_board_v1.0 bottom_board_v1.0

Updating and perfecting the XYZZY Motor Controller

XYZZY_Top_Board_V1.0

I’m working on finishing and perfecting an old project of mine (by a few years). The XYZZY Motor Controller (H-bridge). The old design was only somewhat functional. Enough to prove proof of concept (barely), but i want a sleek, finished version that people can actually use. So i’m working on perfecting this prototype design. I’ve just updated several things on the top board, and i think it’s done. The biggest issue was a pretty major design flaw which was that i forgot to add the safety diodes for motor kickback. In simple terms that meant that when the motor stopped turning or i switched it from forward to backward the electrical energy would destroy the Mosfets! …oh.. noo… Yup.

Not to worry, they are there now. I will be wiring them in manually to some of my old prototype boards to test soon. This design is progressed enough to update it to V1.0 instead of Rx.x number. Although the top board is finished, the bottom board needs quite a bit of work and possibly major redesigning. from the looks of my old design for the bottom board it looks like one feature i wanted to implement was an I2C bus. That would make it cool to connect them together and then to a microprocessor to monitor them in real-time. The only sensors to monitor at this point was the inclusion of a crude temp sensor and monitoring the RPM of the fan. Although i was hoping to build an arduino chip built in. When i eventually purchase new PCB’s i think this revision is finally deserving for the color red! Although purple or black would look pretty sick too. Any comments are welcome.

This is an Open Source Hardware Design.

DSCF7247 DSCF7248

DSCF7249

DIY Modified Bread Machine Incubator

I hereby present: “The Breadman Incubator”… TaDa!

I will admit that i never truly got into the DIYbio movement, but to say it didn’t leave an impact on me also wouldn’t be truthful. So what is this machine? And what is it for? Well, I’m glad you asked…

DSCF7140 DSCF7145

In short this is a modified bread machine. Only modified to the extent that the native electronics have been replaced with an arduino (in this case an old low-cost diavolino), an arduino screw-shield, the native thermistor replaced with my own 10k ntc thermistor, and a 7 segment display from sparkfun electronics. Oh, and my own custom orange plexiglass cover! I’m quite proud of that cover! It’s main design is to regulate specific temperatures. In the case of DIYbio, in theory it can be used to regulate a temperature to be an incubator. Mainly bacteria, but it could also be used as an egg incubator, or a “hyper germination chamber” for squash seeds!. This last one is the only one i have actually tested, and i was able to see a squash seedling emerge in only one day! All of these potential uses still fall within the category of do-it-yourself biology.

DSCF7146 DSCF7151

Currently the programming is limited to a pre-set temperature at 37 degrees Celsius. This is often the optimal temperature to cultivate bacteria. Or so i’m told by Wikipedia. It is also the max temperature listed as being able to germinate squash seeds. huh, who knew?

DSCF7155 DSCF7156

Now, a lot of people out there might say: “why on earth would would you want to cultivate bacteria!” and one step further: “why on earth would you make a machine to grow bacteria!; Isn’t that dangerous?!” Well, umm.. I never said i actually would grow bacteria in this thing, more i created it just because i like the “i could” factor. In reality this is more of a proof-of-concept design built only to impress myself. But to answer the second question/statement.. Yes, growing bacteria is potentially dangerous.. unless you know what you are doing, what kind of bacteria is safe to work with, and proper safety protocols. Those who are familiar with the DIYbio movement will know that such safety concerns have been discussed before and that the general consensus is basically “use common sense” and “know what you are doing”. If these two principles are followed everything will be fine.

Besides, the great thing about this is that in theory this could be programmed to be it’s own sterilizer too! That’s a great plus for safety. Wikipedia say’s this:

Eventually, the entire item reaches the proper temperature needed to achieve sterilization. The proper time and temperature for Dry-Heat sterilization is 160 °C (320 °F) for 2 hours. Instruments should be dry before sterilization since water will interfere with the process. Dry-heat destroys microorganisms by causing coagulation of proteins.

I did a basic programming test to see if this machine could reach 160 degrees Celsius. It seemed like it could. The only thing needed would be a way to accurately keep track of time (like the unused chronodot i have lying around) and a button or something to initiate a programmed sterilization routine.

DSCF7157 DSCF7158

In this design i have not implemented use of the motor. One because i really couldn’t think of a good use for it. But two because in my initial testing phase i accidentally destroyed both an arduino mega and my computer (i assume by not properly protecting them from the kickback electricity from the motor). Yeah, it was “my bad”! Quite literally. Yeah, so a caution to anyone who decided to build a similar project, i recommend not programming your arduino while it is plugged into the electronics of your bread machine. Program it first, and then hook it up to test it. It was only when the usb cable of my arduino were plugged into my computer (with the motor running (i think)) that bad things happened. 😦

DSCF7159 DSCF7161

I found this old piece of scrap aluminum that handily fits at the bottom to cover the motor thingy. It gives it a nice flat surface. Petri dishes or anything that needs a flat surface will need something like this.

So.. Does it work?.. Yup. At least in a basic sense. It definitely could use some improvement. The programming is very basic in terms of turning the relay on if it is under a preset temperature (in this case 37°C) and turning it off it is above. While this works, it is not efficient nor really all that accurate. A PID loop would probably improve it much. Also adding a chronodot would help to have a temperature compensated accurate time clock in case i wanted to incubate something for a specific amount of time. I probably will add the chronodot at some point. A fan to help regulate temperature might also be a good fix, but if the autoclave feature were implemented it would have to be autoclavable (or removable). The fan could unintentionally introduce mold spores, but if proper sterilizing techniques were used this could be avoided. And perhaps a magnet switch to turn things off when the cover is opened.

bread_machine_pinout

The arduino code for this project can be found here.

Interfacing Vernier Sensors and Arduino (and vice-versa!)

So, recently I’ve been bored. That’s nothing new really. The up side to the times when i get really bored is that i usually end up starting some sort of electronics project. Since i have an interest in the DIYBIO movement and an interest in DIY chemistry i have realized that it’s really cool (and helpful) when you can use sensors to collect your data. But up until now i haven’t had the motivation (or the money) to really dive into it. But today’s post may be the beginning to turning that tide.

Awhile back i stumbled across this post by David Hay, after noticing this question on adafruit. In it he tinkers a bit with interfacing an older vernier (light?) sensor with an arduino clone.  Since i use vernier sensors in my chemistry classes at school i have come to love them. I wondered if i could do something similar, but what i really wondered was whether i could do the opposite as well. Could i interface other non-vernier sensors (like sparkfun sensors) using an arduino to the fancy LoggerPro software or my TI84+ calculator? It turns i can!

DSCF15033

The LoggerPro software is really good stuff, but i’m cheap whenever i can be. That’s one reason i thought of my TI84+ calculator. I already have one of those, and vernier has released free software for it that can graph data from vernier sensors in real time. The program is called EasyData and can be downloaded here. The second option is to use LoggerPro on Linux. And since i’m already a full time Ubuntu user i get to use the newly updated free LoggerPro beta for Linux! Sweet Beans!

DSCF15011

I’ve already tested both. They both work great. The cool thing is that i was able to hook an arduino to my calculator EasyData program and also LoggerPro on the computer by using a Vernier EasyLink (with an adapter to convert it into a GoLink). I had to get a Vernier Analog Breadboard Cable for it to work, but it was well worth it. I sent some test pwm values using the Arduino example code for the fading led on arduino digital port 9. I used the example pdf from the DIY Light Intensity Sensor example project on the Vernier website to help me out a bit.

DSCF15022

I was also able to do the opposite like what David Hay did with his sensor. I was able to successfully interface a stainless steel temperature probe from Vernier (which is basically just a thermister in a nice case) to my Arduino. I used the example pdf from the DIY Build a Temperature Sensor example project to help me out, along with the values in an equation provided in the manual that came with my stainless steel temp sensor. I also bought this nice Analog Proto Board Connector from vernier which allowed me to do this so quickly. Here is the code i used on my Arduino to calculate the temperature from this thermister.

*/
int led = 13;

#include <math.h>

#define ThermistorPIN 0 // Analog Pin 0

float vcc = 4.91; // only used for display purposes, if used
// set to the measured Vcc.
float pad = 15000; // balance/pad resistor value, set this to
// the measured resistance of your pad resistor
float thermr = 20000; // thermistor nominal resistance

float Thermistor(int RawADC) {
long Resistance;
float Temp; // Dual-Purpose variable to save space.

Resistance=((1000 * pad / RawADC) – pad);
Temp = log(Resistance); // Saving the Log(resistance) so not to calculate it 4 times later
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
Temp = Temp – 273.15; // Convert Kelvin to Celsius
Temp = Temp / 2;

// BEGIN- Remove these lines for the function not to display anything
//Serial.print(“ADC: “);
//Serial.print(RawADC);
//Serial.print(“/1024”); // Print out RAW ADC Number
//Serial.print(“, vcc: “);
//Serial.print(vcc,2);
//Serial.print(“, pad: “);
//Serial.print(pad/1000,3);
//Serial.print(” Kohms, Volts: “);
//Serial.print(((RawADC*vcc)/1024.0),3);
//Serial.print(“, Resistance: “);
//Serial.print(Resistance);
//Serial.print(” ohms, “);
// END- Remove these lines for the function not to display anything

// Uncomment this line for the function to return Fahrenheit instead.
//temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert to Fahrenheit
return Temp; // Return the Temperature
}

void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
}

void loop() {
float temp;
temp=Thermistor(analogRead(ThermistorPIN)); // read ADC and convert it to Celsius
Serial.print(“Celsius: “);
Serial.print(temp,1); // display Celsius
//temp = (temp * 9.0)/ 5.0 + 32.0; // converts to Fahrenheit
//Serial.print(“, Fahrenheit: “);
//Serial.print(temp,1); // display Fahrenheit
Serial.println(“”);
digitalWrite(led, LOW);
delay(1000); // Delay a bit…
digitalWrite(led, HIGH);
}

So what does this mean? I think this opens up a whole new world of possibilities. On the one hand i believe i can now use the nice Vernier LoggerPro or EasyData real-time graphing software to interface non-vernier sensors like Arduino boards directly and perhaps others like a Sparkfun Alcohol sensor? (which i have one i would like to try) This should make it easy to interface cheap sensors in chemistry and biology labs that already have vernier equipment. I think it also means that we can now easily use Vernier sensors on non-proprietary devices such as cheap Arduino micro-controllers.

I also look forward to soon tinkering with using an Arduino webserver as a different real-time sensor graphing and data logging device. I hope in the future i can help to create other tools which might be useful for DIYBIO and other DIY science.