Go Down

Topic: First project after the beginner book ideas? (Read 529 times) previous topic - next topic

Poindexter

I just can't see where else on this forum to start this thread. 

I respect that this sub-forum seems to be intended for teachers actually teaching n00bs to start using an arduino.  But it seems like the folks -like me- who got through one of the VAR (value added retailer) beginner projects end up here looking for ideas.

If there was a n00b section here I would have put this thread there.

Anyway, what are your ideas for projects that can be a manageable challenge for folks that got through the first 10-15 projects in whatever booklet?  They (I) have a small bin of various parts and an incomplete understanding of the code that was already downloaded as executable.

Poindexter

#1
May 04, 2017, 09:45 am Last Edit: May 04, 2017, 09:50 am by Poindexter
My first project after I got through my beginner book was to line up two rows of four LEDs like the spark plugs on a V-8 engine, and then get them to light up in order.



Once I had it running using the pinWrite commands I fiddled with the delay a little bit in code to see how slow I could stand it.  Then I added a potentiometer to A0 so i could essentially throttle it without having to edit the software and reload.

That worked OK, but a quarter second was about as slow a delay as i could stand, so I divided the A0 value by 4 and used that as the delay time, so with the pot at full value (1023) (now divided by four), by delay time at 'idle' is about a quarter of a second.

Then I named pin 11 and hung a piezo on that so it would make a low tone at idle, then higher and higher tones at faster and faster speeds, without having to buy any more parts.  The piezo doesn't sound anything like a real V8, but the code works.

For my next trick I'll put my shift register back on the bread board and try to send a byte of data through the data line rather than have 8 outputs tied up for the LEDs.

As soon as I figure out how, I will upload my working sketch.  All the comments in there refer to the first generation Chevrolet Small Block (1955 to 1991 production).  I don't know the firing order on an Audi V8, and I don't know for sure how the cylinders on a 1932 flathead Ford are numbered.

I think my sketch is attached to this post.  Rather than painfully go through the wiring I would think your beginners, as I did, can re-open their booklets to see how to wire this stuff up...

I do have video in my phone, but I need my wife's help to stitch my short clips together.

Code: [Select]
void setup() {
  // put your setup code here, to run once:
{
 

pinMode(2,OUTPUT);  //subtract one from pin number for cylinder number
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);



}
}
void loop() {
  // put your main code here, to run repeatedly:
 
//int delayTime = 250; // time (milliseconds) to pause between LEDs
                       // make this smaller for faster switching,
                       //pre-programmed
  int x;                     
  int delayTime;
  int sensorPin=0;  //read potentiometer
  int sensorValue;  //prepare to store analogue pot value as integer between
                    //0 and 1023
               
  sensorValue = analogRead(sensorPin); //go do it
  x=(sensorValue/4);
  delayTime=(x);
 
const int buzzerPin = 11;                             
pinMode(buzzerPin, OUTPUT);
tone(buzzerPin, x);

  // blink all sparks plug LED in GEN I Chevy Small Block firing order. 
  // odd numbered cylinders on left side of car, 1-3-5-7 front to back
  // even numbered cylinders on right side of car, 2-4-6-8 front to back
  // 1-8-4-3-6-5-7-2
  digitalWrite(2, HIGH); 
  delay(delayTime);
  digitalWrite(2,LOW);
 
  digitalWrite(9, HIGH); 
  delay(delayTime);               
  digitalWrite(9,LOW);
 
  digitalWrite(5, HIGH); 
  delay(delayTime);             
  digitalWrite(5,LOW);
 
  digitalWrite(4, HIGH);
  delay(delayTime);           
  digitalWrite(4,LOW);
 
  digitalWrite(7, HIGH); 
  delay(delayTime);         
  digitalWrite(7,LOW);
 
  digitalWrite(6, HIGH); 
  delay(delayTime);       
  digitalWrite(6,LOW);
 
  digitalWrite(8, HIGH); 
  delay(delayTime);         
  digitalWrite(8,LOW);
 
  digitalWrite(3, HIGH); 
  delay(delayTime);         
  digitalWrite(3,LOW);
}

pert

It sounds like you have found a great project for you. Once you have learned the basics, I think it's a good idea to do a project related to a subject of interest to you. It sounds like engines are one for you. This will give you the motivation to keep working through any difficulties you might encounter. If you find you need some of that knowledge you had an "incomplete understanding" of you can study and research it until you are able to continue with the project. I also think it's important not to jump right into something that is overly complex or expensive. I could see you being able to continue to expand on this project. For example, you can write the code so that the firing order and cylinder configuration for any engine can be easily simulated by only changing a few parameters.

I find LEDs to be lots of fun. It's really cool to see the visual representation of the code running on the microcontroller. I especially like playing around with RGB LEDs and getting different effects.

Poindexter

@pert , thanks for the encouragement.

I think "find something you are interested in and go from there" is exactly correct.

One problem I see is that the code I have written could return zero as the delay time, which would be problematic in real world applications.  So I can fool with that portion of the code so the maximum delay time is .25 seconds and use the same function as a rev limiter to keep engine RPM down to 5500 or so.

Without buying any parts I can setup a digital tachometer and view it in the IDE's serial monitor.  2 complete revolutions is one pass through the firing order, so X times 4 is the time of one revolution and there are 60 seconds in one minute...

I should be able to set up the servo as an analogue tachometer.

Someday I could maybe use RGB LEDS and have each cylinder turn a hotter and hotter color as the engine speed increases.

I have a tiny electric motor somewhere in my parts bin too...

Thanks again, I appreciate it.

ard_newbie

#4
May 07, 2017, 03:05 pm Last Edit: May 08, 2017, 07:11 pm by ard_newbie
There is a multifunction shield which comes with a bunch of example codes and possibilities (works nicely with a UNO):

https://www.mpja.com/download/hackatronics-arduino-multi-function-shield.pdf

Google multifunction shield arduino and you will find a bunch of code and sensors.

baaqii.com/promanage/manual/A1010.docx

v_chinnici

Dear Poindexter,

Have you had already a look at our Project Hub online?
You can access that here:  https://create.arduino.cc/projecthub

Project hub is a platform dedicated to Arduino Projects! You can filter the individual projects by Product, Categories, or difficulty.

It's very useful if you have a specific board and you want to keep experimenting for a more advanced experience of use.

I hope this helps.
Valentina Chinnici
BCMI Labs (arduino.cc)
Product Marketing Manager (Education)

Go Up