[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself


View post   

File: 69 KB, 480x640, arduino-sexy[1].jpg [View same] [iqdb] [saucenao] [google]
1621855 No.1621855 [Reply] [Original]

Arduino containment thread

The last thread died some time ago, so let's start another one.
I don't have the OP pasta, so someone else can post it.

This thread is for Arduinos and arduino related ICs (ESP32, Blue pill etc)

>> No.1622264

>>1621855
arduino projects time!
where do i get some smol switches?
everything i look at online is like 3/4" dia mounting hole

i need some small switches for a small enclosure. try searching mini or micro switches all i get are actual micro switches

>> No.1622265

>>1622264
solder a wire from the pins to two nearby pads and then bridge them every time you want to press a button
bonus points: do the same thing but for an N-way switch so that you don't have to buy any components

>> No.1622821

>>1622264
Search amazon for "panel mount button"

>> No.1623478

alright folks, I got a pretty nasty one I think.
I'm trying to control an RGB LED with Processing through serial.

Processing code:----------------------------------------------------------------

import processing.serial.*;
Serial serial;

float[] X = { 40, 100, 160 };
float Yi = 50, Yf = 330;
float R = 200, G = 200, B = 200;
void setup(){
size(200, 400);
serial = new Serial(this, Serial.list()[0], 9600);
println( Serial.list()[0] );
}
void draw(){
background( 100 );
stroke( 160 );
strokeWeight( 20 );
for(int i = 0; i < 3; i++) line( X[i], Yi, X[i], Yf );
stroke( 20 );
strokeWeight( 16 );
for(int i = 0; i < 3; i++) line( X[i], Yi, X[i], Yf );

stroke( 255, 0, 0 ); strokeWeight( 16 );
line( X[0], R, X[0], Yf );
stroke(160); fill(255, 0, 0 ); strokeWeight(3);
ellipse( X[0], R, 25, 25 );
stroke( 0, 255, 0 ); strokeWeight( 16 );
line( X[1], G, X[1], Yf );
stroke(160); fill( 0, 255, 0 ); strokeWeight(3);
ellipse( X[1], G, 25, 25 );
stroke( 0, 0, 255 ); strokeWeight( 16 );
line( X[2], B, X[2], Yf );
stroke(160); fill( 0, 0, 255 ); strokeWeight(3);
ellipse( X[2], B, 25, 25 );

int r = round( map( R, Yf, Yi, 1, 255 ) );
//serial.write( char(r) );
int g = round( map( G, Yf, Yi, 1, 255 ) );
//serial.write( g );
int b = round( map( B, Yf, Yi, 1, 255 ) );
//serial.write( b );
//serial.write( '\n' );
String s = char(r) + "" + char(g) + "" + char(b) + '\0' ;
//println( s );
serial.write( s );//+"," +"\n"+'\n'

fill( r, g, b );
rect( X[0]-12, Yf + 30, 145, 30 );
}

int dragging = -1;
void mousePressed(){
if( mouseX < 70 ) dragging = 0;
else if ( mouseX > 130 ) dragging = 2;
else dragging = 1;
}

void mouseDragged(){
if( dragging > -1 ){
switch( dragging ){
case 0: R = constrain(mouseY, Yi, Yf ); break;
case 1: G = constrain(mouseY, Yi, Yf ); break;
case 2: B = constrain(mouseY, Yi, Yf ); break;
}
}
}
void mouseReleased(){
dragging = -1;
}

>> No.1623482

>>1623478
arduino code:

//int pins[]= { 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2 };
int pins[]= { 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44 };
int pot_in = A15;
int R = 2;
int G = 3;
int B = 4;
int r = 127, g = 127, b = 127;
float K;

void setup() {
Serial.begin(9600);
//Serial.println("Ready");
for(int i = 0; i < 12; ++i ) pinMode( pins[i], OUTPUT );
pinMode( pot_in, INPUT );
pinMode( R, OUTPUT );
pinMode( G, OUTPUT );
pinMode( B, OUTPUT );
K = TWO_PI / 1024.0;
}

void loop() {
for(int i = 0; i < 12; ++i ) digitalWrite( pins[i], LOW );
int pot = analogRead( pot_in );
int level = map( pot, 0, 1023, 12, -1 );
for(int i = 11; i >= level; --i ) digitalWrite( pins[i], HIGH );

if(Serial.available() >= 3 ){
String input = Serial.readString();
r = constrain( int(input.charAt(0)), 0, 255 );//int(Serial.read()) input[0]
g = constrain( int(input.charAt(1)), 0, 255 );
b = constrain( int(input.charAt(2)), 0, 255 );
//if (Serial.read() == '\n') break;
}

analogWrite( R, r );
analogWrite( G, g );
analogWrite( B, b );

delay(10);
}

--------------------------------------------------------------

What happens is, as soon as I play the Processing sketch the arduino stops. The green RX led blinks, but nothing works, even the other potentiometer controlled LEDs that I have on there turn off, which have nothing to do with the serial. As soon as I close the sketch, they come back on.

Any help is appreciated at this point.

>> No.1623487

>>1622264
how about DIP switches?

>> No.1623575

>>1622821
>panel mount button
okay thanks. did that. found a few. but why in the ever loving fuck is it that 99% of them are "momentary" switches !!???

JESUS FUCKING CHRIST ALL I WANT IS A LATCHING ON / OFF SWITCH THAT ISN'T AN INCH IN DIAMETER. WHY IS IT SO GOD DAMNED HARD TO FIND A SMALL SWITCH !!??

>> No.1623611

>>1623575

they make lots of toggle switches that fit 1/4 inch hole. but let me guess. flipping a toggle switch would ruin your life.

>> No.1623819

Wow teensy 3.5 is expensive as fuck.
what is so great about this ripoff arduino?

>> No.1623821

>>1623819

you're kidding, right?

The Teensy is a breadboard-friendly development board with loads of features in a, well, teensy package. Each Teensy 3.5 comes pre-flashed with a bootloader so you can program it using the on-board USB connection: no external programmer needed! You can program for the Teensy in your favorite program editor using C *or *you can install the Teensyduino add-on for the Arduino IDE and write Arduino sketches for it!

The processor on the Teensy also has access to the USB and can emulate any kind of USB device you need it to be, making it great for USB-MIDI and other HID projects. The 32-bit, 120MHz processor brings a few other features to the table as well, such as multiple channels of Direct Memory Access, several high-resolution ADCs and even an I2S digital audio interface! There are also four separate interval timers, plus a delay timer! Oh yeah, and all digital pins have interrupt capability and are 5V tolerant.

All of this functionality is jammed into a 62.3mm x 18.0mm board with all solder points on a 0.1" grid so you can slap it on a breadboard and get to work! The Teensy 3.5 (as well as its sibling, the Teensy 3.6) is larger, faster and capable of more projects, especially with its onboard micro SD card port. An upgraded ARM Cortex MCU (120MHz from 72MHz), more memory (512K from 256K), as well as more RAM, EEPROM and accessible pins make up the key new features of this "teensy" board. The Teensy 3.5 is slightly scaled down from the Teensy 3.6 but is offered at a cheaper price point, comparatively.

>> No.1623823

>>1623819
The awesome new Teensy 3.5 is a small, breadboard-friendly development board designed by Paul Stoffregen and PJRC. Teensy 3.5 brings a low-cost 32-bit ARM Cortex-M4 platform to hobbyists, students and engineers, using an adapted version of the Arduino IDE (Teensyduino) or programming directly in C language. Teensy 3.5 is an upgrade over 3.2, for when you need even more power!

Version 3.5 features a 32 bit 120 MHz ARM Cortex-M4 processor with floating point unit. All digital pins are 5 volt tolerant. The unique specs for the 3.5 are:

120 MHz ARM Cortex-M4 with Floating Point Unit
512K Flash, 256K RAM, 4K EEPROM
Microcontroller Chip MK64FX512VMD12 (PDF link)
1 CAN Bus Port
16 General Purpose DMA Channels
5 Volt Tolerance On All Digital I/O Pins

>> No.1623824

>>1623819

The latest in the line of very powerful, USB-capable microcontrollers, the Teensy 3.5 and 3.6 development boards are faster, more capable, and bigger, putting even more pins on a solderless breadboard. Teensy 3.5 offers a little bit less in its features (MCU, RAM, Flash, clock and some peripherals) which makes it slightly cheaper than Teensy 3.6. Teensy 3.5 has 5V tolerance on all digital I/O pins. Only Teensy 3.6 has a USB High Speed (480 Mbit/sec) port accessed using 5 pins on the board.

Please note: Teensy 3 boards are not official Arduino-brand products. Although the Teensyduino IDE has been adapted so that many Arduino projects will work with the Teensy, there will still be a lot of libraries and shields that may not work with this device! If you're new to microcontrollers, we suggest going with a classic Arduino UNO since all Arduino projects, examples and libraries will work with it.

62 I/O Pins (42 breadboard friendly)
25 Analog Inputs to 2 ADCs with 13 bits resolution
2 Analog Outputs (DACs) with 12 bit resolution
20 PWM Outputs (Teensy 3.6 has 22 PWM)
USB Full Speed (12 Mbit/sec) Port
Ethernet mac, capable of full 100 Mbit/sec speed
Native (4 bit SDIO) micro SD card port
I2S Audio Port, 4 Channel Digital Audio Input & Output
14 Hardware Timers
Cryptographic Acceleration Unit
Random Number Generator
CRC Computation Unit
6 Serial Ports (2 with FIFO & Fast Baud Rates)
3 SPI Ports (1 with FIFO)
3 I2C Ports (Teensy 3.6 has a 4th I2C port)
Real Time Clock

>> No.1623827
File: 605 KB, 1688x706, Screenshot_2019-06-05_06-58-15.png [View same] [iqdb] [saucenao] [google]
1623827

>>1623819

It's just the most incredible product I've ever seen!

>> No.1623831

>>1623827
I don't see it.
Any small project $40 teensy can do, arduino can do for $3 and it enjoys 100% library support
Any big project teensy can do, a rasperry pi or actual amd64 linux pc can do better for not much higher expensiveness
It seems to me like teensy is trying to fill a market gap that doesn't exist

>> No.1623836

>>1623831
>a rasperry pi or actual amd64 linux pc can do better for not much higher expensiveness

wow. the pi has really improved over my 3 B+ since it can do all this:


62 I/O Pins (42 breadboard friendly)
25 Analog Inputs to 2 ADCs with 13 bits resolution
2 Analog Outputs (DACs) with 12 bit resolution
20 PWM Outputs (Teensy 3.6 has 22 PWM)
USB Full Speed (12 Mbit/sec) Port
Ethernet mac, capable of full 100 Mbit/sec speed
Native (4 bit SDIO) micro SD card port
I2S Audio Port, 4 Channel Digital Audio Input & Output
14 Hardware Timers
Cryptographic Acceleration Unit
Random Number Generator
CRC Computation Unit
6 Serial Ports (2 with FIFO & Fast Baud Rates)
3 SPI Ports (1 with FIFO)
3 I2C Ports (Teensy 3.6 has a 4th I2C port)
Real Time Clock

>> No.1623886

I made a couple of libraries for arduino i use, but i don't like keeping them in the standard libraries directory, because i have a bunch of 3rd party libraries there and i can't easily tell which of them are mine.
Is there some way i can put my libraries into a separate directory and still be able to #include them across my projects?

>> No.1623893

>>1623886
>i have a bunch of 3rd party libraries there and i can't easily tell which of them are mine.

how hard is it to come up with new names so that yours are recognizable? "my_spi_library" or whatever? All you have to change is the directory name.

>> No.1623902

>>1623893
Only cucks settle.

>> No.1624176

>>1621855
Need to make a driver to power a few thousand leds without wasting 12v power on resistors.

All led drivers i find are like 20 leds and thats it. Fuck that. I NEED POWER

How to do it?

>> No.1624179

>>1624176
>All led drivers i find are like 20 leds

more details are needed. if they are all the same then you can parallel and series them in a grid and drive with a constant current source that wastes little power.

>> No.1624227

>>1623611
toggle switch is fine i guess

>> No.1624329

>>1622264
Raspberry Pi is pretty much the same thing as Arduino right?
I want to turn my Pi on and off while its in a watertight box. Ideally with a toggle switch poking out. How does one do this?

>> No.1624360

>>1624329
>Raspberry Pi is pretty much the same thing as Arduino
god no!
raspberry is a full on computer that can run a full fledged linux distro
arduino is a smol boi that is like "oh u press button senpai? let me turn your led on <3"

>> No.1624378

>>1624360
both are cheap, both have a bunch of pins you can do things with..
There isn't Raspberry Pi general, that's why I ask here.
Can't you run some kind of OS on an arduino Mega?

>> No.1624379

>>1624378
Why does it even matter what device it is? The switch doesn't care, just put it on the power cord and seal it with epoxy or something so it is water resistant

>> No.1624391

>>1624379
Maybe he wants a soft switch that properly shuts down the system?

>> No.1624407
File: 78 KB, 1280x720, WIN_20190606_12_27_04_Pro.jpg [View same] [iqdb] [saucenao] [google]
1624407

>>1624379
Thing is, the Pi is powered by a usb to micro-usb cable.
I'd want a switch like in the picture. Stripping the USB cable and connecting VCC via the switch seems the obvious way. However, the battery thing to power the Pi has its own switch (too small to poke through a pannel) and a red LED goes on when it is switched on. If I do as described above, the LED will be on permanently. Also, I've never stripped such a cable, it sounds fiddly.

>> No.1624454

>>1623482
Ok so you're sending the serial by some pc c program?
Can you simulate ideal mouse behaviour, ie by a timer and put a sin wave or something and verify its communicating in the first place?
>int pot = analogRead( pot_in );
int level = map( pot, 0, 1023, 12, -1 ); does this imply if the pot reads 1023 it will try to use pins[-1]?

>> No.1624576

>>1624407
Dont bother with stripping a USB cable.

You can power the system with the 5V and GND pins on the large pin header.

>> No.1624577

>>1624454
Hes using Processing for the PC side, I've only used it a little bit, so I don't know its limitations:
https://processing.org/

>> No.1624585

>>1623575
They aren't hard to find, you just need to know what you're looking for.
google "pcb switch" and you'll get miniature open/closed switches.

>> No.1625420

>>1624585
yes finally. thats a search that gets me almost exactly what im looking for. thank you anon.

>> No.1625624

If you put arduino to sleep and then watchdoge resets it, the ram gets wiped right?
So if i am using string there shouldn't be any issue with memory holes since it is rebooting every minute

>> No.1625628

>>1625624
>watchdoge resets it, the ram gets wiped right?
Pretty sure it doesn't actualy, unless the arduino platform has boilerplate startup code to wipe sram and registers.

>> No.1625828

newbie here, i once did the arduino blink but nothing more
I wanna build an rpm meter additional with thermocouple and data logging for both variables
So what board do i get? i need a small oled screen and 12V input would be nice to have
and im looking for the cheapest.
The rpm signal gets picked from an ignition coil, chip damage is almost certain

>> No.1625832

>>1625828
Uno

>> No.1626240

>>1625828
>The rpm signal gets picked from an ignition coil, chip damage is almost certain
use voltage divider or hall sensor

>> No.1626243

HI Team,

Hoping to get some input on a project I've been wanting to make, I've done some research but most things I've found seem to indicate that the adiuno just isn't powerful enough to process audio signals well.

Basically, what I want to do is create a wall-mounted guitar tuner, that will use an audio sensor/mic of some kind to allow me to process the audio and fund the fundamental frequencies. Application from there will be as simple as lighting up some LED's depending on whether notes are in tune or not.

Anyone have any suggestions?

>> No.1626245

>>1626243
>a wall-mounted guitar tuner,

jimi hendrix had one of those

>> No.1626251

>>1626243
if it is ele guitar then just use an op amp and then process the amplified signal with arduino, but if it cuckoustic guitar you need a high quality mic before the opamp

>> No.1626269

>>1626251
Yeah, I know using the linein is one option, but I like the idea of being able to use it with my acoustic too. Sounds like I'm pushing my luck as a novice, though.

>> No.1626274

>>1626269
It's actually pretty easy, sound moves the microphone parts and they generate very weak voltage which you amplify with an op amp and then output that amplified voltage onto an analog pin on the arduino and program a sketch to proccess it and turn on or off leds, this is actually very easy to do, i am prety sure there will be at minimum several tutorials on the net and youtube on how to make ardunino based tuner

just make sure to watch the volatge from the opamp so it doesn't go above 5V or it will fry the arduino and save for the LEDs it is better to turn them on via mosfet rather than hook them directly to arduino pins because logic pins can handle couple dozen miliamps at most, combined

>> No.1626279

>>1626274
>it is better to turn them on via mosfet rather than hook them directly to arduino pins

or display the actual frequency on a 2x16 LCD display, and maybe the percent error, or whatever makes sense to Eddie Van Halen.

>> No.1626299

>>1626274
Thanks, anon

>> No.1626399

>>1626279
>or display the actual frequency on a 2x16 LCD display
>on a wall
>>1626251
>high quality mic
>for a tuner
>>1626274
>voltage going outside the rails
>not just biasing an electret to use as a contact mic on both types of guitar
wew

>> No.1626405

>>1623478
>>1623482
HIROOOO

Why don't we have code tags in /diy/? They have them in /sci/ too

>> No.1626557

fuck
those blue arduino relays don't work with 3v at the input even when they are powered by 5V on vin, that is so annoying, now i have to add an extra mosfet to each copy of my product i make just so my 3v ic can put 5v on the relay input pin

>> No.1626562

>>1626557
>muh tindies
nah put an optoisolator on it and make 'em pay for the feature

>> No.1626684

//LEDs
const int d1 = 11;
const int d2 = 13;

//pushbuttons
const int b1 = 5;
const int b2 = 7;


//button state
int bs1 = 0;
int bs2 = 0;

void setup() {
pinMode(d1, OUTPUT);
pinMode(d2, OUTPUT);

pinMode(b1, INPUT);
pinMode(b2, INPUT);
}

void loop() {

//read state from buttons
bs1 = digitalRead(b1);
bs2 = digitalRead(b2);


//apply state to LEDs
digitalWrite(d1, bs1);
digitalWrite(d2, bs2);

}

Why the fuck doesn't this work? I have just 2 leds wired to the output pins and two buttons on the inputs. It just does this: https://www.youtube.com/watch?v=A6wM9yLMdRI

>> No.1626697

I'm a new to most of this. I just found an old pi zero I bought over a year ago. What's the difference between Arduino and the pi? And how do I get started?

>> No.1626809

>>1626684
induction. your button pins are floating, you need to pull them to a known state
for example if the mechanical button pulls a pin high when pressed it will leave it floating when not pressed, you need to make sure the input pin is always pulled high or low.
uno has built in pull ups i think so you can do pinmode(pin, INPUT_PULLUP) and then have the button pull it to ground to activate and you of coruse change the led pin to digitalWrite(d1, !bs1);

also don't connect leds directly to logic pins, you are going to damage the ic

>> No.1627229

>>1626243
I've got a clip-on tuner for my bass guitar that's pretty fast at detecting the note being played, picks up vibrations when it's clipped to the head. I can't tell you what microcontroller it's using though and can't be arsed to take it apart to find out. My first guess would be that it's running a FFT algorithm of some kind, but perhaps that's overkill and there's better ways to do it.

>> No.1627259

>>1626697
>What's the difference between Arduino and the pi
approximately the difference between a cordless phone from the early 1990s and a modern Android phone

>>1627229
tuners don't need a fast sampling rate, 2kHz should be enough. therefore an STM32F103 is probably enough to do it, or try GigaDevices' clone GD32F103, with a 108MHz maximum core clock (overclockable to 120MHz by some reports). not much analog circuitry needed, just a very basic, lo-performance mic amp into the F103's ADC

>> No.1627395

>>1621855
How do I propose marriage to this boy?

>> No.1627396 [DELETED] 

>>1627229
also, autocorrelation

>>1627395
I'm sure she'll(male) hear you

>> No.1627397

>>1627229
also, autocorrelation

>>1627395
looks like one of our own. I'm sure she'll(male) hear you

>> No.1627398
File: 47 KB, 750x771, 1529228277259.jpg [View same] [iqdb] [saucenao] [google]
1627398

I have a bunch of microcontrollers and I want a medium sized I2S to speaker module that works with 3.6 or 5V.
Which chink module would be the best balance between volume and quality? Would a voltage pump be a good bet if I ever design a battery powered audio circuit?

>> No.1627413

>>1625828
>The rpm signal gets picked from an ignition coil, chip damage is almost certain
Use an optoisolator or photocoupler. That's what they're for.

>>1626684
Show us your circuit. Also, be aware of switch or contact bounce. Your read-write loop works from a software standpoint, but fails from a hardware one. You may want to introduce a delay and perform multiple reads before turning an LED off or on.

>> No.1627436

>>1627413
>optoisolator or photocoupler
they are the same thing mr. galaxy brain

>> No.1627441

>>1626697
arduinos are good for doing the same thing over and over again very fast. You program a loop into them.
Pis are more versatile. You can run an entire operating system on them, open and close programs etc.
>why even use an arduino then?
With arduinos its easy to talk to various sensors which use i2c or spi protocol. Also, for when you dont want lag and for doing maths really fast.

To get started: buy an arduino kit. I got one from ELEGOO. It comes with instructions to build some thing. Do a few, then you can experiment with your own projects.
For the Pi, buy one and try to blink a light. Then you could eg buy a camera and follow some machine vision tutorials.

>> No.1627445

>>1626697
EDIT: as you already have a Pi zero, try doing this:
https://www.tunnelsup.com/raspberry-pi-zero-blink-an-led-using-gpio-pins/

Some things might not make sense, just do a search to find out eg 'install python raspberry pi'

>> No.1627485

>>1627441
>Then you could eg buy a camera and follow some machine vision tutorials.
How hard are those?
I can program in things like c# but i never tried anything like computer vision.
How hard is to achieve something like for example reading reg. plates from a car?

>> No.1627503

>>1627441
>for doing maths really fast.

Are you saying a 16 mhz 8 bit microcontroller (Arduino) can do math faster than a 1.2 GHz 64 bit quad core processor (pi 3 model B)?

>> No.1627506 [DELETED] 

>>1627441
>For the Pi, buy one and try to blink a light

This has to be the worst advice ever. It's about as bad as saying "get an Arduino and try to load a value into register 6". A pi is not a great microcontroller, but it is an awesome general purpose computer in a tiny form factor and is very inexpensive. It excels in doing a single task that you would use a dedicated PC or laptop for, and last time I checked, nobody was using a dedicated PC to blink a LED. Which is why it's hard to say what a first exercise should be for a pi, same as you don't see lists of first exercises for PCs and laptops.

>> No.1627546

I fucked the CSI connector on my pi zero. is there any other way for the zero to work with a camera through the pins somehow?

>> No.1627553
File: 73 KB, 673x436, Screenshot_2019-06-11_08-30-14.png [View same] [iqdb] [saucenao] [google]
1627553

>>1627546

I'm not an expert, but pic-related suggests that the CSI doesn't use ordinary GPIO pins.

>> No.1627555

>>1627546
zeroes are cheap just buy another one

>> No.1627714

>>1627503
Yes. Duh.

>> No.1627717

>>1627714

lol right. by math, do you mean anything like finding the cube root of 3.714? Even something like adding 1 and 1 a thousand times would be faster on the pi if you compiled a C program, and probably faster even with crap script like Bash or Python.

>> No.1627851
File: 159 KB, 800x600, 1529865380637.png [View same] [iqdb] [saucenao] [google]
1627851

>>1627717

>> No.1628031

>>1627485
look up OpenCV. it's extremely likely there's a C# API for it and I know there's .NET for Linux... which should give you some tangible results to sustain you while you learn Python because that's where the new "AI" kids are these days

>> No.1628923

>>1621855
Im trying to convert a lib that communicates with a device over spi. Does the CS and RST pin matter or can they be free pin.

>> No.1628936

>>1627413
>>The rpm signal gets picked from an ignition coil, chip damage is almost certain
>Use an optoisolator or photocoupler. That's what they're for.
You can also use a few turns of wire wrapped around a spak plug lead (better yet, wrapped around a ferrite core clamped around a spark plug lead) to inductively couple, and put (2) silicon diodes (1n4007 should do) back to back across that coil, limiting the inductive spikes to 1V peak-to-peak. Send that to a comparator (make one out of 741, or use dedicated LM series chip) to clean up and get desired logic level.

>> No.1629049

>>1628923
free choice

>>1628936
>back-to-back
= series, which will limit spikes to the reverse breakover voltage of the diodes (1000V for 4007s). instead, a parallel connection will behave as you describe and as is desired. this is why schematic diagrams are the language of communication in electronics
>741
what century are you from

>> No.1629512

If i use
attachInterrupt CHANGE
how do i figure out inside of the function if the interrupt is falling or rising?
is the only way reading the pin state?

>> No.1629772

>>1629512
if it works where's the problem?

>> No.1629778

>>1629512
>is the only way reading the pin state?

being as how that's about as fast and simple as any other method, what exactly are you asking?

>> No.1629949

>>1621855
whats the advantage / disadvantage of an arduino over a single board computer like the beagle or raspery pie? (other than the latter's limited I/O & lack of support for PWM.

>> No.1630045

>>1629949
arduino: no or very little OS, brass-tacks, sort of multitasks, slow to compute, low-latency digital I/O, little RAM, can be very smol. approximately on the level of a high-end washing machine circa 2000
SBCs: linux, easy, multitasks, fast to compute, high-latency digital I/O, lots of RAM, not exactly tiny. approximately on the level of a high-end refrigerator circa 2020
can google hear me shouting "nigger nigger nigger nigger" at these slow-fade captchas lately

>> No.1630063

>>1629949
pi os more web server tier and arduino is more garage opener tier

>> No.1631725

bump

>>1629949
The RPI is a full Linux computer. it's kind of over kill if you're not really using networking, video output or USB imo.

>> No.1632330
File: 2.16 MB, 300x240, dave.gif [View same] [iqdb] [saucenao] [google]
1632330

>Be me knowing nothing about arduino
>This seems easy
>Buy UNO R3, and Music Shield
>Install Arduino Software
>Code thing appears
I don't know what to do guys, help

>> No.1632338

>>1632330
What did you expect son?
Coding for arduino is laughably easy compared to other ICs sans pi

>> No.1632339

>>1632338
have any guide to start or something?

>> No.1632585

>>1632339
google and youtube, literally thousands of tutorials everywhere, arduino is extremely popular since it is so easy

>> No.1632608

>>1632339
>have any guide to start or something?

what is it about Arduino that it attracts people who in 2019 have literally never learned how to search for anything? Arduino has to be the biggest tard magnet since the AOL cds 25 years ago.

>> No.1632611

>>1632608
Duh it gets shilled everywhere and nano clones are 5€ for 10.
No need for icsp programmer too

>> No.1632612

>>1632608

Look at the gif he posted, anon. He's about 10 or 11 years old, so cut him some slack.

>> No.1632619

>>1621855
might as well ask here,
i have a arduino mega 2560 & raspberry pi.3
thing is, i don't know a simple way to test them and verify that they work.
i tried powering the raspberry pi with a usb cable and connecting it via hdmi to my 40inch tv, it didn't display anything on the tv,
isn't it supposed to at least display the logo like a bios or do i need the os installed first?
thanks

>> No.1632633

>>1632619
>isn't it supposed to at least display the logo like a bios or do i need the os installed first?

I pulled the SD card out of mine and when I powered it the monitor said "no signal".

>> No.1632652

>>1632619
if there is is no os on it then what do you expect will control the graphics chip and put out the image?
flash an sd card with raspibian and try to boot it with the hdmi cable
for arduino the easiest way is to upload a blink sketch
mega has a built in led so you don't need an external on. you will need arduino IDE

>> No.1632658

>>1632652
>mega has a built in led

as does uno, nano, and many others. and as for your pi comments, it is a lot like a PC, and a PC without a hard drive (meaning no OS) will still have a boot screen from the bios, and it's not unreasonable to wonder if a pi has a bios built in.

>> No.1632677

>>1632658
BIOS is an operating system fren

>> No.1632680

>>1632677

correct, but the point still stands, that it's not unreasonable to wonder if the pi has a bios in addition to the OS on the SD card. After all, something has to be able to read the SD card, same as a PC has the bios to mount the drive that has Linux or whatever, and that OS could also show a configuration screen if there were anything to configure, like for example in the future they might have a pi that can boot from an OS on a USB drive instead of the SD card.

>> No.1632903

>>1632677
only in the sense that it offers resource sharing services to user programs on an ongoing basis. even today an x86 OS still calls back to some sort of BIOS/ACPI code to handle board/MPU-specific crap like power management. otoh most of these fruit pis are built on tablet/STB SoCs. such chips are often used in applications where custom firmware or multi-booting aren't necessarily welcome (if lucky, *maybe* you get a recovery image) and the designer should have maximum control over IOs without assumptions or disturbance from other code. therefore, any boot menus/prompts or the like on such a system will be there because you brought them with you on the boot media
[old-timer]in older and smaller systems, the entire local bus was fully running after reset and all the bootstrap you needed was to set the PC to a fixed value and just start running code, or, at most, to load the PC and maybe one or two other registers from a fixed address then start running. which was great back when parallel ROMs were the usual medium for boot code. today almost every 32+ bit MPU produced contains some small piece of sub-boot firmware, invisible to the user, that sets up the bare minimum hardware (one OR MORE internal system buses, GPIOs, external serial or parallel interfaces), reads any bootstrap configuration pins, checks a predetermined series of fixed locations on boot devices for the user's boot program, downloads the first one it finds into RAM (in the x86 world, this program is usually called a BIOS and lives on serial flash) and hands over control of the system to it. that's just a loader, not an OS, menus or no. some MPUs additionally include onboard flash or OTP so a device manufacturer can add another middleman gatekeeper boot loader on the chip e.g. for authentication, hardware disablement, or just to free up a few dozen mm^2 on the board[/old-timer]

>> No.1633159

Not quite Arduino, but I imagine there's enough overlap.
Does anyone know of any good power banks that support passthrough? I'm going to be making a small portable PC with a Raspberry Pi and I need a battery that can be recharged/kept charged without turning off everything connected to it.

>> No.1633182

>>1633159
https://uk.rs-online.com/web/p/power-banks/7757508/
might look up some of those dual-18650 UPS hats on fleabay et al, see if they have enough juice to run your whole kit

>> No.1633381

>>1621855
I'm almost done with my robotics project. I just can't figure out how I'm going to put all the electronics on the chassis. I thought of soldering them onto a protoboard but then I can't get my arduino back, the other option is to put them on a breadboard and stick it onto the chassis which is heavy and unsafe (?). What should I do?

>> No.1633393
File: 50 KB, 1280x640, FEMALE-HEADER.jpg [View same] [iqdb] [saucenao] [google]
1633393

>>1633381
Just solder a headers on the protoboard and stick your Arduino on it.

>> No.1633400
File: 82 KB, 614x461, download.jpg [View same] [iqdb] [saucenao] [google]
1633400

>>1633393
That's probably the best option, thanks anon.
While I have your attention: is scoring a protoboard with a craft knife good enough to electrically isolate two halves of one strip? I did some crude tests with my multimeter and it seemed OK but maybe I should be "punching holes" like in pic rel.

>> No.1633407

>>1633400
You should be able to get away with just using a knife - might need several passes.
But drilling a hole like in your pic is nicer since the separation is obvious and you don't need to second guess yourself.

>> No.1633413

>>1633400
sort of. here's what I do:
score once with the tip of a #11 blade held vertical, then just to one side of it score at a 45° angle meeting the first cut at a point just beneath the copper surface of the board. a small burr of copper should protrude which you can then scrape off with the blade parallel (or nearly so) to the board. test for no continuity before using

>> No.1633598

This has been driving me nuts, maybe there is a dumb error I'm just not seeing.
I want to drive multiple steppers at the same time, so I'm using interrupts for their timing.

Now the issue is that the timing is all wrong.
I program the timer to fire every x time, but what I get is that it fires after x + 16 ms.

There isn't any 16 ms delay anywhere, and I checked the values several times.

In the program I input an RPM value that is converted into a preload value for an 8-bit timer.
Using 30 RPM it calculates a preload of 100, which means it needs 156 ticks to go off, and with a freq of 16MHz and a prescaler of 1024 those 156 ticks should happen in 156/(16000000/1024) = 0.01 s = 10 ms, but instead it goes off every 26 ms.
If I use other preload value it is till wrong by 16 ms.

code

volatile byte timerPreload = 0;
volatile int flag = 0;
volatile unsigned long time = 0;
long lastTime = 0;
int speed = 30; //[rpm]

void setup() {
Serial.begin(230400);
TCCR2B = (TCCR2B & B11111000) | B00000111; //prescaler 1024
TIMSK2 = (TIMSK2 & B11111110) | B00000001; //enable timer overflow interrupt
setMotorSpeed(speed);
}

void loop() {
if (flag == 1)
{
long deltaTime = time - lastTime;
lastTime = time;
Serial.print("Delta Time: ");
Serial.println(deltaTime);
Serial.print("Preload: ");
Serial.println(timerPreload);
flag = 0;
}
}

void setMotorSpeed(unsigned int speed) { //speed in rpm
timerPreload = (byte)(256L - (60L*16000000L)/(1024L*200L*(long)speed));
}

ISR(TIMER2_OVF_vect) {
flag = 1;
time = micros();
TCNT2 = timerPreload;
}

/code

>> No.1633610
File: 96 KB, 775x918, 1549679958574.png [View same] [iqdb] [saucenao] [google]
1633610

>>1633598
any warnings from the compiler?
why are you casting the numerator of the division to a byte?

>> No.1633631
File: 27 KB, 708x162, 1550442879593.png [View same] [iqdb] [saucenao] [google]
1633631

>>1633598
disregard >>1633610 I miscounted parentheses
read the description for the TCNT2 register carefully, Pic related
timer2 is a lot more capable than timer0, you can use the output compare registers (there are two) to raise an interrupt and/or restart the counter, without getting in the way of any PWM you might also be doing

>> No.1633633

>>1633610
>any warnings from the compiler?
No.
>why are you casting the numerator of the division to a byte?
Casting the whole thing, not just the numerator. Not really necessary as timerPreload is byte type anyway.
And, yes, there probably are better ways to perform that operation, but it gives me the expected value (100 in this case).

>> No.1633634

>>1633631
Not doing any PWM.

>> No.1633638

>>1633634
then why not just set up the counter for CTC mode, and let it reload itself (iirc, TCCR2A = 0x2, TCCR2B=0x7, TIMSK2=2, OCR2A=timerPreload, TIMER2_OVF_vect -> TIMER2_COMPA_vect)

>> No.1633647
File: 66 KB, 1001x1001, 61OSoUe-8dL._SL1001_[1].jpg [View same] [iqdb] [saucenao] [google]
1633647

>>1633182
>dual-18650 UPS hat
Something like pic related?
They seem to be both more expensive and have less capacity than that RS Pro powerbank, though. Even something like https://www.banggood.com/Geekworm-UPS-HAT-Board-2500mAh-Lithium-Battery-For-Raspberry-Pi-3-Model-B-Pi-2B-B-A-p-1105260.html is still half the capacity for 1.5x the price.
Do hats using the GPIO pins have any inherent advantages over using a power bank with passthrough and micro USB? The whole thing is going to be contained in a case, so I don't mind the battery not being anchored to the Pi, and having it not stacked on top of the Pi would actually be better for the thickness.

>> No.1633654

>>1633647
>stacked over the Pi
>connected through an USB cable
maximum_eww.tiff

>> No.1633656

>>1633654
I'm not even sure why, since the thing also connects to the GPIO pins.

>> No.1633659

>>1633656
The GPIO are not for high current

>> No.1633665

>>1633659
Enough current to run the Pi, surely? There are other battery hats that don't connect via USB at all.
Is it supplying extra power for USB devices, or what?

>> No.1633666

>>1633659
Nothing inside a pi is for high current

>> No.1633670

>>1633666
high current is relative, satan

>> No.1633692

>>1633647
there are others, but only a 1S1P battery
form factor is the main advantage of hats but if that form factor doesn't work for you the powerbank might
if your needs aren't raspberry-specific and you're okay with a lot less handholding than you get in the raspberry world, you might also consider other brands of dev board (orange pi, FriendlyARM, etc.) some of which do have battery charging and power path management on-board, and perhaps can be configured to charge a 1S4P battery

>> No.1633741

What do you guys do with blue pills and other coretex microcontrollers? Do you actually use all that processing power for something?

>> No.1633755

>>1633638
>(iirc, TCCR2A = 0x2, TCCR2B=0x7, TIMSK2=2, OCR2A=timerPreload, TIMER2_OVF_vect -> TIMER2_COMPA_vect)

If "iirc" means "if I recall correctly", and you know this kind of shit, then there are only two possibilities: 1, you have a rainman brain and that might or might not be a good thing, 2., you are memorizing shit that is an absolute waste of time. I used to work with a guy who took pride in knowing a lot of fastener part numbers, so he'd never look them up. About one out of 10 times he'd get it wrong, and fixing his fuckup took about 1000x more time than it would have taken to just look the number up each time like everyone else.

I know one resistor color code, 1k. I bet you know about 50.

>> No.1633760
File: 192 KB, 1280x960, muh tendies.jpg [View same] [iqdb] [saucenao] [google]
1633760

>>1633741
for me it's more about the peripherals than the core. just three examples of STM32F features that are quite compelling:
highly versatile timers, with features like quadrature decoding, 16-bit open-ratio prescaler, 4-channels of up to 16-bit capture/compare/PWM (each), and DMA capabilities, among other things
a 12-bit 1Msps ADC, or better yet, two
native USB. nuff said

>>1633755
more like remembering the shit from the three minutes ago when I was looking at it for him but too lazy to circle back to the user manual
>I bet you know about 50.
got fluent with reading/writing EIA color codes a quarter of a century ago, memorized the E24 series not long after that. now working on resistor codes like Pic related = 124kohms ±1%

>> No.1633818

>>1633598
>>1633633
That can't be your full code, post everything.

What hardware are you using?

>> No.1633836

>>1622264
https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20190621063310&SearchText=latching+tactile+switch

>> No.1633873

>>1633741
I only use arduino nanos and esp32 if i need wifi, so far none of my projects needed high processing power

>> No.1633972

>>1633818
>That can't be your full code, post everything.
>>1633610
It is, the entire contents of the .ino file. Ran it on an Arduino Uno R3

>> No.1633978

>>1633972
Shit, meant to quote >>1633598

>> No.1634191

>>1633972
but did you read the datasheet excerpt posted with your fuckup highlighted or were you too busy posturing as cool duino jock?

>> No.1634198
File: 104 KB, 270x400, thinking_sounds.jpg [View same] [iqdb] [saucenao] [google]
1634198

>>1634191

I hate him to. He is ruining this board.

>> No.1634224

>>1634191
>with your fuckup highlighted
what, that it disables the compare match? I was using timer overflow interrupt

Anyway, I already fixed it by changing to CTC mode

>> No.1634555
File: 3.10 MB, 320x240, 1559385266920.gif [View same] [iqdb] [saucenao] [google]
1634555

>just got hired to teach electrical principles at community tech college
>The lab has cheap arduinos as part of the trainers

It's really cool they've started implementing that as part of the program, especially since this is a cheap rural college. The only problem is that I've barely any experience with arduinos and I've got to teach 20+ students how to use them.

How stressed am I going to be from this?

>> No.1634556

>>1634555
>arduino teacher
>never seen an arduino before
yep sounds like community college alright

>> No.1634557

>>1634555

How the everloving fuck did you get hired to teach electrical principles and yet you are intimidated by arduinos. What exactly is your background in electrical engineering and or digital tech?

If you have any qualifications whatsoever you can prepare for the first class in a matter of hours, and then learn as you go. Post your stupid assed questions in /r/arduino; they readily embrace idiots.

>> No.1634592
File: 129 KB, 628x583, uARM_big.png [View same] [iqdb] [saucenao] [google]
1634592

>>1624378
Not the kind of OS you're thinking of. The ATMega 328 in a typical Arduino has 2K of on-chip SRAM, limiting you to straight firmware or a really tiny RTOS.

One absolute madman did emulate ARM on an AVR (with external RAM/strorage, pic related), Ubuntu took about four hours to boot. Search for "linux on 8-bit" as the spam filter keeps eating my link.

>> No.1634603

>>1634592
>Ubuntu took about four hours to boot

I think I'll pass on that "search for linux on 8-bit".

>> No.1634613

>>1634592
>One absolute madman did emulate ARM on an AVR
but.... why? he could be spending that time by building a machine that cures cancer or something and instead he wasted thousands of hours by booting os on a platform that renders it useless

>> No.1634753

>>1621855
I never had an *ino last longer than a week. That shit is useless trash. Good for maybe teaching students.

>> No.1634882

>>1634613
>but.... why?
Because he doesn't know how to cure cancer but he does know how to waste his life on demonstrations of his prowess.

>> No.1635016

>>1634613
>curing cancer
>by increasing industrial output and waste externalization
anon, I...

>> No.1635023
File: 1.72 MB, 1512x2016, IMG_20190622_235719969.jpg [View same] [iqdb] [saucenao] [google]
1635023

I can't get my DHT11 sensor to work with any library I've tried. Is my sensor just dead or something? Or is there a ESP8266 specific quirk I'm not aware of?

>> No.1635039

>>1635023
why dont you stop being a brainlet and make the driver code yourself instead of using other peoples libraries?

>> No.1635070

>>1635023
Save yourself some time and start by dropping dht11 and 22 because theyre useless. I've had several of them and they are inaccurate, unstable and humidity reading could be essentially random. Try bme/bmp280 or ds18b20.

>> No.1635075

>>1635070
can confirm, BME280 is exquisitely accurate and reliable

>> No.1635081

>>1635070
i second this, they are trash

>> No.1635083

>>1635070
>>1635075

The BME280 seems nice but I doubt I can get one shipped to my country by the time I have to present this project. No local electronics store seems to carry it.

>> No.1635085

>>1635083
it's a very small device and probably not a great stock item for a retail shop
the Si7021 is pretty accurate on temperature but might benefit from correction factors wrt humidity
both of these are available on module boards from China which probably doesn't help you much right now
best advice I have for you is to look for an ESP8266-specific DHTxx lib, on the assumption that the designers hardcoded a bunch of AVR-specific nonsense into their libs

>> No.1635087

>>1635085
Dht11 works on esp8266 with standard library, so it's not that.

>> No.1635243

>>1634753
How? Do you keep shorting them to ground and blowing that protection diode so it won't get power over USB any more? You can still power them externally and still upload code via USB if so, but you lose the convenience of USB power.

>> No.1635250

>>1635243

He's either lying or a fuckup. If Arduinos typically lasted just a few days you'd hear about it all over the place. AVRs in general are rather robust, as I know because over many years I have screwed up and done some pretty stupid things to them, and I've killed a few but I've also had some survive some crazy shit.

>> No.1635251

>>1635250
If he even breaks Arduino that quickly I wonder how long bare AVRs would last him.

>> No.1635832

Fuck, i just cannot get the esp32 to work reliably for me.
I just have it turn a realy on or off based on a string it gets from a server and this repeats in a loop every 10 seconds.
And sometimes it works fine for a day sometimes for a week and then the cunt just freezes and the only way to fix it is to unplug it and plug it back in.
But what really gets me is that not even the watch dog works when that happens, it doesn't reset it for some reason. But when i tested my watch dog code to make sure it works it did, so what kind of fuck up happens when not even watchdog can reset that shit.

>> No.1635835

>>1635250
This. I buy cheapest chinese arduinos and esp8266 and not one of them failed.

>> No.1635837

>>1635835
there is no such thing as non chink arduino, the ones you see in local stores are chinkduinos that just had their price multiplied by 10
i love ordering from china, like for the price of one uno from some jew store like sparkfun you can have about 7 identical unos from china

>> No.1635857

>>1635832
what language?
it sounds like you're running out of some resource you're not releasing for reuse

>> No.1635869

>>1635857
arduino, but even if it ran out of memory it doesn't explain why the watchdog wouldn't fire

>> No.1635871

>>1635869
poast code

>> No.1635888

>>1635869
>it doesn't explain why the watchdog wouldn't fire

my experience with esp8266 devices says the watchdog (and it supposedly has software and hardware watchdogs) it that it's not reliable. AVR watchdogs always work, but ESP crap can hang like he said, which should be impossible with a properly configured watchdog.

>> No.1635908

>>1635888
Can you post an example code for setting up a hardware watchdog?
I am not sure if the one i am using is software or hardware
this is the one i am using
https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/Timer/WatchdogTimer/WatchdogTimer.ino

But a watchdog that can hand is not a watchdog, watchdog is the last line of defense which prevents your module from hanging forever. You can have it installed somewhere where you can't just walk over and manually reset it so unreliable watchdog is absolutely inexcusable.
Watchdog is supposed to be completely code independent process that just hard resets your shit no matter what if not fed.

This fucking sucks, because if i can't get a reliable watchdog i will have to add something like attiny85 to each of my esp32 projects and the attiny will monitor if the esp32 is hanging and if yes it will cut power to it through like a fet or something to hard reset it, but this is just shitty extra hardware you have to install and extra money to pour in

>> No.1635976

i am a bit confused.
if you use ftdi, does the arduino have to have a bootloader on it, or is the ftdi replacement for a bootloader?

>> No.1635982

>>1635976
FTDI allows USB hosts to talk serial to the bootloader, yes you need to burn one onto the chip

>> No.1635986

>>1635982
oh i see, so ftdi is useless if the arduino doesn't have a bootloader on it,
well in that case i will just use the isp method since it seems to be the simplest one and you don't have a large delay every time your reboot the ic

>> No.1635987

>>1635986
an excellent choice, sir

>> No.1636149

Isn't the new raspberry pi 4 a bit TOO fast?

>> No.1636163

>>1636149
For Tarduino stuff? Sure.
But even the old Pis are overkill for that.

For a mini computer it's still very weak.
Even my (non-flagship) phone's more powerful.

>> No.1636226

what is the best protocol for simple communication over a wire between multiple arduinos?
basically i have one master arduino which will be reading values from salve arduinos, basically the slave arduinos will just be returning a simple number
Normally i would use i2c but the arduinos will be dozens of meters apart an i2c was designed for short distances

>> No.1636237

>>1636226
maybe RS-485 multidrop
CAN is cool and probably has the potential to run somewhat faster, but a bit more complicated

>> No.1636345

>>1636226
I would say rs485 run with phone line/ ethernet cables

>> No.1636437

>>1636226
Do you need to send commands to the slaves or just read data from them?

>> No.1636470

>>1636237
>>1636345
i looks like you need an extra module for that protocol which costs over a buck so that would almost double a price of each of my slaves, plus increase the size too
I would very much like to use something that can be done directly from the arduino to arduino with just wires between them

>>1636437
i need to be able to send simple strings, or at least numbers, to the slaves so i can tell them to say trigger a relay or something

>> No.1636508

>>1636470
>I would very much like to use something that can be done directly from the arduino to arduino with just wires between them

Get the I2C software code and slow it down until it works. You can send a 5 volt signal 100 miles if you wait long enough and the wires are insulated sufficiently. You might need to add code to filter noise, but with extremely slow clocking that will not affect anything. If you look at commercial I2C for long distances (shorter than your requirement) that's the main thing, slower clocks, plus some of them use higher voltages. So, if you want one Arduino to have wires going to another Arduino a mile away, find out how slow it has to go and it will work.

>> No.1636539
File: 17 KB, 922x459, 1.png [View same] [iqdb] [saucenao] [google]
1636539

I'm looking to design a bullet sorter which can sort bullets up to a 0.2 gram weight difference. I have access to Arduinos, 3D-printers and a small fabrication shop, and I know there are load cells available for the Arduino that could be accurate enough for this project. My gunpowder scale needs calibration every time I use it though - how do I even begin to implement such a feature on the Arduino? I also can't seem to think of a way to load and unload the bullets from the scale automatically, I just want to build a machine that I dump a box into, and it spits out several boxes of nicely weighed bullets while I go and do useful things instead of measuring bullet weight one at a time.

>> No.1636543

>>1636539

Put the bullets in a container where they roll/fall down to a single point due to slope and walls. Build a robot that can only pick up one bullet at a time to pick one out of that container and put it on the scale, then after weighing it picks it up and puts it in the right box.

The hardest part is designing the gripper thing so that it picks up one bullet from the pile, no matter where it is in the container. It might work better to put a conveyor belt thing in there that has buckets that can only hold one bullet, and the belt runs until it has dropped one bullet into the next stage of your rube goldberg contraption.

>> No.1636546

>>1636539
>ullet sorter which can sort bullets up to a 0.2 gram weight difference
but why?
whitey don't care if the bullet weighs 20 grams or 20.2 grams when you put one in his liver to and grab his wallet

>> No.1636555
File: 33 KB, 648x640, Knipsel.jpg [View same] [iqdb] [saucenao] [google]
1636555

>>1636543
How about a chute like pic related? Use the two pins to form a gate, actuate them with the Arduino and presto, only one bullet can roll ahead.

>>1636546
>not shooting whitey from 1000m away
God damn plebeians.

>> No.1636621
File: 505 KB, 1536x2048, IMG_20190625_174735.jpg [View same] [iqdb] [saucenao] [google]
1636621

I fucking hate soldering and connectiong trillions of pins but i did it, my comfy arduino uno hat for programming attinys and similar chips is finally finished

>> No.1636624

>>1636621
>that coolant pipe
are you the guy that asked about those third hand tools a while ago? how is it working out for you?

>> No.1636658

>>1636624
don't know yet, i was too lazy and haven't made the thing so far

>> No.1636727
File: 395 KB, 1425x1115, IMG_20190625_220752.jpg [View same] [iqdb] [saucenao] [google]
1636727

>>1636621
It's working.
Pilling that level to lock the chip in is so satisfying. I have to buy more attinys to program so i ahve an excuse to use the lever.

>> No.1636728

>>1636727
*Pulling that lever
shit i have to stop breathing in all that solder vapor

>> No.1636749
File: 161 KB, 640x640, 5pcs-lot-Stripboard-Veroboard-vero-prototype-print-Circuit-Board-6-4x14-4cm-2-54mm-breadboard-free.jpg_640x640.jpg [View same] [iqdb] [saucenao] [google]
1636749

>>1636727

Have you tried vero board (aka strip board)? I hate using the type you have, but I love vero board. They make some software to help lay it out, but I just do it in GIMP, and once you have a good layout, sometimes there are very few wires left to solder.

>> No.1636753

>>1636749
>They make some software to help lay it out,
what do you mean by that?

>> No.1636763
File: 179 KB, 805x384, board.jpg [View same] [iqdb] [saucenao] [google]
1636763

>>1636749
Get uninsulated tinned copper wire and you can just lay down your own traces through the dots.
It's way more flexible than strip boards and not much more work.

>> No.1636773
File: 59 KB, 731x451, Screenshot_2019-06-25_17-02-57.png [View same] [iqdb] [saucenao] [google]
1636773

>>1636753

When using that type of board, you usually have to cut some traces and add some jumpers. Optimized layout can make a huge difference in the number of each, and a nice program that allows you to drag components around while it updates those would be a godsend, and I believe the programs exist. But I'm an old-fashioned linux nerd so I use GIMP and do it the hard way, but it's still fun when everything falls into place.

In this pic, all the vertical lines are traces on the board. The orange horizontal lines are cut traces. The only jumper wires are the horizontal non-orange lines.

Something like adding a female header to the side of an integrated circuit or somethng like an arduino nano is extremely easy; you cut some traces but otherwise you just solder the chip and headers and they are linked.

>> No.1636774

>>1636763
>It's way more flexible than strip boards and not much more work.

I'm not going to argue with you. If that works for you and you like it, then that's great, but I've tried it and I just can't work the solder, and all those jumper wires are a pain for me as well. It's very subjective, and I'm not saying stripboard is better, it just works better for me.

>> No.1636775

>>1636774
>and all those jumper wires
It actually requires less jumper wires than a strip board.

>> No.1636776

>>1636774
>I just can't work the solder

Oops. I thought your image had some of those connections where they use cold solder and connect dots with nothing but a huge blob of solder. You appear to have the uninsulated wire, which is how I do it when I use that type board.

>> No.1636779

>>1636775
>It actually requires less jumper wires than a strip board.

Maybe we use the term jumper differently. That image has both horizontal and vertical jumpers. In general, strip board does not require one or the other, depending on how you orient the board. Like I said, I don't want to argue this, as I think it's a matter of taste. If you insist that strip board makes you use more jumpers, then fine, I'll let it go.

>> No.1636787

>>1636779
A jumper wire makes a point to point connection.

What you see on the image are traces, they're fundamentally different.

>> No.1636798

>>1636787

I see what you're saying now, and I agree that you could use fewer jumpers on that sort of board.

>> No.1637109

>>1636508
i will try it, bit i wonder if it will work, i am using the standard arduino wire library for the i2c and can you really set it to something silly like 5hz frequency?

>> No.1637110

>>1633182
>https://uk.rs-online.com/web/p/power-banks/7757508/
Unfortunately it looks like they don't ship to Burgerland, and the product apparently doesn't exist on their equivalent American site, americas.rsdelivers.com.
Got any other powerbank options for a Burger?

>> No.1637111

>>1636749
Looks interesting but i dunno, if you have to design a pcb to use it it kind of ebats the purpose since perf board is sued for rapid prototyping where you just slap shit on anywhere and connect it with wires
If you need to design actual traces you would be better just doing something like toner transfer and just etching a regular pcb
but that being said, they look like they could be great for smds since those are near impossible to use with normal perf boards

>> No.1637112

>>1637110
How about you buy two smaller ones and then build a simple circuit that switches power between them so one charges and one supplies power and then just ducttape them togetger

>> No.1637113

>>1637112
to make it super simple you can use dpdt relay and a cap if you need uninterrupted power

>> No.1637257

yay i managed to burn the stupid fuses without bricking the arduino
today is a good day

>> No.1637329
File: 183 KB, 546x875, 1554079948702.png [View same] [iqdb] [saucenao] [google]
1637329

>>1636470
>costs over a buck
>for 5
costanza.jpeg

>> No.1637369

>>1636728
>shit i have to stop breathing in all that solder vapor
That shit is no joke, former coworker was doing mad reflows on Xbox's (10+ a day) a few years back, loads of flux, loads of smoke, he started coughing blood, then he told the boss "buy me a weller fume extractor or the shop's closed". I do like our weller fume extractor :D

>> No.1637380

>>1637369
obviously made up story
the boss would fire him on the spot and hire a pajeet for half the money who would happily breath in those tasty fumes in exchange for that work visa

>> No.1637496

>>1637380
We're a small business composed entirely of white conservatives, only one of the crew is female, and we have a "second amendment haven" sign on the front door. So no, we have no poo-in-the-loos. Our customers, on the other hand... oy vey.

>> No.1637501

>>1637496
you have to go back

>> No.1637769

if you set a pin to just INPUT on arduino, it means there is no voltage on it at all right? so it is safe to connect this pin to say another ic that is only 3.3v tolerant

>> No.1637771

>>1637769

disable the pullup

>> No.1637774

>>1637771
there is no pull up in the first place unless you use INPUT_PULLUP

>> No.1637850

>>1636226
if you insist on using I2C over distance, this NXP application note https://www.nxp.com/docs/en/application-note/AN10364.pdf explains the considerations and mitigations quite well

>> No.1637872

>>1637850
10/10 reading comprehension there son
He says he isn't using i2c because of the distance

>> No.1637877 [DELETED] 

>>1637872
more like a writing comprehension problem before VTEC coffee kicked in

>> No.1637878

>>1637872
more like a writing comprehension problem before VTEC coffee kicked in. I should have instead wrote "I2C or other logic-level multidrop protocols"

>> No.1638358

How come arduino ide doesn't have built in support for attiny? i thought they were official arduino chips

>> No.1638359

>>1638358
>i thought they were official arduino chips

arduino is a circuit board that has an AVR processor. Many of them use the 328P AVR. There are many AVRs, including the attiny. If you want to develop for AVRs like the attiny there are other development platforms.

>> No.1638364

>>1638359
There is third-party support for attinys.
But it will limit you a lot more since they have little memory and Arduino has a lot of overhead.

>> No.1638366

>>1638359
I see. So it's the avr that matters. The problem is that i tried to use arduino ide for other chips that are not avr and sometimes you get random crashes and shit like that since you need some 3rd party library to convert the arduino avr thing into that other chip architecture thing

>> No.1638534

>>1638358
It does? I use uno as a programmer for my attiny85.

>> No.1638698

>>1638358
no official boards with ATtinyx5 on them, afaik. maybe Digispark has put time and effort into supporting them under the arduino IDE. not that any sane person wants to deal with the overhead of C++ on an 8-pin micro

>> No.1638747

>>1623482
Its been a while since I used arudrino with processing. Can you tell me what processing prints out if anything. Also can you post a pic of your circuit I can try and build a copy and see if I can help you out.

>> No.1638754

>>1623482
Was there point when you were able to communicate with the ardurino early on when you were making this. Do you have any back ups.

>> No.1638803

>>1638698
>Digispark
What is even the purpose of this?
The whole point of the attiny is to be a tiny barebones chip and instead they give you a whole board that takes up space with usb connector on it which you use only once to upload the sketch and then you have several problems you have to deal with too that that bare attiny's don't have such as hardwired power led that cannot be disabled and will kill any battery power fast for no reason, or pull ups on two pins used for usb communication, so any circuit you make has to work around them
digisparks are kind of useless gimmick in my opinion, if you want digispark you are better off with the mini pro isntead

>> No.1638811

>>1638803
>which you use only once to upload the sketch
It supports USB serial and HID.
So you can make a simple USB device out of it.

>> No.1638839

>>1638811
I stand corrected then, it still makes it useless for typical fartduino projects, but is very cool if you need your crappy servo robot to communicate with your computer, or want to make a bad usb to get them nudes from your friend's computer

>> No.1638852

the attiny 85 actually has 8 kibibytes of memory and not 8 kilobytes
i thought it was a typo but they kept repeating it, holy shit, i work with this shit constantly and this is the first time in my life i heard the word kibi

>> No.1638859

>>1638852

not sure if trolling or retarded, but it's kilobytes:


The ATtiny25/45/85 provides the following features: 4/8K bytes of In-System Programmable Flash, 128/256/512 bytes EPROM, 128/256/256 bytes SRAM...

>> No.1638860

>>1638859
How embarrassing for you.
No it's kibibytes, google it.

>> No.1638861

>>1638859
technically uppercase K is not "kilo"

>> No.1638863

>>1638860
>>1638861

whatever you retards are saying, the 85 has 8 x 1024 bytes, and that's a fact. enjoy your retardation or trollfest, same thing anyway.

>> No.1638866

>>1638863
>1024
that's what kibi is
kilo is 1000

>> No.1638867

>>1638863
It's not the same thing you damn brainlet
https://www.google.com/search?client=firefox-b-d&q=1+KB+to+byte
https://www.google.com/search?client=firefox-b-d&ei=M08XXeHMLoTOwALJ8bjQDg&q=1kibibyte+to+byte

>> No.1638868

>>1638867
This. When someone applies for a job at my place of work, the first thing I ask him is "How many bytes does a Kilobyte have?" and if they say 1024 I throw them out instantly.
And we are a fast food company.

>> No.1638869

>>1638866
>>1638867

while you autistic spergloards may be correct in some ridiculous technical sense, no normal person has trouble with kilobyte meaning 1024 and kilometer meaning 1000.

have sex.

>> No.1638870

>>1638868
doing god's work

>> No.1638872

>>1638866
>>1638867

wikipedia says you are full of shit:

The kilobyte has traditionally been used to refer to 1024 bytes (210 B), a usage still common.[5][6][7] The usage of the metric prefix kilo for binary multiples arose as a convenience, because 1024 is approximately 1000.[8]


The binary meaning of the kilobyte for 1024 bytes typically uses the symbol KB, with an uppercase letter K. The B is often omitted in informal use. For example, a processor with 65,536 bytes of cache memory might be said to have "64 K" of cache. In this convention, one thousand and twenty-four kilobytes (1024 KB) is equal to one megabyte (1 MB), where 1 MB is 10242 bytes.

>> No.1638874

>>1638872
>wikipedia
Yes, as you can see yourself, there is clearly a price to pay when you let any common peasant edit your encyclopedia. It will be shit.

>> No.1638891

I am having some problems with interrupts.
If i understand it correctly the ISR(INT0_vect){}
executes only when the pin changes state like from high to low or vice versa right?
So to make sure the interrupt pin isn't floating when i'm not using it, i connected it directly to ground to keep it in LOW state and therefore the ISR function should not be executing at all.
But instead it seems to be blocking my loop() code
What is going on here?
I am not using attachInterrupt, but rather the ISR(INT0_vect){} directly.
I am also using no libraries or other shit so nothing else is using the interrupt.

>> No.1638892

>>1638891
>I am not using attachInterrupt, but rather the ISR(INT0_vect){} directly.

how can you use the interrupt "directly" if it is not enabled?

>> No.1638893

>>1638892
I enabled it by setting the bits in the register

>> No.1638897

>>1638891
nevermind i figured it out, turns out that pulling interrupt to ground causes it to fire constantly, if don't want it to do anything you have to pull it high

>> No.1638901

>>1638893

You have to also put the JMP instruction at the correct address to execute your routine.

In other words, in my opinion, you should either use arduino or assembly for things like interrupts. I'm sure it can be done, but probably not easily. Maybe someone else can help here.

>> No.1638902

>>1638901
The problem wasn't it not executing, the problem was it was executing all the time, but I figured it out above.
It's not like i'm choosing to not use the attach interrupt because it makes me cool, but rather because the chip i am using doesn't work with it so i have to fuck around with the registers directly.
But it is working now so i am going to go and have a celebratory fap.

>> No.1638993

>>1638698
>my limited imagination defines the continuum of legitimacy
>>>/pol/

>>1638859
>using short kilobytes in year 0x7E3
>>>/sci/

>>1638874
>being this 14
>>>/a/

>> No.1639062

I can't keep track of all the registers and bits I have to enable and write in order to do something as simple as making a pin to work in ADC mode. I also keep fucking up bitwise operations and C dereferencing. How do you guys do it?

>> No.1639088
File: 171 KB, 1062x1375, 1546976755938.png [View same] [iqdb] [saucenao] [google]
1639088

>>1639062
good full datasheets include a detailed register summary at the end of each chapter, Pic related, from my post-acquisition copy of the ATmega8A user manual. good full datasheets also include block diagrams of the peripheral in question, annotated with register bit names, which may be defined in header files for you to use, once you know which register they're in. use either or both as a checklist and browse back to the text whenever in doubt. dependencies are usually spelled out for you so you can know what you must set up and what you can skip. you'll get better with practice and start to develop a broad understanding of the interfaces and features these peripherals typically present to you
another protip: use your PDF reader's find function often

>> No.1639094

>>1639088
wait, did microchip fuck with the datasheets of atmel chips?

>> No.1639097

>>1639094
They bought Atmel a few years ago

>> No.1639328

If you have arduino with 16Mhz clock, it can execute 16 mil intructions per second. Easy. But what the fuck is the clock divider for? like you can select say 8 clock divider and then you only have 2 mil instructions per second? why would anyone want that? i don't understand

>> No.1639345

>>1639328
there is lower current draw at slower speeds and you can run an atmega328 at 1.8 volts when you get it down to 4mhz
however, if you don't need to have the arduino running all the time, using sleep modes would probably have better power savings even at high frequencies

>> No.1639387

If i want to make a finished product from boards with pins what is the best way to package them?
Basically say you have ESP01 and arduino uno, you wire wrap the pins to connect them, add a cap or two, and now you have a bunch of wires with stuff loosely handing from them. One solution would be to turn it into an epoxy ball, but that is kind of shit if you want to retain some serviceability

>> No.1639462

>>1639387
>If i want to make a finished product from boards with pins
>finished product
>boards with pins
intredasting
skip the wire wrap, which will be unreliable without pins designed for wire wrapping (size, hardness, 4 sharp corners)
instead use dotboard, solder pin headers/sockets as appropriate to mate with the prefab boards, and bodge wire to connect the headers and other components together
or get some "Dupont" crimp terminals and housings and some insulated wire, and build a wiring harness
or if neatness really counts, why didn't you just (((buy a shield)))

>> No.1639479

>>1639462
>boards with pins
i sure as fuck won't be ordering bare chips and soldering millions of components by hand when i can buy all parts with all functionality i need as finished boards for cents where i only connect the pins and am done
also i use wire wrap for all my shit and it is reliable as fuck, unless i very strongly pull on the wire in vertical direction multiple times it will not move or come loose, i guess i could use female headers and kind of snap the parts together like lego and then hotglue it into the enclosure so it isn't rattling apart, which will be good enough.

>> No.1639480

>>1639479
Uno + ESP01 is a combination with lots of overhead though.

Why not get a ESP12 and do everything with the ESP8266?
Or the ESP13 which has an integrated STM8 MCU?

Then just get some cheap pcbs made where you can solder the whole module on it and whatever else you need.

>> No.1639491

>>1639480
That was just an example i am using a bunch of different parts, single board solution simply isn't an option plus it's really cool when i can make bunch of products very fast without any soldering basically. Makes me feel like a top productivity assembly line chink

>> No.1639495

>>1639491
>snapping a bunch of crap together and calling it a """product""" feels good
you know what feels even better than that? gitting gud

>> No.1639500

>>1639495
And how much dosh have YOU accumulated by selling glorified arduinos to pleb normies at several times the price?
Yeah... i thought so.

>> No.1639502
File: 13 KB, 255x248, 1538302572271.jpg [View same] [iqdb] [saucenao] [google]
1639502

>>1639500
you have to go back, good goy

>> No.1640323

Alright so I want to make one of those cool drawing machines for the nintendo switch. I understand the concept and everything and have read over
https://github.com/shinyquagsire23/Switch-Fightstick
for a few days. The only issue is the microcontroller being used. I do not have any of the lufa compatible microcontrollers needed to use this library (teensy 2.0, GENUINE arduino uno r3, or arduino micro).
So I would like to use this library on a trinket m0 and/or stm32f1 (blue pill). There is this
https://github.com/dmitrystu/libusb_stm32
for the stm32 but I dont know much usbhid to compare them. Also how likely would lufa be to work with the trinket since it is an atmel chip.

>> No.1640432
File: 15 KB, 644x800, d90[1].png [View same] [iqdb] [saucenao] [google]
1640432

>>1640323
>nintendo switch

>> No.1640500

>>1640323
porting from one architecture to another is straightforward but non-trivial. you would need to have read both MCUs' user manuals and also the user manuals for both USB APIs, and will probably need to have read the USB-IF's HID class specification at some point along the way, and then understand the project code
fuggedaboutit

>> No.1640507

>>1640500
There are USB libs for both processors. Ive been staring at the code all night and it doesnt seem too hard. I just need a really good example of how to use a custom stm32 usb hid since I dont really understand that interface.

>> No.1640510

>>1640507
this goes over a simple USB HID project using a bluepill (and libopenCM3):
https://satoshinm.github.io/blog/171227_stm32hid_pill_duck_scriptable_usb_hid_device_using_an_stm32_blue_pill_from_mouse_jigglers_to_rubber_duckies.html

>> No.1640684

>>1640510
>https://satoshinm.github.io/blog/171227_stm32hid_pill_duck_scriptable_usb_hid_device_using_an_stm32_blue_pill_from_mouse_jigglers_to_rubber_duckies.html
Thats a read. Ill plow through it to properly understand how HIDs works. I found
https://github.com/dmitrystu/libusb_stm32
though and Im going to try and it looks to be able to use and modify custom hid stuff in the in the main loop. Cant find my trinket m0 so Im going to try the blue pill first.
Also ordered a leonardo in case I cant get either to work no matter what.

>> No.1640710

>>1621855
Does the asian come with it, or?

>> No.1640815

How do I program a blue pill without the arduino ide? Like what ide does everyone use here or do you guys not care?

>> No.1640827

>>1640815
I use STM32CubeMX to generate a skeleton project with I/Os and stuff set up how I like it and a default Makefile. then I use a text editor to write my code. then make with arm-none-eabi-gcc. then upload with the st-link utils for linux. I've got TrueSTUDIO installed somewhere but I never use it

>> No.1640982

>>1640815
Remember that not using arduino ide for the stm32 is only free if your time has no value

>> No.1641164

>>1640982
>growing up has no value
sure kid

>> No.1642346

>>1621855
BATTERIES

What are some options for an onboard rechargeable battery to use inside a small enclosure of a small arduino project build?

in a small 8inLx4inWx2inD handheld enclosure box (to be portable, outdoor use powered off of an internal, removable, replaceable DC battery of some kind)

have arduino uno, several sensors , a display screen and a few switches, pots for selecting output and display options.

need a supply of 9v +/-
most of the sensors only need 5vdc +/-
I think the display (20x4 LCD) is what is consuming most of the power.

right now using little rechargeable 9vdc batteries and they only last a few hours, even when running two in parallel

>> No.1642349

>>1642346
LCDs shouldn't consume that much power unless you have the backlight on all the time.

>> No.1642350

>>1642346
Continued:

I am wondering if I could use something like the type of rechargable battery that is used in RC planes, drones, quad-coptors, etc

Or at least something with greater capacity than what I get out of these little 9v rechargeables

>> No.1642353

>>1642350
They use lipo batteries with especially high discharge currents.

Your project would also fit something like an 18650 or an replaceable cell phone lipo.

But they're only 4.2V fully charged. So you'd either need 3 in series or a boost module.

>> No.1642355
File: 146 KB, 756x567, 20x4disply.jpg [View same] [iqdb] [saucenao] [google]
1642355

>>1642349
>unless you have the backlight on all the time.
well, it is always on when I have the device powered up.. its one these (pic related)
I suppose I could modify the sketch to make it auto dim or something in between readings

>> No.1642700

>buy trash module from aliexpress
>can't figure out how to use it
>throw it into a drawer
>rinse and repeat

I'm gonna only buy from Adafruit and Sparkfun from now on. Fuck chinks.

>> No.1642704

>>1642700
most modules on Ali are clones of Adafruit/Sparkfun modules - just look at the documentation there

>> No.1643040

>>1642704
furthermore, most Sparkfun/Adafruit modules are little more than the reference designs lifted from the main device datasheet(s)

>> No.1643041

>>1642350
NiMH batteries aren't terrible and they're a lot easier to work with

>> No.1643047

speaking of, isn't the firmware on these st chink knockoffs supposed to be protected by ST? they're all over the place on ebay but adafruit too?
https://www.adafruit.com/product/2548

>> No.1643079
File: 12 KB, 350x350, Custom-AKMDS-2614-50pin-0-5mm-pitch.jpg_350x350[1].jpg [View same] [iqdb] [saucenao] [google]
1643079

Does anyone know where I can get a board/cable to put a right angle into an FPC/FFC cable?
I've seen FPC cables with elbows in them as part of other products before, but I can't seem to find any sites that sell such cables by themselves, though I'm getting plenty of results for straight cables.
I don't think I can just fold the straight cable 90 degrees because that'll invert the order of the pins and I'm pretty sure I need to not do that.

>> No.1643083

>>1642355
For the love of engineering, make your text wrap correctly

>> No.1643086

>>1642346
>>1642350
What do you have that needs 9v? Are you using a step-down regulator to drop the voltage from 9v to 5v for the uno and other stuff?

It would be easier to use a boost module and a single cell lithium based rechargeable battery to generate the 5v.

>> No.1643101
File: 200 KB, 720x470, 1558614137642.jpg [View same] [iqdb] [saucenao] [google]
1643101

>>1643047
ada's has the ST logo trademark on it for $12.50 (for one, not ten). compare to the cost of STM discovery boards and see there's money to be had in the channel for all. limor may be a ferengi but she scrupulously follows the rules of acquisition

>>1643079
Pic related, type A and B are usual on ali

>> No.1643215

>>1643083
i was testing the cursor placement instructions
i'm a noob and it took me some fiddling around to figure out the format

>> No.1643217

>>1643086
actually i guess all I really need is 3 to 5vdc to power the arduino, the display screen and the onboard sensors
i dont know why i started using 9v batts thinking they would have more capacity and longer run time

>> No.1643367

How do you debug an avr. I cant get the code work with an i2c connection and I have no idea where to go now. No serial monitor because Im not using the arduino library. I am using an arduino leonardo though.

>> No.1643368

probe your signal lines i guess

>> No.1643371

>>1643367
a putchar() routine should be pretty easy if you're cool with spin-waiting on the UART buffer, no? just hardcode 1Mbps or whatever and make your savorite serial dongle follow suit
or you might try a logic analyzer. Bus Pirate is jack of all protocols but not super performant. still, it's relatively cheap and stocked in various Western countries for immediate shipment

>> No.1643380
File: 49 KB, 993x215, sigrok_i2c.png [View same] [iqdb] [saucenao] [google]
1643380

>>1643367
>I cant get the code work with an i2c c

Do you have actual pull-up resistors? Are you using the correct address? Some places list the 7 bit form while others list the 8 bit form. Some libraries require the 7 bit form while others require the 8 bit form.

As far as debugging without serial, you can do a lot with a 2x16 or 4x20 LCD.

And like the other guy said, a logic analyzer. The 10 dollar Salae knock-off is amazing once you learn how to setup Pulseview.

>> No.1643384

>>1643367
>not using the arduino library
ya dun goofd

>> No.1643433

>>1643380
I kinda found out what is happening. Ive been making the led cut on randomly in the code after found that its freezing somewhere at the i2c start functions. I havent gone into the lib yet but ive had this happen when using the arduino lib when the connection wasnt there at the setup.
Im going to check with the arduino library if it works so ill know my connection is fine, and if it does ill keep playing with the led.
An lcd looks really useful so I might grab one just to have for multiple purposes.

>> No.1643588

>>1623821
>>1623823
>>1623824

Look mate we can all Google no need to shill so fucking hard.

>> No.1643610

>>1643101
>type A and B are usual on ali
Right, but I'm not sure that helps me. Type B would allow me to fold it 90 degrees and have the pins on both ends on the same side, but the pin order would be inverted relative to a straight type A cable; the outermost pin on one end would become the innermost pin on the other end, assuming the boards on either end remained un-flipped. Are FPC cables reversible? I had assumed since the pins in mine didn't look symmetrical that simply flipping the board on one end over and plugging it back in wouldn't work, and I was reluctant to try for fear of damaging something.

>> No.1643627
File: 31 KB, 477x458, 1535698186615.png [View same] [iqdb] [saucenao] [google]
1643627

>>1643610

>> No.1643641
File: 58 KB, 1080x1080, e0a[1].jpg [View same] [iqdb] [saucenao] [google]
1643641

>>1643627
I didn't even think of just folding the cable a different way.
Thanks, anon.

>> No.1643739

>>1643217
9V are pointless unless you are looking to save some space, because they don't have a large capacity.
Go with what I said earlier - Single cell Li-ion and a booster board to get the 5v. It'll make your life much easier.

>> No.1643757

>>1643739
ok I'll give that a try. thanks

>> No.1643875

So i have two ICs, one 3V one 5V. I have a 5V battery.
I wonder what the best way to connect the 3V ic would be.
As the battery gets drained it will slowly drop to 3V, so i cannot use lienar regulator since it stops working properly when the voltage falls under like 4.2V, even low dropout ones still drop like 0.5V
So what now?

>> No.1643890
File: 95 KB, 1000x1000, 1538963860762.jpg [View same] [iqdb] [saucenao] [google]
1643890

>>1643875
buck-boost converter similar to Pic related, this one might be inefficient at the sorts of loads that a single IC would generally draw
>5V battery
cool story bro

>> No.1643894

>>1643890
If i remember it correctly, bucks also need the input to be like 1V higher than output, so that presents the same problem basically

>> No.1643895

>>1643890
>cool story bro
you do realize you can put batteries in series right?

>> No.1643900

>>1643875
How much current does the IC draw?
You can get LDOs that only drop much less at low currents.

>> No.1643902

>>1643900
20 - 500ma

>> No.1643911
File: 114 KB, 1000x812, 1537237043756.jpg [View same] [iqdb] [saucenao] [google]
1643911

>>1643894
buck-*boost*. see also the SEPIC topology, basic walkthrough at http://www.ti.com/lit/an/slyt309/slyt309.pdf , more details at http://www.ti.com/lit/an/snva168e/snva168e.pdf

>>1643895
absolutely. I also realize that there isn't a combination of common batteries that adds up to 5V and not over 5.25V, and that discharge curves vary widely acorss the universe of battery technologies, not one of which comes to mind as still delivering useful power at 60% of their rated voltage without bleeding all over the battery compartment

>> No.1643929

>>1643911
Well it's not EXACTLY 5, it's 3* 1.5V nimh D cells, but that doesn't change anything really.
According to the thicc curvers for nimh, at 3V i should be just about bottoming out the batteries and it will be time replace them. The 3V ic can tolerate 2.9 - 3.5V, so depending on the charge of the batteries i have to drop anything bewteen 0V to 1.4V (since fully charged D will have more than 1.5)


I will have a look at the buck boost converter.
Efficiency doesn't matter that much , the 3V ic will only run for about one minute per day

>> No.1643934

>>1643929
>3* 1.5V nimh D cells
>1.5V
>nimh
you sure they aren't 1.2V?
>only run for about one minute per day
there's the matter of quiescent current, which is drawn whenever 3V is output, whether your 3V IC is awake or not. check datasheets! most easy-switcher converter ICs have an enable input, as do a few low-current linear regs. SEPICs are one of the types of converters that can truly disconnect the load

>> No.1643942

>>1643934
>there's the matter of quiescent current,
no this one, the IC will be connected in a way where both it and the buck will be cut off from power completely via fet when not in use

>> No.1643979

when something like a pi zero burns out, what is it exactly that burns out that prevents it from working?

>> No.1643981

>>1643979
Depends on what you mean with "burn out".
If you do something stupid with your GPIOs, it's most likely the SoC that gets fucked.
If something happens in the 5v power rail than it's likely that a fuse or regulator got fucked.

>> No.1644015

>>1643981
why do they even bother with fuses?
people can't replace them because they are so tiny plus people just think they fried the board and toss it anyway

>> No.1644018

>>1644015
Because fuses are designed to fail in a safe manner?

>> No.1644281

>>1644015
so whatever's failed in a blaze of glory doesn't keep burning continuously and potentially create knock-on faults e.g. in the wire

>> No.1644997

What are some simple starting projects that can be turned into a finished product? I mean, something you can take out of the breadboard, solder into a board and actually use it as a finished device.

>> No.1645011
File: 150 KB, 1920x1080, do you feel lucky... punk?.png [View same] [iqdb] [saucenao] [google]
1645011

>>1644997
obvious basic factors begin with what kinds of things you might want to use, how much time/money you want to put into it, your desire to design and fabricate (or have someone fabricate) a pc board, your desire to program, your current level of soldering skill and equipment, ...
it is worth noting that total microcontroller tooling entry cost in real dollars has decreased by 5-6 orders of magnitude over the past 40 years, and it's almost inexcusable not to have a USBasp around. there's no shame in burning someone else's hexfile for their desk/wall clock project to a chip and more or less building their schematic. it's how the hobby was practiced 50 years ago, except we have a few common microcontrollers now instead of application-specific or hand-built, narrowly-configurable NMOS ICs, and compilers are free

>> No.1645145

>>1644997
Most electronic devices are readily available in a finished product form. Anything you make will be inferior.

That said, a POV display/clock is quite easy to make and looks nice.

>> No.1645253

If i have in arduino a local variable like

while(1)
{
char poop[100];
strcpy(poop, "pee");
}

Do i have to manually delete poop later, or does it happen automatically?
As in, will the variable be automatically cleared or will the ram fill up and cause a crash?

>> No.1645259

>>1645253
poop only exists within {} so it is destroyed at the end of every loop

>> No.1645301

>>1623482
Sounds like you are stuck receiving shit. Too tired to decode unindented arduino style shit, but check your serial loop or whatever.

>> No.1646138

>>1632680
The Pi hs a proprietary bootloader blob which also serves as the GPU firmware.

>> No.1646154

>>1645011
sounds dumb, im rolling

>> No.1646204

>Raspberry pi 4
>Your tiny, dual-display, desktop computer
>…and robot brains, smart home hub, media centre, networked AI core, factory controller, and much more
Suggesting it can be used as a factory controller just bugs me. It has a poor temperature range, none the board or gpio are especially EMI/EMC hardened and the processor clocking isn't deterministic like actual microcontrollers for fine grained realtime control.

>> No.1646206

>>1645145
Seconding this.
Bob Blick was the first guy afaik to make a POV LED clock in maybe the late 90s or early 2000s, and indeed that is the first microcontroller project I built.

>> No.1646219
File: 3.58 MB, 2304x4608, IMG_20190712_123723.jpg [View same] [iqdb] [saucenao] [google]
1646219

Retarduino nooblet here in need of some spoonfeeding. I've successfully setup the ard (top) to transmit sensor data via LoRa, but I'm trying to receive that data on my rpi (bot), which will then send that data via an adafruit SIM adapter to my personal website. Any videos I've seen for this are useless or outdated. I don't want to fuck with TTN, pls no bully

>> No.1646237

>>1646204
It can work as the heart of a system, but while running Raspbian, its limited and will need a lot of support hardware.

If you're brave enough, you can program it bare-metal, which solves the GPIO timing issues, but you'll have to do everything from scratch.

>> No.1646528
File: 34 KB, 474x326, 1543575909909.jpg [View same] [iqdb] [saucenao] [google]
1646528

>>1646237
not entirely from scratch. the raspberry pi radio transmitter is a low example of the art. https://blog.erratasec.com/2013/02/custom-stack-it-goes-to-11.html is a high example of the art. in between, there are the real-time schedulers built-in to the kernel, loadable cpu throttling policies, interrupt pinning, task pinning, mmap'ing /proc/kmem, and the good old write your own driver if you really need to catch interrupts or microseconds
you're right on reliability. I still wouldn't have one running my house, never mind my rape cave/meth lab in the forest

>> No.1646530

>>1646528
>the future of field buses.jpg

>> No.1646730

>>1646528

Linux(Unix) has come a long way. I'm an EE and loved running linux on everything, but as an OS, it can't do real-time I/O - save that for a microcontroller.
I've recently dived back into the Embedded linux world with the huge advancement It has made recently.
Any resources I could look into?

>> No.1646961

>>1646730
sure. "real-time" is relative and "can" is orthogonal to "should", of course. otoh some Allen-Bradley(?) PLCs run Ubuntu, so should be plenty good enough for SCADA. go figure
embedded Linux on large micros: Armbian seems to be tending well to ARM-based set-top-boxes and related SoCs and dev boards, with a neat, automated image build system. excellent choice for e.g. kiosks
embedded Linux on small micros with MMU: OpenWRT merged with a less network-centric embedded project a while back and the result is LEDE
embedded Linux on small micros with no MMU: no-MMU support is now mainstreamed in the kernel. I've not yet played with it though, not having a suitable micro to hand
general: other than manufacturers and their BSPs and documentation, if you git gud on the raspi, you can get the general lay of embedded land. particularly, the fundamental stuff like device trees (and their overlays, and run-time loading and unloading of them) and the /sys hierarchy, where some devices (like /sys/class/gpio) are managed and controlled. hope you like routing SDRAM :^)

>> No.1647229

is there any way to send data to a slave in i2c with Wire and wait for a reply?
The problem is that sending shit to a slave and requesting shit from him are two separate calls and when i send shit to the slave i don't know how long should i wait before requesting the results, since the time it takes the slave to complete it is random, plus i have no idea if the slave restarted while i waited and thus if the data hes sending me are in response to the particular data i gave him

>> No.1647449

>>1647229
couldn't you return a wait flag until the slave process is complete, and return a real answer when it is? also, I don't know shit about the limitations of the Wire library, but some I2C devices like temperature sensors are set up to just not ACK their address while they're busy

>> No.1647566

>>1646730
>Linux(Unix)
Linux
Is
Not
UniX.
It's a common misconception among beginners due to the constant shilling of Linux zealots.

>> No.1647601

>>1647566
nice recursive backronym, but it was named after himself, just like his other project git