Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Smallest Arduino alternative
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Smallest Arduino alternative

by nessimdave on Thu Oct 21, 2021 7:08 pm

hi all
I have a circuit that uses an FSR and an RGB LED , I have my code so that as the force is applied to the FSR the RGB goes from blue (no force ) then Green , then red (max force)
My question is what is the smallest Microprocess availble that i can replace my Ardunio board?
is there a simpler way to achieve this ?

Here is an example of my schemetic, but I am only using one FSR
Code: Select all | TOGGLE FULL SIZE

/* Pressure sensitive test
 * 
 

 
*/
 
 
const int fsrAnalogPin1 = 0; // connect FSR 1 to analog 1
const int RED_PIN = 2; // connect the red pin to pin 2
const int GREEN_PIN = 3; // connect the green pin to pin 3
const int BLUE_PIN = 4; // connect the blue pin to pin 4
int fsrReading1; // the analog reading from FSR 1 resistor divider
 
 
void setup() {
  Serial.begin(9600);   // set the speed of the serial monitor
  pinMode(RED_PIN, OUTPUT); // set the output of the red pin
  pinMode(GREEN_PIN, OUTPUT); // set the output of the green pin
  pinMode(BLUE_PIN, OUTPUT); // set the output of the blue pin
}
 
void loop() {
  fsrReading1 = analogRead(fsrAnalogPin1); // read the value of FSR 1
  Serial.print("FSR1 = "); Serial.println(fsrReading1); // print the value of FSR 1 on serial monitor
 
  if ((fsrReading1<100))
  {
    digitalWrite(RED_PIN, LOW);
    digitalWrite(GREEN_PIN, LOW);
    digitalWrite(BLUE_PIN, HIGH);
    // the blue light turns on with very little pressure
  }
 
   else if ((fsrReading1>100) && ( fsrReading1 < 150))
   {
    digitalWrite(RED_PIN, LOW);
    digitalWrite(GREEN_PIN, HIGH);
    digitalWrite(BLUE_PIN, LOW);
    // the green light turns on when are at the correct pressure for probe
   }
   
   else if ((fsrReading1>150))
   {
    digitalWrite(RED_PIN, HIGH);
    digitalWrite(GREEN_PIN, LOW);
    digitalWrite(BLUE_PIN, LOW);
    // the RGB will turn on red light
   }
 
  delay(2000); // loop the code for each 2 seconds
}




FSR-breadboard-1115.jpg
FSR-breadboard-1115.jpg (67.68 KiB) Viewed 83 times

nessimdave
 
Posts: 4
Joined: Thu Oct 21, 2021 7:30 am

Re: Smallest Arduino alternative

by westfw on Thu Oct 21, 2021 9:28 pm

Do you need the Serial connection? Or is that just for debugging? (it's two more pins...)
What about actual USB connectivity (vs perhaps using an external USB/Serial converter for uploads or debugging)?
And ... 5V vs 3.3V IO?
The Adafruit QT Py is pretty tiny.

westfw
 
Posts: 1804
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: Smallest Arduino alternative

by nessimdave on Fri Oct 22, 2021 5:50 am

hi
thanks for the reply,, I don't need the serial ,that was for debugging. what options do i have if i don't actually need the USB, if there is another way to upload you mentioned?
I have tested my FSR and the RGB led using the 3 volt so that that seems to be Ok.
Thanks
Dave

nessimdave
 
Posts: 4
Joined: Thu Oct 21, 2021 7:30 am

Please be positive and constructive with your questions and comments.