Recommend me a microcontroller dev board

Thread Starter

Jonathan Wilson

Joined Jun 9, 2019
22
Ok I think I understand what I need for the circuitry now.
As for the programming, I will see what the shop selling me the ATTiny85 can sell me as far as programmers go and if they can't help me I will go for a plan B or something. Only one guy on Amazon selling the Sparkfun thing and they can't gaurantee delivery in time for the show my model is being exhibited at so that doesn't work for me.
 

djsfantasi

Joined Apr 11, 2010
9,156
If you are running leds from pin, sourcing from I/O pin thru string to ground,
and UP Vdd of 5V, your calculation looks like -

Rled =[ 5V - ( 2.1V + 2.1V)] / .01 A = .8 /.01 = 80 ohms.

Just an FYI, many processors drive to ground better than source out of
a pin. So "normally" you would tie R's to Vdd and connect LED cathode to
pin. This case, the ATTINY85, has symmetrical drive capability, so you
can source the current out of the high side P MOSFET in the GPIO pin.


Regards, Dana.
Danadak has got a point regarding the resistor value. My initial calculations were for 6V. In actuality, with the diode drop, we’re running at about 5.3V. Using this value we end up with a resistor value of 120Ω.
 

djsfantasi

Joined Apr 11, 2010
9,156
After reviewing Danadak’s post and the datasheet once again, I’ve changed my mind.

Get 4 each 2N7000 MOSFETs and 10k resistors. My Internet is out, but I have an updated schematic for you. Sorry about the change, but it’s not dramatic.

I’ll get back to you in a couple of hours.
 

djsfantasi

Joined Apr 11, 2010
9,156
Not clear if the other post about GPIO total current means anything or if I am fine to drive all 4 strings at once with a 5V source...
See my last post. I think it means something and with two additional parts per string, it will work fine.

And you're using 5.3V (from 4 AA batteries and a diode); not 5V
 

djsfantasi

Joined Apr 11, 2010
9,156
Here is the code to flash the LED strings in the last pattern you posted.

Code:
const int flashPause 2500
// 2.5 seconds between segments
// The value is in ms, so adjust as needed

setup() {
}

loop () {

for (int LEDpin=1; LEDpin <= 4; LEDpin++) {
    digitalWrite(LEDpin, HIGH);
    delay(flashPause);
    }

for (int LEDpin=1; LEDpin <= 4; LEDpin++) digitalWrite(LEDpin, LOW);
delay(flashPause);

}
 

shteii01

Joined Feb 19, 2010
4,644
By the way, no he doesn’t. Each string draws 20mA, within the capabilities of a pin. And he plans on only having one string illuminated at a time. Well within the total limit of the μP
5V Uno
9V-5V=4V
4V/2V=2 led
2 led << 4 led

3.3V Uno
9V-3.3V=5.7V
5.7V/2V=2.85 led, round down to 2 led
2 led << 4 led
 

Thread Starter

Jonathan Wilson

Joined Jun 9, 2019
22
Just wanted to say thanks for all the help guys.
I bought a bunch of parts today (2N7000 MOSFETs, 10KΩ resistors, 120Ω resistors, LEDs, 8-pin IC socket, breadboard, breadboard jumper leads, battery holder, batteries, 1N4004 diode, ATTiny85)
Still investigating if there is someone in my area that can help with programming of the ATTiny85 (or if there is a supplier who can gaurantee delivery in time and sells something suitable for programming at a price I can afford) but I wired up one set of LED strings on the breadboard (including the diode and MOSFET and resistors) and when I connected the gate of the MOSFET to the positive 5.3v rail, the LEDs turned on. So at least I know the string design is good and the LEDs are nice and bright.
 

djsfantasi

Joined Apr 11, 2010
9,156
Just wanted to say thanks for all the help guys.
I bought a bunch of parts today (2N7000 MOSFETs, 10KΩ resistors, 120Ω resistors, LEDs, 8-pin IC socket, breadboard, breadboard jumper leads, battery holder, batteries, 1N4004 diode, ATTiny85)
Still investigating if there is someone in my area that can help with programming of the ATTiny85 (or if there is a supplier who can gaurantee delivery in time and sells something suitable for programming at a price I can afford) but I wired up one set of LED strings on the breadboard (including the diode and MOSFET and resistors) and when I connected the gate of the MOSFET to the positive 5.3v rail, the LEDs turned on. So at least I know the string design is good and the LEDs are nice and bright.
Congratulations on your progress.

There are Makerspaces in Australia. Perhaps you could find someone there to help you?
 

danadak

Joined Mar 10, 2018
4,057
If you are a begginner in programming you can always use the
block based languages, basically visual programming. Lots of
videos, used extensivley in US by 6'th grade kids in US in class-
rooms. Occasionally I will use it to bang out something quick.

Block Languages Arduino -


https://forum.allaboutcircuits.com/threads/mit-xod-visual-programming-language.159375/

