Humidity sensor

Oh the Humidity sensor. Students think that it should be so easy, but my friends are sorely mistaken. Of all of the sensors that student’s use, this little guy seems to give them the most problems.

humidity

The first issue is its name – it is sometimes known as the DHT22, and used to be called the RHT03. Names aside, I think that students difficulties arise because this product is not really well documented at Sparkfun – it’s hard to be great all of the time I guess!

Adafruit on the other hand has a great library supporting this. In fact, Adafruit’s DHT library is so good that it is actually used as an example on the Arduino “How to Make a Library” tutorial and API style guide. If you didn’t click the first link, the library can be found here.

But Wait!

Even if you install the DHT library, you still are not done. The DHT library requires the use of the ADAfruit Unified Sensor Library, so make sure to install that into your Arduino Libraries folder as well.

Once you have the Libraries up and going, it is pretty easy to use the DHT sensor. Instead of re-inventing the wheel, I will just point you to this Bildr tutorial.

If you spend time looking through the datasheet of the humidity sensor or the example code from Sparkfun, you will see things that send project makers like me into a cold sweat  (in hindsight I would have done an Electrical Engineering minor) “MaxDetect 1-wire bus is specially designed by MaxDetect Technology Co., Ltd. , it’s different from Maxim/Dallas 1-wire bus, so it’s incompatible with Dallas 1-wire bus.”

Right.

Therefore the libraries and code that Adafruit started and Bildr finished allows students to use the humidity sensor in their projects for humidity – without that EE degree.

So if you are here and measuring Humidity – make sure to thank the BFGs at Adafruit and Bildr for letting us stand on their shoulders for a little while.

 

 

Photo Studio

To better document student projects, I setup a little (20″ x 20″) photo studio outside of my office. Here is a photo of my watch taken with no filter on my iPhone. Not too shabby!

test-watchAnd here is a little Claw Robot that I built and use for class demonstrations:

claw-bot1

 

And finally, the Claw Robot as taken by someone who markets SUVs:claw-bot-2

I CRUSH you. You buy an Escalade with rich Corinthian leather… I still CRUSH you.

Note: Yes, I know Richardo Montelban sold Corinthian leather in the Chrysler New Yorker – my poetic License was revoked a long time ago.

Comparator Nightlight

After years of making my nightlights out of Arduino components, I decided to make one using my knowledge of comparators. I started with a schematic from the illustrious Dr. Ruben, but then tweaked the resistance values to be able to adjust the thresholds with a 10k potentiometer, a 10k photocell, and two 10k resistors that I had available.

Nightlight schematic – straight from the Good Doctor Ruben.

Since one of my goals was to use this post as an opportunity to show students a typical progression with circuit building, I built the first circuit on a large breadboard. This allowed plenty of room to make mistakes. Without having to worry too much about placing the wiring, I could free my brain up to think about the fundamentals of comparator circuit building. During this time, I realized that the best way to build the circuit was with a potentiometer to allow the user to select the darkness threshold.

After ensuring the circuit was performing as desired, I wanted to free up my big, expensive breadboard for other projects. Therefore I intended to solder the circuit onto a little protoboard that I had lying around. However while laying out the board, I realized that I wanted to ensure that my connection wires were straight (for aesthetic reasons). Therefore I migrated my large circuit to a mini bread board and now really paid attention to wire placement.

Once I had the wire layout, I was ready to migrate my circuit to a protoboard and solder the connections. Interestingly while soldering my board, I noticed that my wiring was blocking the mounting holes. This required a bit more unsoldering/re-soldering than I was hoping! C’est la vie de l’ingénierie.

And that, as they say is a wrap. For future work, I would like to use  Fritzing/Eagle/Altium and to make a surface mount device circuit board. But for now I am on to other things!

Merci Dr. Ruben and Dr. Reamon for the help with Comparators. Bon!

EZ Stepper Code

So some students were wondering how to get the Sparkfun Easy stepper driver working. I pointed them to some Bildr code (http://bildr.org/2011/06/easydriver/). After testing it, while the wiring was a good start, the code did not work optimally.

Therefore I made some simple code that seems to get the Easy Stepper Driver saying “Hello World”:

/*This code controls a stepper motor with the
EasyDriver board for 1 step
***************************/
int dirPin = 2;
int stepPin = 3;

void setup()
{
pinMode(dirPin, OUTPUT);
pinMode(stepPin, OUTPUT);
}
void loop()
{
digitalWrite(dirPin, LOW); // Set the direction.

digitalWrite(stepPin, LOW); // This LOW to HIGH change is what creates the
digitalWrite(stepPin, HIGH); // “Rising Edge” so the easydriver knows to when to step.
delayMicroseconds(500); // This delay time is close to top speed for this
// particular motor. Any faster the motor stalls.
}
//End code

If you change the dirPin to HIGH, this changes the direction of the stepper motor. What happens if you try it with a “For” Loop?

 

Plastic Cup Speaker

While minding my own business on a Friday afternoon a couple of weeks ago, a group of students came to my office. They were having some trouble with an assignment for 5th graders – make a yogurt cup speaker.

During the testing, an important lesson was learned. They were using a coil of copper wire with little resistance (0.01 Ohm) – but often commercial speakers have a resistance of 4 or 8 ohms. By using a wire coil with less resistance than this, they may have damaged their radio. If it is indeed damaged, it will not be the first loss in the name of science.

With the lessons learned, I created a small speaker out of a plastic cup using a strong mini magnet (McGuckins), a coil of wire (found around the lab), and the cup from my lunch at Tokyo Joes (Dark Chicken Bowl – best deal):

Note: If shave and a haircut still only costed 2 bits, my shaggy dome would probably be less unkempt.

Hello world!

Welcome to the Blog of Dan G, the ITLL Applications Engineer at the University of Colorado. I will use this as a repository of my thoughts and work. Hopefully this website can be used to help students gain success on their projects and throughout their engineering career!