Here I want to show some of my progress with arduino, give credit to Jermey Blum and to the folks at Adafruit, and to show why I chose Jeremy Blum's recent book
"Exploring Arduino" to further my capabilities.
I won't take you through a whole construction project. Rather it'll simply show the projects I have done recently and give a SHORT explanation each of them, explaining what I learned from them.
Here's my first project, a datalogger for my woodgas-to-electric project:
It measures,records and displays (on the LCD Screen) 3 temperatures, 8 pressures, on-time, engine throttle position, and engine oxygen sensor output. It records a "Marker Button" and provides a "traffic lights" visual display for 2 of the most important operating variables.
(About 1000 lines of code).
I built and integrated that device into my woodgas system over a one year plus period, but now I need to learn more about using all that data to
actually do things TO the equipment that I am monitoring and how to take advantage of some of the more complex commands, sensors and output devices
that are available. By that I mean: I want to learn more about commands that I haven't had to use yet, sensors that do things I haven't tried and
about output devices in general.
So when Jeremy Blum's new book, Exploring Arduino became available, I bought a copy, read it from cover to cover a couple of times, then selected the 5 projects that I thought would best enchance my knowledge for now.
And here they are:
Since the neither the Arduino UNO or the Mega2560 have analog OUTPUTS, I wanted to learn how analog outputs could be produces. The digital potentiometer is one answer. The output of the 3 LEDS is being varied via analog voltage changes by 3 of the 4 digital potentiometers (2 per chip) that are on the breadboard, not by pwm. While the circuit and the software make the light output vary, "tone" is operating in the background to drive the speaker's frequency, but the 4th digital pot is making the speaker's volume rise and fall.
Bargraph, Ch 7:
Each shift register effectively adds 8 output pins to an Arduino (minus the one it is connected to). Here, One Arduino pin drives 8 LEDs in this example. In the book's project, a Sharp IR distance sensor is used to turn distance to an object into a bar graph. The Sharp IR distance sensor sends an analog output to the program, but I didn't have one. So I converted the code to use a Parallax Ping Sensor (Sonar sensor) to work instead. It actually reports the time (in microseconds) that it takes for a "ping" to go out, hit something, and to return, so one has to calculate the distance from that info. This was a good exercise for me.
H-Bridge DC motor control
Separate power supply
A DC motor is likely to draw more current than the ARduino can supply, so a separate 9 volt battery is used for demonstration purposes. The H-Bridge is capable of driving motors in both directions and at varying speeds. A potentiometer is used to tell the H bridge what to do. The potentiometer, when roughly in the center position, tells the motor to stop When it is turned ccw, the motor turns in one direction, faster as the pot is turned farther. when the pot is turned cw from the center, the motor goes faster and faster in the other direction. The idea here is that the small signal current to the H-Bridge controls a large current to the motor, including directional control.
Separate Power Supply (9 volt battery in this case)
Linear power regulator
IR Distance sensor
Since the servo draws more power than it can get from the Arduino, it needs a separate power supply, hence the 9 volt battery, But the servo wants only 5 volts, so this circuit includes a linear power regulator to reduce the battery' 9 volt output to 5 volts. The IR sensor is glued to the servo. The servo is programmed to sweep to 4 positions in an arc a little shorter than 180 degrees. It stops momentarily at each position while the distance sensor reads the distance. That distance is converted to an appropriate pwm output proportional to the distance seen by the sensor at that position. The pwm signal illuminates an LED in proportion to the distance, closer equals brighter. Then it moves to the next position, and so on, finally resetting and doing it all over again. The project called for all blue LEDs But I used LEDs of differing colors here, and learned how much the light output varies from one color of LED to another. I had to make large changes in series resistance values to make them more or less equal brightness for a given pwm percentage.
Fun with sound, Ch12:
Some day I want to work on an ignition controller for a certain old ATV machine, so I know I will need to understand interrupts to control the ignition event timing. And timers need to be used with interrupts, since you can't use the "delay" command while an interrupt is running. So this simple looking project actually has a lot going on. It is using the "tone" library to create a set of ever increasing frequency tone bursts. But one can use a button press to move the base frequency up one notch whenever one wants, without have to wait for the Arduino's IDE "loop" to cycle back to the button press event in the code. This is done with the Schmitt Trigger debounced button and and an interrupt.
Ignition Timing Drift Issues finally solved, January, 23, 2016
Timing Drift with my Uno Ignition controller has been a huge problem. No matter what I did, for the longest time, I could not keep the system from losing about 8 degrees between about 300 and 3000 rpms. I have finally solved the problem and that's what this update is about.
Drift Improvement Video
January, 2016 Code for My Arduino Ignition Controller
November 17, 2017:
I have been working on this project, on and off. It has now advanced almost to an operating system. I am now using a two tower CNP pak to run an Onan 2 cylinder generator set. It is still in test mode.
Here are two pictures of the magnet wheel that I am currently using on an Onan NH6.5 Generator Set:
You can see my progress here:
My Youtube Ignition Controller Playlist
More to come as I learn more.