http://www.carobot.cc/how-to/ardublock/ Ardublock

http://www.mblock.cc/software-1/mblock/mblock3/



mBlock name of main tool - http://www.mblock.cc/
https://maker.pro/arduino/tutorial/...the-scratch-programming-language-using-mblock

Extentions to mBlock - http://www.mblock.cc/extensions/


http://blog.ardublock.com/engetting-started-ardublockzhardublock/
http://www.mblock.cc/


Here is a simple short video to give you a taste - https://www.matrixtsl.com/flowcode_help/help-videos-v7.php?v=awbu6MyBYOY

General website - https://www.matrixtsl.com/flowcode/

Then there is this -

https://forum.allaboutcircuits.com/threads/arduino-to-pc-bridge.159281/#post-1386521


Regards, Dana.
 

djsfantasi

Joined Apr 11, 2010
9,156
He has the code already. For this project, he can use that. He has a hard deadline. But he doesn’t have a programmer.

However, these are excellent suggestions for anyone to try. I need to get more experience with these methods. Every time I try them, it’s so much easier to just code. My sketches are complicated enough that this method is frustrating. I’ve been unable to create a sketch that multi tasks several processes with block based tools. So, I’ve never developed the competency in these tools to recommend them. I’m glad that the TS has both of our skill set to draw on.
 

Thread Starter

Jonathan Wilson

Joined Jun 9, 2019
22

Thread Starter

Jonathan Wilson

Joined Jun 9, 2019
22
I am having problems getting this to work properly.
schematic.png
is the schematic I have currently on my breadboard (I have hooked up just this much for testing)
These are the parts I am using
D1 https://www.altronics.com.au/p/z0109-1n4004-400v-1a-silicon-diode/
V1 4xAA alkaline
R1 https://www.jaycar.com.au/68-ohm-0-5-watt-metal-film-resistors-pack-of-8/p/RR0544
L1 L2 https://www.jaycar.com.au/red-3mm-led-2800mcd-round-clear/p/ZD0104
Q1 https://www.jaycar.com.au/2n7000-n-channel-fet/p/ZT2400
R2 https://www.jaycar.com.au/10k-ohm-0-5-watt-metal-film-resistors-pack-of-8/p/RR0596
U1 https://www.jaycar.com.au/attiny85-ic-8-pin-dip8/p/ZZ8721
C1 https://www.jaycar.com.au/100nf-50vdc-monolithic-capacitor/p/RC5490 (for decoupling)

This is the code I am using in the MCU
Code:
const int flashPause = 1500;
// 1.5 seconds between segments
// The value is in ms, so adjust as needed
void setup()
{
}
void loop ()
{
  for (int LEDpin=1; LEDpin <= 4; LEDpin++)
  {
  digitalWrite(LEDpin, HIGH);
  delay(flashPause);
  }
  for (int LEDpin=1; LEDpin <= 4; LEDpin++) digitalWrite(LEDpin, LOW);
  delay(flashPause);
  for (int LEDpin=1; LEDpin <= 4; LEDpin++) digitalWrite(LEDpin, HIGH);
  delay(flashPause);
  for (int LEDpin=1; LEDpin <= 4; LEDpin++) digitalWrite(LEDpin, LOW);
  delay(flashPause);
}
Details of what I am using in the Arduino IDE are:
Arduino IDE is version 1.8.9 on Windows with ATTinyCore 1.2.4 installed
Board is set to ATTiny25/45/85
Chip is set to ATTiny85
Clock is set to 8 MHz (internal)
B.O.D. level is set to B.O.D. Disabled
Save EEPROM is set to EEPROM Retained
Timer 1 Clock is set to CPU
LTO is set to Disabled
Port is not set

When I connect everything up and run things, it cycles through all the LEDs just fine but I only get 1.something volts on the output PB2 pin of the ATTiny85 which means the MOSFET doesn't turn on fully and I get low brightness on the LEDs. If I connect the gate of the MOSFET to +ve the LEDs turn on just fine at full brightness.

Anyone know why I might be getting only 1.something volts on the output pin (PB2) of my MCU?
 

Thread Starter

Jonathan Wilson

Joined Jun 9, 2019
22
Yeah I found out about setting the pin mode to output.
I also now know that its possible to get an ATTiny85 (and a 1n4004 diode) hot enough to melt the plastic on a 400-hole breadboard (and for at least one component to release some "magic smoke") although I dont know for sure how it happened or 100% what is and isn't dead.

The worst that can happen is that I am out $5 for an ATTiny85 (I now have 2 and the one that didn't melt the plastic should still be working even if the plastic-melting one is dead) and a buck or 2 in small bits that may possibly be dead. Chalk it up to beginner mistakes, learn from them and move on (and have spares of anything that can fry and that's cheap enough to have spares of).

Not sure if I am going to buy more diodes and try again with AAs or just forget that and move to USB power via the wall-wart of a cheapie pre-paid phone I bought at one point while my main phone was out of action)
 
Last edited:
Top