[ 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: 47 KB, 740x417, pimoroni.jpg [View same] [iqdb] [saucenao] [google]
2534035 No.2534035 [Reply] [Original]

Previous thread:>>2516795

Here we discuss microcontrollers, SBCs and microcontroller accessories, such as Atmel mega and tiny AVRs (Arduinos), PICs, ARM boards such as blue/black pill STM32, ESP8266/32s, RP2040, Raspberry Pi, and others.

For general electronics questions (power supplies, level shifting, motor driving, etc.) please ask /ohm/.

>where can I find verified quality microcontrollers and other electronic sensors or parts
digikey.com
mouser.com
arrow.com
newark.com

>but that's too expensive
aliexpress.com (many parts here are fake, particularly specific parts out of stock in the above sites)
lcsc.com

>I need a part that does X and Y, with Z specifications. How can I find it?
use digikey or mouser's parametric part search. Then purchase from one of the sellers listed above.

>how do I get started with microcontrollers, where should I start?
There is no defined starting point, grab a book and start reading or buy an arduino off ebay/amazon and start messing around. There are a plethora of examples online to get started.

>resources:
https://github.com/kitspace/awesome-electronics

>> No.2534069
File: 242 KB, 1079x548, SmartSelect_20230102_111708_WhatsAppBusiness.jpg [View same] [iqdb] [saucenao] [google]
2534069

Hey all, I'm trying to create a power latching circuit that uses a single button but also uses that same button as input.

I've made pic related but would like to have smarter people then me look at it to see if I made any issues before having this made on a PCB.

The switch is a momentary NO-switch that pulls to GND when pushed

>> No.2534071

>>2534069
>naked transistors
that's an /ohm/ question

>> No.2534080

No tractor thresd

>> No.2534151

After one of your resident autists politely informed me that a thread recently made would be better suited here, im just gonna copy and paste the header:

So, I found this guys video showcasing his modded macro pad that he turned wireless, and was hoping to make my own using the kit that you can purchase online, but not sure how to actually make it wireless.

Wanted to contact the author about how he went about doing this, but he disabled comments.
Any advice? I'm atleast aware that this i will need soldering tools and a power bank
[YouTube] BDN9 macropad clip studio paint. (embed)

>> No.2534152

>>2534151
fucked up the link lmfao
https://www.youtube.com/watch?v=8CSMlr8U5AI

>> No.2534214

>>2534035
What is the cheapest way to communicate wirelessly, when a switch triggers? I have a few shelves, which have a simple button mounted, which activates an LED. I'd like to communicate the pressed switch to my desktop pc. My ideas so far

>ESP32/8266 via Wifi
one esp at the switch, one esp at the desktop
switch esp: simple digital input, when pressed, send tcp message to desktop esp
desktop esp: get data and translate to visualization
negative: they got expensive. Cheapest I could find is 3€/esp (non-ali or taobao). Even bulk buying is not really worth it. 72€ for 25 ESPs

>NRF24L01 via rf
Seemed promissing, there is even a tcp-tramsission called nerfnet.
The question for me is: Can I use the NRF without any additional microcontroller and just send a '1', when the switch triggers? From what I saw so far, there always needs to be a microcontroller for the SPI-bus communication. Do I really need it?

>> No.2534239

>>2534069
Use a pmic with on button passthrough.

>> No.2534263

>>2534214
if you have line of sight. infrared
id you dont. bluetooth beacon/advertising packets (if comms is uni-directional)

>> No.2534276

>>2534263
Yeah, bluetooth seems to be another possible solution. Funnily enough, I came across this video: https://www.youtube.com/watch?v=w7TURoGE7To
So it seems to be extremely compact as well. Though the shelves aren't in the same room, and bluetooth is not the most reliable in my experience from bluetooth headsets.
As you mentioned uni-directional comms specifically, is there any problem with bi-direcional?

>> No.2534396

>>2534151
>>2534152
Take a look at bluetooth keyboard conversions, maybe ask at /g/mkg/. You'd need to reprogram the main USB MCU to instead take and send information to a bluetooth SoC.

>>2534214
50c 433MHz modules from alibay is the cheapest by far.

>> No.2534403

>>2534396
thanks ill ask them as well

>> No.2534494

>>2534276
beaconing is way easier to set up and use if your system is uni directional. also it means you dont have to pair the devices at all. bluetooth 5.x devices also have a massive range compared to bluetooth 4. 10m versus 100m range easily

>> No.2534511

>>2534035
Retard here with programming knowledge. I'm thinking of getting an Arduino to mess around and see if I'll like this as a hobby. How much of EE would I need to know to prevent making a dumb mistake and frying my components? Would the "Getting started with Arduino " books teach enough EE to get by? Or am I overthinking things and should just start and learn as I go?

>> No.2534514

>>2534276
Fuck me. I gotta return to this hobby this is fucking fantastic.

>> No.2534515

>>2534511
>making a dumb mistake

roughly speaking, around half of the clueless software guys who ''experiment'' with hardware end up in the cemetery or the ICU.
maybe you'll be in the lucky half.

>> No.2534518

>>2534515
As long as you don't try to mes with mains power (like the guy who wanted to replace a mains switch with a relay and didn't understand the wiring), you're safe.

>>2534511
Arduinos are cheap, so fry them. Maybe guides from /ohm/ are better to learn about electronics.

>> No.2534520
File: 352 KB, 1142x513, Screenshot_2023-01-02_18-03-15.png [View same] [iqdb] [saucenao] [google]
2534520

>>2534515
>around half of the clueless software guys who ''experiment'' with hardware end up in the cemetery or the ICU.

Uh, "half" of the idiots who mess with Arduino are not injured in any way by the 9-12 volt supply, or USB voltage levels, or GPIO. Or were you making le funy joke.

On the other hand, that guy might consider buying inexpensive knockoffs so he can have a bunch of spares for the occasional dumb mistake. pic related if in a hurry, or far cheaper (like a dollar or two each) if he can wait a few weeks for aliexpress.

>> No.2534525

I'm a software retard, but I never fried anything. Not even any of these hundreds of dollar worth dev boards we're using.
Did you fry anything of note?

>> No.2534531

>thought I could use the esp32s3's simd instructions to speed up my cv project
>turns out it's mostly for dsp and a shit ton of functionality is missing
how the fuck do you not include unsigned min and max in your instruction set, jesus fucking christ

>> No.2534535

>>2534531
>mostly for dsp
But isn't what you do and need for DSP?

>> No.2534545

>>2534518
>>2534520
I think I'm going to get the "Make Your UNO soldering kit" off the Arduino site as a start and look into the resources at /ohm/ to learn more about electronics when I go off and make my own projects. Thanks for the help.

>> No.2534563

I want to learn a new language this year.
I mostly do embedded.
Besides C /C++(which i Know)
What other langs are used in embedded?

>> No.2534592

>>2534563
>What other langs

unless you're doing assembler, you're just a *posing* as an embed developer.

>> No.2534606

>>2534525
I accidentally crunched a 480 volt 3 phase motor controller at work hahaha.

>> No.2534638

>>2534525
Killed three $1 microcontrollers on my custom boards from stupid mistakes in the last month or two. Desoldering and resoldering them was a pain, but at least they were only SOICs. In my defence the latest one was due to a chinky AMS1117.

>>2534531
Shoulda used an ARM chip. Maybe the RP2040 has the right instructions? Most of the higher end STM32s look out of stock unfortunately.

>> No.2534640

>>2534638
Doesn't look like RP2040 has Neon support.

>> No.2534719

>>2534592
kek. okay mate

>> No.2534770
File: 81 KB, 865x500, penislogiccumtroller.jpg [View same] [iqdb] [saucenao] [google]
2534770

>>2534592
Anyone who works with speeds measured in MHz is just posing as an embed developer.

>> No.2534850

>>2534770
I thought PLCs were for automation engineers

>> No.2534884

>>2534850
how do you think PLCs work? they use microcontrollers to run the system

>> No.2534942

>>2534884
what if they use ASICs though?

>> No.2534960

>>2534563
Learn Rust.

>> No.2534975

>>2534942
perhaps but every plc data sheet ive seen has a microcontroller unit inside it. usually an stm32

>> No.2535206

>>2534035
Just ordered 30 of these off Mouser. Not particularly good at surface mount soldering yet, but hoping to get good at it

>> No.2535272

>>2534035
Its possible to send command to an android phone like volume up and down, with and hc-05/hc-06??, I google it but I cant find a code or something

>> No.2535296

>>2535272
Transmit as a bluetooth keyboard, using volume commands through that like how some multimedia keyboards have.

>> No.2535427

>>2535206
smd soldering a pcb with castellated holes is about the next easiest thing to tht soldering. in fact probably easier because you dont have turn the pcb over and risk the part falling out

>> No.2535428

Can you 3D print PCBs?

>> No.2535431

>>2535428
No, as far as I can see there aren't any technologies that let you print both a strong insulator and a good conductor at the same time, not to mention be heat-resistant enough to solder on.
But you can use an MSLA resin printer to expose photomasks using UVtools. Bolting a laser to any old CNC machine like a 3D printer and ablating an etch resist also works, so does bolting a router to one to cut copper away directly.

>> No.2535772
File: 852 KB, 1308x1744, 1609410572913.jpg [View same] [iqdb] [saucenao] [google]
2535772

>>2535428
you can mill them down from copper clad board

>> No.2535879

>>2535428
Yes, either mill your PCBs in 2D then stack them or use additive layers, e.i. IC chips

>> No.2535891
File: 24 KB, 509x467, 1666476715439151.jpg [View same] [iqdb] [saucenao] [google]
2535891

I am normally pretty good with finding stuff online, but I can't find anything useful about the EXT port on a PS4 controller. I know the Back Button Attachment allows for inputs to be made through the EXT port. I want to make a custom attachment with an Arduino that I can make little macros for different games I play. I have the scripts done, but I have no fucking clue how to interface with the controller without hacking it up and soldering directly.

>> No.2535908

>>2535891
its proprietary. youd have to either talk with sony directly or find out who their manufacturer is and convince them to give you the part. good luck

>> No.2535951

>>2535891
Get yourself a logic analyser and a few different addons. You should be able to snoop the comms to figure out what commands to send. If you’re lucky it’s an existing protocol like SPI or UART. Surprised nobody has messed with it on hackaday or wherever though.

>> No.2536035

>>2534563
>What other langs are used in embedded?
lua is used quite a bit in conjunction with c

>> No.2536107

>>2534563
with microcontrollers there's micropython.
for embedded linux lot of scripting is done with python.

>> No.2536119

>>2534960
>rust
tranny begone

>> No.2536120

>>2534942
if they used an asic, that asic would essentially just be a custom microcontroller

>> No.2536169

>>2534525
I recently fried a motor control IC breakout from seeedstudio, still no idea why, the wiring, supply, example program etc were EXACTLY as described, i checked a dozen time even after it happened, never understood the reason

>> No.2536727

>>2536169
3.3V or 5V? Did it need a seperate gate drive voltage?

>> No.2536819

>>2536169
Maybe it came pre-fried.

>> No.2537236

>>2534525
>Did you fry anything of note?
I work at a very large/well known semiconductor company as a firmware dev.
I was playing with powering one of my dev boards (custom SiP micro) off of another board to reduce the power draw of my setup and forgot to shield the exposed pins on the connector that shorted together.
The IC refused to boot afterwards lmao. Devboard had to get binned.
Not the best thing to happen when silicon is so tight.

I also nearly fried one of our expensive FPGA prototype boards by putting 12v into the 5v barrel jack input (absolutely retarded that they power them like that), but luckily the board designers protected the input circuitry.

>> No.2537238

>>2534638
>>2534640
The v7-m has some SIMD through the VFP if you have one, but it's only 32 bits wide and kind of lame.
v8-m has 64-bit by comparison, but yhe NEON instructions are pretty much v7/8-a only, unfortunately.

>> No.2537254

>>2534563
gx works, tia portal

>> No.2537559
File: 519 KB, 773x463, file.png [View same] [iqdb] [saucenao] [google]
2537559

I'm looking at wifi-enabled devices to automate shit around the house, I already have set up home assistant and an MQTT broker so anything I build would go through that.
I used an old particle photon and a LED array screen to make it able to be updated remotely, I even converted it to use MQTT instead of the built-in particle cloud so I don't have to abide by their arbitrary limits and I can keep everything contained inside the home network.
Now I'm looking into getting more similar devices to automate other things around the house (planning to hack into the alarm system to allow turning it on and off through automations), but I want something different than particle stuff, something more mainstream, so I'm looking at these two boards:
>Arduino Nano RP2040
>Arduino MKR WiFi 1010
They look very similar to each other, about same price too, any ideas on if they are basically the same for my purposes or there's some subtle difference going on in there?
Also recommendations for other similar cheap boards?

>> No.2537596

>>2537559
why not a esp32?

>> No.2537597

>>2537559
The two boards you’ve mentioned are anything but cheap. A basic ESP8266 breakout with USB, like the Wemos ones, can be had for <$2 a piece. If all you’re doing is reading a sensor or a button press, anything more is a waste. For switching mains devices, Sonoff devices are cheaper (& safer) than building your own - flash them with whatever firmware you want.

>> No.2537598

>>2537596
because I've never used one and I'm used to arduino, can I do the same things these models can on that?
>>2537597
Very interesting, I suppose I'll look into it to see if it fits my purposes

>> No.2537600

>>2537598
>because I've never used one and I'm used to arduino, can I do the same things these models can on that?
yes, you can even use the arduino ide
go grab one and fuck around with it, cheap as

>> No.2537601

>>2537598
It behaves identically, you literally program it with the Arduino IDE.

>> No.2537606

>>2537600
>>2537601
>Arduino IDE
>a feature, not a bug

>> No.2537608

>>2537606
you can use the esp32 ide thing i heard its great or vscode
either way the esp shits on the arduino

>> No.2537610

>>2537606
Write the code in Notepad & upload it with avrdude if you want, nobody is forcing you to use the Arduino IDE.

>> No.2537611
File: 2.12 MB, 2200x1650, 20230107_175157.jpg [View same] [iqdb] [saucenao] [google]
2537611

>>2537601
>>2537600
Turns out I have two of these ESP8266 I got a long time ago and never figured out how to use, I'll try to use one of them to rig a quick and dirty movement sensor

>> No.2537613

>>2537610
>Write the code in Notepad & upload it with avrdude

still need an assembler

>> No.2537617

>>2537613
You can just copypaste a makefile for a avr-gcc, use VS Code, etc. Programming Arduino without using the IDE is a long solved problem.

>> No.2537618

>>2537613
just ask chatgpt to convert it for you

>> No.2537621

>>2537618
also chatgpt is great for writing sketches until it starts giving you commands for libraries that just don't exist

>> No.2537638

esp32 is amazing, cheap, powerful, has two kinds of build in wireless.. i think my only complain is it has no native usb so if i want to flash it or communicated with ot over cable i need an extra device to convert signals between usb<->uart
it's not hard to do of course, but it's annoying it doesn't have this built in

>> No.2537645
File: 2.94 MB, 4000x3000, 20230107_185708.jpg [View same] [iqdb] [saucenao] [google]
2537645

Now I remember why I didn't do anything with this 10 years ago

>> No.2537672
File: 35 KB, 432x421, 51XTkiByZmL._AC_SY580_.jpg [View same] [iqdb] [saucenao] [google]
2537672

>>2537559
I have ESP-01's all over my house controlling lights, motion etc. You can get them from chonya for less than $2. I flash them with tasmota and if you want to control them with one of the CIA listening devices, you can just check a box in the tasmota web server config pages and check the sonoff box and alexa will discover it on your network. It's ezpz.
I 3d printed my kids minecraft torches from an stl I found on thingverse then stuffed a 10 strand LED lights inside the top of it and soldered them directly to one of the GPIO on the esp then hid the wires in the walls to a power supply in the basement. they can voice command their nightlights on now and they're also set up on a solar schedule to run from dusk to dawn.

>> No.2537679
File: 3.06 MB, 4000x3000, 20230107_192118.jpg [View same] [iqdb] [saucenao] [google]
2537679

>>2537672
I did experiment with the ESP8266 and it had so much overhead that I would not get any more of these, that esp32 however... Looks like exactly what I need, plenty of ports too and cheap if I can find it for less than 10€, I'm definitely going to get a bunch and have them communicate through mqtt to home assistant, hopefully I won't have to make circuits this complex for simple sensors

>> No.2537803

>>2537672
What's the easiest way to power these standalone esp-01? I have two of these USB serial interfaces but linking them up is a mess (see previous photos), I could use a solution less mentally intensive to set up

>> No.2537813

>>2537803
Best way, buy an ESP-12F instead of an ESP-01. Otherwise, put them directly onto a protoboard/pcb, then add an ICSP header for a normal USB-to-UART cable to plug into.

>> No.2537824

i've never touched a Pi before, if i wanted to get one to do something specifically would this be the best thread to ask about it? just making sure before i make a fool of myself

>> No.2537827

>>2537824
The OP post says it's ok.

>> No.2537838

i want to fill an SSD with music (something higher than 16/44.1) and connect it up to a Pi that would be connected to an AVR via RCA cables with some sort of touchscreen and display that shows the track tag info, would something like this be possible and easy to do?

>> No.2537839

>>2537838
what does the avr do?

>> No.2537841

>>2537839
receives audio and video

>> No.2537845

>>2537841
oh "audio visual receiver"
yeah that should be doable i guess, though you may want to go for a higher quality dac

avr is more well known as a class of microcontroller here fyi

>> No.2537996

>>2537838
Just get a small HDMI monitor, connect it to a PC, and skip the retarded AVR shit.

>> No.2538193

>>2534069
Your software will drive PowerIO high once it is running? Seems like it would work. 1M for R2 seems high, it will stay on for a while.
The real problem is you've drawn the GND and BJT upside down for no obvious reason. For this you should feel ashamed and rethink your life choices.

>> No.2538202

>tfw too dumb for FPGA accelerated video processing

>> No.2538404

>>2534069
Run it through LTSpice and see for yourself what will happen

>> No.2538441

>>2537996
but i want a stand alone system that i can connect to my AVR? i don't wanna be playing audio from a shitty pc with tinny audio, that's why i have a home theatre set up

>> No.2538476

>>2537838
Extraordinarily easy to do.
Get a Pi, get an off-the-shelf touchscreen that meets your needs, hook up a drive full of music, that's about it.

>> No.2538494

>>2537679
I got a bunch of RPi Pico W, 8 euro a piece and gonna do some shit with them

>> No.2538499

>>2538476
https://www.youtube.com/watch?v=3CZRTD4pIiU
i kinda like the look of something like this but the price is way too high considering i'm trying to replace a Sony NWA105 and a aptX HD bluetooth reciever, i think the reciever caps out at 24/48 where as this device is 24 or 48/192 iirc

there was another youtube video i watched of another device and the thing itself looked perfectly fine, main difference was all music was stored on an SD card rather than an SSD but a lot of the video had the guy having to tap multiple times on the screen to get it to respond, no idea if it was a slow build or a faulty screen

>> No.2538553

Why did nobody tell me about esphome? It looks exactly what I need, for quickly deploying a lot of esp devices without having to reprogram each one by hand when something needs changing

>> No.2538867

the thing I use to run blinky is currently worth as much as my pos computer. what in the fuck?
the chip is mk20dx258 if that means anything

>> No.2539106

>>2538202
Which part filters you?

>> No.2539498

>>2539106
license costs

>> No.2539674

>>2534511
If you know absolutely no EE. Arduino starter books are fine, but are VERY basic. Stay away from mains.

>> No.2539722

>>2537254
>Tia portal
LMAO

>> No.2539800

>>2539722
>tia portal hater
way to out yourself, pajeet.

>> No.2540519
File: 2.40 MB, 1650x2200, 20230111_231949.jpg [View same] [iqdb] [saucenao] [google]
2540519

This is the culmination of my efforts: a button that blinks lights, except its blinking the lights of my whole room

>> No.2540624

>>2540519
>usb to UART module
Why not just have a pin header and use a common USB to UART cable? Even worse if it’s just a power supply, just get a USB to DC jack cable, or use a 2pin micro USB socket.
>single tactile switch module
why

>> No.2540641

>>2534035
My ESP32 doesn't boot when connected by the 3v3 pin. The power led is on but every around 1 second it gets dimmer for a split second.
It works fine when powered by 5v or USB.
And the voltage regulator I'm using is giving me 3.17v
Did I somehow fry the 3v3 input or is 3.17 low enough that it won't boot

>> No.2540658

>>2540641
Sounds like a boot loop of some sort. I'd guess something is dragging the 3.3V rail low enough that the regulator can barely keep up (e.g. shorted I/O, dying capacitor). I'd guess that it getting dimmer is the MCU itself trying to turn on, drawing the rail even lower, and turning off due to brown-out detection. That or it's always on but something inside it or its brown-out detector takes a second to kick in.

Does the regulator or any other component get hot? What regulator is it? Can you measure the input current? Post circuit if it's not trivial.

>> No.2540691

>>2535891
Have you seen this?
https://acidmods.com/forum/index.php?topic=44697.0
There's also a link to the pinout. Uses spi apparently.

>> No.2540695

>>2537611
Have you looked at esphome?

>> No.2540697

>>2540641
I had this problem. Can you check the serial output on boot? Mine was giving brownout errors, so not enough power.

>> No.2540714

>>2540624
>Why not just have a pin header and use a common USB to UART cable?
Waiting for the components to arrive
>why
waiting for the proper button to arrive
This is more of a proof of concept I did to figure out a good software and hardware setup to get going with automation, I have 10 more esp01 coming from china in a month, along with relay adapters, buttons, USB headers, etc

>> No.2540715
File: 3.28 MB, 4000x3000, 20230112_084316.jpg [View same] [iqdb] [saucenao] [google]
2540715

I had these xbee modules for years and I never figured out how to make them work, is there a way to make use of them nowadays? Maybe by having them interoperate with hue Bridge? They had some old windows configuration software that was very confusing to use

>> No.2540729
File: 13 KB, 300x300, ams1117-33v-and-5v-module-output-current-vs-voltage-safe-operating-area-soa-curves-747222_300x300.jpg [View same] [iqdb] [saucenao] [google]
2540729

>>2540658
It's just a 18650 going into a AMS1117 module like pic related which then is connected to the esp via the 3V3 and GND pins. Will do the measurements when I get home. And to the touch nothing gets hot.

>>2540697
When I connect with USB it gets the power from there and boots fine I don't have a serial adapter that isn't soldered somewhere else.

>> No.2540748

>>2540729
>a 18650 going into a AMS1117
Read the AMS1117's datasheet. It requires a typical dropout voltage of 1.1V, possibly up to 1.5V. So even a fully charged (4.2V) 18650 is out of spec, which is completely consistent with the symptoms you're seeing

You should go for a lower dropout regulator, like the HT7333 (only 0.09V dropout). It's also an option to use a discrete P-channel MOSFET (or PNP transistor if the dropout doesn't prove a problem) with a rail-to-rail op-amp to make your own regulator circuit.

>> No.2540758

>>2540729
>When I connect with USB it gets the power from there and boots fine I don't have a serial adapter that isn't soldered somewhere else.
If you have a soldering iron you could pry up the right hand pin on the on-board 1117 reg and power it from your external supply while the usb is connected.

>> No.2540783

I want to receive a float value through MQTT and store it in a variable, initialized in setup(), basically i have (message is a String):

>variable = message.toFloat();

But it's not working, could it be because the variable is being declared in setup? Or this can't be done like this?

>> No.2540877

>>2540748
It worked for a while on fully charged baterry, but as soon as the voltage dropped by a bit it stopped. For now I'll power the esp from a USB power bank since the only regulator available locally is the ams1117. I'll order one with lower dropout voltage and see.

Thanks for the advice

>> No.2540931

>>2540783
Sounds like you're on the right track.
You should move the variable assignment inside the loop or a function that is being called every time the message arrives, so that the value of the variable can be updated with the new value.

Be sure to verify that you're actually passing a float value, and that it's not just spitting back 0.0 or NaN.

>> No.2541027

>>2540931
The variable is used in a comparison, eg if temperature > variable, so it might be a one time setup action.
Is it possible that initializing the variable in setup() with a different value than the one i'm sending might be interfering?

>Be sure to verify that you're actually passing a float value, and that it's not just spitting back 0.0 or NaN.
You mean on mqtt i need todo 0.0 if it's going to be converted to float?

>> No.2541155
File: 168 KB, 1229x1364, 71OW3sPUGSL._AC_SL1500_.jpg [View same] [iqdb] [saucenao] [google]
2541155

>>2541132
I saw discussion about esp32 in /ohm/, so I jumped the gun and asked my questions there, but I now realize that this may be the better place
>>2534035
My question is about the minimum requirements for an esp32 to run. I would like to use something like picrel to flash bare modules and then solder a couple wires directly to the modules for power. Is this possible, or do the modules require such complicated circuits and components that it would be more effective to just buy a minimal board, or, are the castellated pins too small to solder with a basic iron? My main concerns are availability, cost, size, and ease of assembly

>> No.2541158
File: 540 KB, 1200x1200, 4b6dd2a0-aabe-4916-a05d-5bec7eb4c5a9.jpg [View same] [iqdb] [saucenao] [google]
2541158

>>2541136
Followup question:
>>2541155
Does something like picrel exist for ESP32s, where I can clip on to a presoldered (or not) module for flashing, or is the pic from my previous post the closest I can get?

>> No.2541320
File: 140 KB, 1584x938, 20230112_192427_1.jpg [View same] [iqdb] [saucenao] [google]
2541320

contacts are really close. hard to use a soldering iron.

>> No.2541330
File: 242 KB, 896x1347, 20230112_200002_1.jpg [View same] [iqdb] [saucenao] [google]
2541330

esp8266 -compared to esp32

>> No.2541331

>tfw too dumb for firmware reverse engineering

>> No.2541332
File: 153 KB, 906x567, 1673554107638.jpg [View same] [iqdb] [saucenao] [google]
2541332

easier to solder to something like this

>> No.2541335

>>2541320
t. SMDlet
Just get a 1.2mm screwdriver tip and some extra flux and you'll find it trivial. It's the 0.4mm-pitch micro USBs and 0402 passives that you have trouble with.

>> No.2541850

can someone explain to me how esp32 code upload actually works?
basically sometimes when i hit upload in arduino ide the code just uploads by itself, other times it won't work untill i press boot buttons, other times i have to spam en and boot buttons together for it to upload
it seems like a random mess. so what is the offical way this should work on for example bare esp32 module?(not dev kit)

>> No.2541851
File: 103 KB, 788x1158, file.png [View same] [iqdb] [saucenao] [google]
2541851

>>2541850
after asking here i realized i could try asking the gpt since i created an account recently.. and holy shit.. it knows fucking everything
i don't need you fags anymore,
goodbye forever

>> No.2541883

>>2541851
welp i'm back, you still have to ground the boot pin before uploading or it won't work, gpt lied to me

>> No.2541903
File: 22 KB, 636x279, 1673665191217.jpg [View same] [iqdb] [saucenao] [google]
2541903

>>2541883
arduino uses this circuit to do that

>> No.2541915

>>2541850
https://owenduffy.net/blog/?p=21574
https://owenduffy.net/blog/?p=19052
this kinda explains the problem and a fix (adding the cap).

>> No.2541918
File: 1.75 MB, 4000x3000, 20230114_124832.jpg [View same] [iqdb] [saucenao] [google]
2541918

Went to the local parts store and got a small box for my movement sensor

>> No.2541920
File: 1.24 MB, 4000x3000, 20230114_130520.jpg [View same] [iqdb] [saucenao] [google]
2541920

>>2541918
I also completed the internal doorbell, same innards, it has a passive buzzer inside but I still haven't figured out how to make it produce sounds though home assistant, the esphome configuration for pwm is annoyingly complex, also had to use the RX pin since that thing counts as always connected to gnd and would cause the esp to not boot if on pin 0 or tx

>> No.2542002

>>2542001
crosspost

>> No.2542080

>>2542002
Check the datasheet noise figures but generally being so close to the MCU you get more clock noise.
If you can tolerate it or what your sampling is out of that band or you DSP it away it's fine.

>> No.2542099

Any recommendation for NFC ISO 15693 readers? I am on a new project where they use nfc tags for tracking. I need to get some readers going but I dont really know the options in the space yet.

>> No.2542132

>>2542080
I don't even need it for sampling, I just need a variable voltage reference for a linear power supply / dummy load etc.

>> No.2542145

>>2542132
I read DAC as ADC, for a DAC the noise still a concern but you're probably fine.
Lots of $100 chinese linear PSU's just use a n external resistor ladder controlled by GPIO as a DAC and that gets good enough for 99% of use cases.

>> No.2542413

Whats the best home automaton protocol?
Am an industrial electrician so Im familiar with PLCs and what not
Have played around with arduinos and im just starting to experiment with esp32s now
I know theres things like ESPhome, anyone used that or similar?

>> No.2542476

so i uploaded code to esp32 module with my ftdi programmer sever times yesterday and it worked just fine, but for some reason i just can't get it working today..
the arduino ide just does the
...................
thing and then it says "Failed to connect to ESP32: No serial data received."
I know the esp isn't fried or anything as the code i uploaded yesterday is running and printing data into serial and i can see them in the serial monitor (i of course close the serial monitor before attempting to upload code)
so why in the fuck isn't it working?
i am pressing manually pulling the boot pin to gnd and pressing EN just like i should..
fucking hell...

>> No.2542496

>>2542476
so i tried using arduino uno as a serial programmer instead of the ftdi to make sure it's not a driver issue or something and nope, same issue i either get the error above or "ESP32: Invalid head of packet (0x65)"
which makes no sense when it fucking worked yesterday

>> No.2542585

>>2542496
sunday is a rest day, try tomorrow

>> No.2542912

>>2542496
some breadboards have bad holes where the connection is weak. try moving the boot wire to different holes.

>> No.2543079

>>2542912
it's my own pcb i made and soldered the module to, and the programmer is connected directly to the pins via pogo pins, i probed all of the wires connecting to the programmer and they all have connection
it's really frustrating as fuck for it to simply stop working for no reason

>> No.2543094

so why aren't you doing fun things like this /mcg/?
https://www.youtube.com/watch?v=fzJrH_DR6SY

>> No.2543110
File: 29 KB, 909x289, hmm.png [View same] [iqdb] [saucenao] [google]
2543110

>>2542912
so i noticed that if i leave serial open and ground boot while reseting with EN it starts printing flash read error 1000, i googled it and found this
could that mean the bootloader on the esp somehow got damaged?
the post says to flash a new bootloader but my guess it i would need the esp programmer for that and use JTAG since how am i supposed to upload it over serial if esp32 needs the serial

>> No.2543114

>>2543110
okay so i found my esp-prog which is capable to jtag but i have a choice in front of me... i have several spare pcbs and 7 esp32 modules left, and each costs like $3 bucks.. so i am not sure if i should just throw it out and use another esp32, but i would very much like to know what caused the bootloader corruption to avoid it in the future.. so shit.. hard decision

>> No.2543704

>>2542476
Although I doubt this is the actual issue, is there a microSD card in your ESP32 module? I was having a somewhat similar error and if I remember correctly the issue was that the microSD card was fried. The ESP32 module worked fine when I removed or replaced the microSD card. I doubt this is the case though since if your code uses a microSD card then it would probably halt and not send the serial data that it's sending, and if it doesn't use it then chances are you wouldn't have one inside.

Alternatively, maybe it's a permission issue with your USB. If you're on linux you might have to use chmod to give yourself permission to use the USB device. On Windows or Mac maybe it would do it automatically. Again though if it's sending serial data through the serial monitor then I suspect that's not the issue either.

>> No.2543706

>>2543094
I am, look at my real-time internet-controlled paintball robot: https://remocon.tv/5fa8b5d8f5101758e9559665

>> No.2543938

I need extremely cheap alternatives to pi zeros, ESP8266 won't cut it because I need actual linux for room assistant, everywhere I look all the knock offs cost way more than they should, even on aliexpress, any idea what I should be looking for?

>> No.2543963

https://www.analog.com/en/products/ad9254s.html
For a "fast" ADC like this, with one output pin for each digit, is it essentially a requirement to have dedicated hardware such as an FPGA to fetch the data and save it in a memory buffer?
If the sample rate is 150 MHz, would a 500 MHz microcontroller be fast enough to read the data, perform some simple processing, and display it on an LCD?

>> No.2543983

>>2543963
You might be able to capture samples to buffer if you manage to get the pins somehow mapped to DMA.
I don't think you would have time to do anything with the data though without skipping buffers.

>> No.2544138

>>2543938
Completely different ballpark. a RasPi has 500MB RAM minimum, while an ESP8266 has hundreds of kB. Go for something with an allwinner chip on it, look at that chip's prices on LCSC or digi-key to see what the chips (and dev-boards) cost for comparison.

>>2543963
150MS/s, 14-bit, but it outputs a parallel stream of data. So with direct IO register manipulation you could theoretically shuffle that data into memory with a 150MHz clock frequency. With a dual-core micro you should then be able to access that memory just as fast, maybe requiring only a single core if the data can be transferred via some sort of parallel DMA hardware, sans any processing. Multiply that clock by as many simple operations you need to do.

The video display bit might be possible with direct C or ASM programming atop an SBC, otherwise I suspect you'd need an FPGA. I'd try to outline the steps required to convert those numbers into packets for the display.

>> No.2545137

>>2543938

A used PC or laptop is your best bet, SBC's are either going to be marked up like crazy right now or hard to find. A used computer isn't as sexy but it will do the job.

>> No.2545223

>>2534035
Does anyone know what capacitor values i should use for the dp/dm lines on the esp32-s3?

>> No.2545284

>>2545137
>SBC's are either going to be marked up like crazy right now or hard to find.
Why?

>> No.2545331

>>2545223
none. caps will ruin high speed signals. use tvs and series terminating resistors. or you could go naked. works for me

>> No.2545444

>>2545284
The chip market, scalper, and supply issues.
The entire market got FUCKED over the last 3 years, and has degraded into a shit show.
Raspberry Pi 4B 8GB priginally $60-$75 depending on whereabouts you live, current price on Amazon: $175-$250
The real Pi line was the most heavily affected, because it was very popular and already produced in "relatively" low numbers, it didn't take much to really fucking destroy the market.
Chinkshit, less affected, but the overall demand has increased, and that keeps the prices higher too.
Can't get your $60 overpowered Pi anymore, and the $20 alternatives are now $40.

>> No.2545447

>>2545284
>>2545444
>>2543938

See: >>2542039
~$50
The Atomic Pi is a full-blown x86 PC that shits all over many other SBCs: https://www.amazon.com/DLI-APi-Atomic-Developers-Kit/dp/B08CGFM2B1
That's because it's not a SBC, they're surplus embedded computers originally intended for a robot that never hit the market, and some company bought their surplus of x86 boards and started selling them as "Atomic Pi" single-board computers.
They're old crap, but they're good, and for $50 it'll play Fallout 3 on medium settings at 1024x768.
~$36
The Makerbase Pi clone https://www.aliexpress.us/item/3256804231556479.html
It's trash next to a Pi4, and intended for 3D printer use.
~$35
Libre Le Potato: https://www.amazon.com/Libre-Computer-AML-S905X-CC-Potato-64-bit/dp/B074P6BNGZ
Another "hell no it's not as powerful as a Pi" but it's still a legitimate board at a fair-ish price with a fabulous name.
~$30
There are also plenty of folks who use Android set-top boxes, as many run the same Allwinner chips you find in plenty of Chinese SBCs (like much of the Orange Pi lineup).
Various H6 and H616 boards are fucked with depending on your needs.
This Allwinner H6 T95 Mini runs about $30: https://www.amazon.com/T95-Mini-TUREWELL-cortex-A53-Streaming/dp/B07SM8WTBT
You can install Inovata's Armbian on at and have at it, but with a lack of any GPIO.
~$25
Onion Omega2+, tiny, runs Linux, has an MT7688 MIPS processor so that's fun.
~$25
Orange Pi Zero 2, I shouldn't have to explain what this is.
~$20
Orange Pi Zero LTS

>> No.2545458

>>2545447
Fuck I missed the cheapest one, the RockPi model S.
Available in a variety of specs so you can pay for what you need.
Starts around $10-$15, that'd be the baseline with an RK3308, 256MB RAM, no WiFi or Bluetooth.
You can optionally spec it with 512MB RAM, WiFi, Bluetooth, PoE, and a 1/4/8 GB NAND.
Only $20 for 512MB RAM and Wifi/Bluetooth with no NAND.

>> No.2545460

>>2545447
Basically, they're all general purpose and easy to port to, and probably cheap because they're sitting around in some dusty warehouse in high volumes, right? Still pretty annoying if you based a product on it, and need uniform firmware.

>> No.2545471

>>2545460
If you're designing a product, off-the-shelf SBCs are a terrible choice anyway.
Unless you're specifically targeting certain enthusiasts, like designing a Raspberry Pi accessory.
If you're designing a product based around an SBC though, don't fuck around with off-the-shelf crap unless you'll be making the entire volume yourself at home.
Reference designs for ARM based SBCs are freely available, and parts availability is excellent.
There are also companies out there who will produce custom made-to-spec SBCs specifically for use in commercial applications, like Anders Elec, who has board designs floating around in virtually every industry and every corner of the globe without any of the users knowing it, including some of the off-the-shelf SBCs from other companies.

>> No.2545660
File: 28 KB, 378x577, descarga.jpg [View same] [iqdb] [saucenao] [google]
2545660

i want to create something like picrel (a midi music box) to have quick and portable audio out of my midi keyboard, the issue is that this blue fella doesn't have an aux imput so i can't practice with it and im too cheap to buy the better version of this with the aux port.
any ideas?

>> No.2545674

>>2545660
See Mitxela's miniature midi synths. He's done 2 or 3 of them IIRC.

>> No.2545968

Anyone knows where I could find the library for the Mikroe LR4 on Arduino?

>> No.2545976

>>2545968
Mate it's just uart, read the datasheet for the baud rate and any info like stop-bits and parity bit and such. Connect it to the UART pins of your MCU and start a serial link with the right registers set, then start spitting info to it. Looks like there's also utility pins like interrupt and wakeup, which might be useful for low-power operations.

If you must have a library, it looks like there's probably one on their github, if you can find it. You can maybe import that into the Arduino IDE via URL if you try hard enough, otherwise there's likely a way to use any downloaded file as a library by dragging it into the right directory.

>> No.2546197

>Mixed Signal PCB Design with KiCAD
>Prerequisites are good EE knowledge
I don't have that, fuck

>> No.2546321

>>2535431
>>2535428
You could take a blank PCB and draw on it the lanes you want to keep with the printer and an proper pen and just dissolve the rest like normally with iron3chloride. Or i saw somewehere that you could use some for of electrochemical machining to remove the layer directly it take more effort.

>> No.2546331

>>2546321
https://youtu.be/z57lGSn0yXM basically this but on a PCB and with a jet ECM.

>> No.2546369

>>2545447
>~$25
>Onion Omega2+, tiny, runs Linux, has an MT7688 MIPS processor so that's fun.
>~$25
>Orange Pi Zero 2, I shouldn't have to explain what this is.
>~$20
>Orange Pi Zero LTS
WHERE
They all go for 50 bucks MINIMUM

>> No.2546371

>>2546321
I don't have luck with those pens. The ink disintegrates after 10 minutes in the etch. Though maybe my etchant is just too dilute, now I've got an air bubbler so once I pull the copper back out of the ferric chloride I should be able to fully oxidise any remaining Fe(II), and probably dissolve some more iron metal in it too. Started off as pure HCl with some nails, but it didn't dissolve as much of the iron as it should have.

>> No.2546404

cence /ohm/ is at bump limmit and /g/'s /csg/ is a useless general for anything technical...
any recommendations for a ***cheap*** emmc/nand reader and a NAND 08 adaptor set for the tl866?

>> No.2546419

>>2546369
>They all go for 50 bucks MINIMUM
amazon has the zero 2 for $35, aliexpress probably cheaperl

>> No.2546428

>>2546369
>Onion Omega2+
Digikey: 2070-OM-O2P-ND $25.31 in stock
Mouser: 353-OM-O2P $25.31 in stock

Real, official sellers ONLY:
>Orange Pi Zero 2
https://www.aliexpress.us/item/3256804171701489.html $24.91 in stock
https://www.aliexpress.us/item/3256801637347870.html $24.91 in stock
https://www.aliexpress.us/item/3256804391006808.html $24.91 in stock

Real, official sellers ONLY:
>Orange Pi Zero LTS
https://www.aliexpress.us/item/3256804189116593.html $20.99 in stock
https://www.aliexpress.us/item/3256803323773726.html $20.99 in stock
https://www.aliexpress.us/item/3256804408356956.html $20.99 in stock

If you ever have trouble finding shit like this, I recommend starting here:
https://gprivate.com/632t0

>> No.2546431

>>2546428
Links to all of these can be found on the websites for the products.

Seriously, how retarded do you have to be to not find 'em if you're looking?

>> No.2547886
File: 610 KB, 749x581, 1634952957519.png [View same] [iqdb] [saucenao] [google]
2547886

>>2534960
>Learn Rust.
no u

>> No.2547900

>>2534592
Definitely this. How can you even tell what's going on without knowing asm?

>> No.2548585

>>2535428
You can laser cut it.

>> No.2548591

>>2534563
>>2537254
>>2539722

Tia is the go to for anything industrial. Anything with robotics or automation in general, big facilities with big machines. In Europe it's the standard if you want to do any big business.
In Europe most programmers program in Ladder in Tia. It's easier for a technician to understand it when it's built up in modules, it's also easier to keep the rules and regulations when you program in Ladder.
But it's a big subject. It's not something you can learn in a weekend. You need lots of practice and you need to learn how to read other peoples clumsy programs if you want to use it in a business context.
The PLC's + the licenses are also quite expensive.

>> No.2548637

>>2548591
>ladder
kek, way to out yourself pajeet. No one uses ladder anymore. You use FBD or ST (most of the time function blocks made in ST)

>> No.2548660

>>2548637
yes, industrial electronics are well known to usually use all the latest technology

retard

>> No.2548686

>>2548637
We were taught explicitly to use Ladder programming, and to not use Function Block Diagrams.
Function Block Diagrams are easy to use for small programs, but for big complicated programs it's a total mess, and you can't easily locate faults in the program.
When you do Ladder programming you can do 'step programming'/'sequence programming' which most firms here in Denmark require, because it makes finding faults in the system extremely easy, both in development, in testing, in maintenance and in repair, no matter how big the system is. It could be hundreds of machines with each their own program sequence running simultaneously in a long production line all coupled together, it would be easy to locate any faults because you can see exactly where the program stops in the sequence. You can see exactly which sensor or what value or whatever is the fault.
For a specific step to start, requires that the previous step was completed and locked.
Lots of companies in Denmark and in Europe require this form of programming for safety reasons.
Such programs are extremely simple and elegant and you can know exactly what they're doing all of the time, even while they're running live.
Remember, you can use Function Data Blocks and Function Blocks in these programs too, so you have all the great advantages of Function Block Diagrams, but none of the tangly mess.
In Ladder Programming you can visually see exactly what is happening in the program when you do Sequence Programming.
Even if you're not a very skilled programmer you can understand a Sequenced Ladder program, and troubleshoot it immediately in most cases, if it's made with the right 'Step Programming' method.
That's practically very difficult if not impossible with Structured Text or Function Block Diagrams as far as I understand.

>> No.2548752

>>2548686
>denmark
lmao, I see my neighbors are retards like usual. FBD and ST is the way to go. Doing arithmetic in ladder is fucking cancer. That's when you make a function block which can for instance map out a grid you can customize in the panel later on. Also, FBD is way better because instead of doing pajeet programming and making AND functions like a retard, you simply just get an AND block and put all the inputs in it. Ladder is outdated and only used by washed up electricians making programs with their knowledge of reading blueprints.
>you can use Function Data Blocks and Function Blocks in these programs too
Yeah, if you're a psychopath who uses a 30 input function block for a motor in a relay schematic. Let me guess. You have never used arrays and made your own function blocks made from mathematical formulas?
>>2548660
In my country, we have purged ladder programming from use and are waiting to have ST, SFC, and FBD as the standard.

>> No.2548760

>>2548686
Also, you don't do "sequence programming" for everything. Sequence programming is only used for very specific cases. You can't use squence programming for say, a pump station that constantly needs to be regulated. And we also also have a specific FBD block for sequence programming. You just click the plus on the block and vollah, you now have 54 steps where you just add inputs and outputs. Ladder is dogshit. Not being able to navigate a program is a skill issue. These 54 year old "programmers" don't know how to use cross-reference

>> No.2548769
File: 52 KB, 1296x750, FBD Program.png [View same] [iqdb] [saucenao] [google]
2548769

>>2548752
>30 input function block for a motor in a relay schematic
Why would you ever need to do that?
I certainly haven't
>You have never used arrays and made your own function blocks made from mathematical formulas?
Yes and then call them from the ladder program sequence when they're needed.
>In my country, we have purged ladder programming from use
not him but what country is that?
> Sequence programming is only used for very specific cases.
We use it for everything that is in a 'sequence' so to speak. meaning anything where a process of actions are running through a procedure.
this way no unforeseen action can take place in the program. It reduces errors dramatically and when there is an error you just look at the sequence and can see exactly where it stopped and why it stopped. This way you know exactly which sensor or flag or whatever didn't activate or deactivate. You go straight to the subroutine or to the function block or whatever that didn't return a bit or whatever. There's no doubt at all of what happens when something fails.

FBD programs are not ideal when you're dealing with anything larger than picrel. It's already a mess at that point.

>> No.2549018

Is this all about Tia? It doesn't even have a wikipedia page. How does it compare to real programming?

>> No.2549021

>>2534214
>What is the cheapest way to communicate wirelessly
bandgap transmission.
>the fcc hates this one weird trick

>> No.2549026

>>2549018
What do you mean how does it compare to real programming?
It is real programming.
It's just locked within a licensed platform.
You mainly use it to program PLC's to control robotics and machines and such.
It's mainly for industrial applications with real physical production or anything that will exert physical control through relays or analog voltage regulation, and or digital data driven regulation.
For robotics, machines and control equipment mainly.

>> No.2549171

>>2548769
>picrel
This is what an FBD looks like when you don't use function blocks. You keep all the blocks vertically and not horizontally. You just make it so you can scoll down and see the whole program. This program was obviously made by a third worlder.

>> No.2549225

>>2549171
>This is what an FBD looks like when you don't use function blocks.
ok. There are still some things that you can't do if you're not using ladder programming. step/sequence programming is a safe way to program with no possibility of faults in the system since nothing will be initialized before the previous step has been completed, meaning you cant accidentally get the program to do anything in the wrong order, regardless of any failing physical components.
I'm not saying you need to change any of what you're doing already if it works for you, there are many ways of making a program that works fine, I'm just describing what I've been taught, and I see some undeniable benefits in doing it that way, so I just wanted to share it.
God bless you

>> No.2549231

Does Gigadevice have a hobbyist-friendly distributor for GD32E505, other than LCSC? I looked through their authorized distributor list and most of them seem like usual boomer business to business scams where you have to call a phone number and talk to a sales engineer for 1k+ minimum order quantity... I just want to buy one fucking MCU, if it's even stock.

>> No.2549304

>>2549231
LCSC isn't terrible for hobbyists. You can probably get it on a custom dev-board via JLC.

>> No.2549551

Hello, I know basically nothing about electronics other than some basic-bitch shit I learned by playing around in Falstad's circuit simulator.
I want to create a button where if you press and release it quickly, it will act like a toggle, where as if you hold it down, it will act like a momentary. Does a component that can do this function exist? Or will I need a microcontroller for it?

And let's say that, yes, I will need a microcontroller. I figured I could expand the functionality by making the threshold for when the button acts as a toggle and when it acts like a momentary switch a programmable thing, and also having a battery charge indicator by using an RGB led. If I need a Vcc pin, a GND, a pin for the button signal, 3 pins for each anode of the RGB LED, a pin for the load switching MOSFET, and a pin for the battery voltage, would the 8-pin ATTiny85 work for such a use case?

>> No.2549560

>>2549225
There is no need to use Ladder for sequence programming though. You literally just get an INT value called ”steps” and you have the value and your input as the condition for the value to increase by one. You can also additionally make it an array and have alternative sequences.

>> No.2549567

>>2549551
A T-flip-flop is the component that turns a momentary signal into a toggling signal. Then you'd just use a pulse-length detector in order to trigger the T-FF if the pulse is short enough, with some sort of feedthrough (input OR gated with the T-flip-flop maybe). For the T-FF, I'd usually use a JK-flip-flop with the J and K pins both tied high, it's apparently more reliable than using a D-flip-flop with ~Q tied to D. An example being the 74LVC1G73. For the pulse length detector, a (CMOS) 555 timer circuit can do that pretty easily, though there may be simpler options. All in all it's maybe 5 passives, 2 or 3 smallish ICs.

A microcontroller is definitely an easier method, I've got a bunch of ATtiny13s that I use for that kind of shit. Found my voltmeter panel wasn't designed to run with the supply voltage and the sense voltage seperated, so if I pull that sense voltage below 3V the screen backlight starts flashing. But if you press the backlight toggle button, it stops flashing. So I rigged a tiny13 to wait for the backlight to change sufficiently quickly, and pull the button pin down when that happens for 50ms or so. The tiny13 would also definitely work for your case, the tiny85 is overkill in my opinion, I save them for when I need I2C.

>pin counts
Yeah Vcc, GND and reset will probably be required to remain reserved. You can arguably use the reset pin for battery monitoring by using a voltage divider that doesn't let it get too low. The other 3 programming pins sck,sdo,sdi can be shared with other uses, so long as you ensure that they're not spitting data onto them while you're programming (in this instance you'd just have to not push a button while programming). Just might get some LEDs flashing while it programs.

>> No.2549570

>>2549567
Thanks for the input.
>the tiny85 is overkill in my opinion
I forgot to mention that I also want to program a way to change the time required for the button press to be registered as a momentary. Basically if you hold the power button down for 3 seconds while the device is Toggled on, it will enter a mode where you can press, hold, and release the button to establish a new Momentary threshold, with the length of the button press while in that mode being the new time.
I was thinking of other features you could access with this "menu" as well, navigating between them with various short and long presses, as well.
Don't know if that will make a difference in my uC decision.
Again, barely any electronics experience, and I don't have any existing Arduino or whatever to experiment with, though I've been thinking of buying one to play around with. I presume my best way to find out my requirements would be to play around with something like a Nano?

>> No.2549579

>>2549570
>I also want to program a way to change the time required for the button press to be registered as a momentary
Still doable with a tiny13, though it might get cramped, depending on your programming style. I'd do your work on a tiny85, and if the code is below 1k then you can port it. Watch Ben Heck program a fully graphical space invaders on an ATtiny10 if you want to see how to really cram code.
>navigating between them with various short and long presses
Sounds like unintuitive hell.

>nano
I recommend the nano for use on a breadboard, and the uno for use with shields.

>> No.2549584

>>2549579
>Sounds like unintuitive hell.
Probably, but the LEDs could make things slightly more manageable. Certain color combinations for certain menu items, and for confirmation pages, etc. And besides, I really only want the reprogrammable threshold, everything else is a bonus. But for now I'll focus on the core of what I want.

>> No.2549592
File: 497 KB, 1650x1275, AVR microcontroller comparison chart.png [View same] [iqdb] [saucenao] [google]
2549592

>>2549584
Yeah the LEDs would help a lot.
Depending on how complex the menu needs to be, I wouldn't be surprised if non-autistic programming takes up to 8k (the size of the tiny85). But so long as it's non-pajeet programming you probably still won't go over that unless you're doing some particularly nuanced stuff with the menu items.
You'll probably want interrupts on the button, so I'd not put it on any of the SPI/ICSP pins. You'll need a USBasp programmer FYI.

I recommend reading completely through the relevant sections of the tiny85's full datasheet (the 234 page one), that alone should give you a good idea of how to use it. Relevant parts being the pinout and port multiplexing, clock sources, I/O, hardware timers, interrupts. Should be virtually the same as the mega328P as seen on the nano/uno, just different I/O and pinout.

Pic related is a mostly full list of AVR microcontrollers, for those interested.

>> No.2549750

>>2549551
use a microcontroller's interrupt (set it to edge trigger) and timer to figure how long the button was pressed.

>> No.2549791

>>2549551
>micro controller code a grade schooler could write
>versus a circuit a first year EE could design
Pick your poison.

>> No.2550400

>>2541883
GPT is about as useful as Reddit, maybe a little less.

>> No.2550486

How's LoRa with walls? I need to go through a building.

>> No.2550677

>>2550486
its pretty shit. i have real life example.
>1W lora output (+30dbm)
>theoreticaly 10km range
>transmitter on top of building, 20m above ground
>receiver loses connection after 2km with 9600 baud rate
and thats just with a couple of concrete walls between, barely. if you want to transmit <1km it should be fine but youll suffer above that. lora needs direct line of sight to be effective. or youll have to lower your data rate down even further. theres like a 100 other things to consider which can help your "through walls" issue but generally its shit. if you want to go through walls a high power 433mhz transceiver would work better, imo

>> No.2550713

>>2550677
should be just a few meters, from my garage to a 4th floor, without any line of sight

>433mhz transceiver
interesting, i might go for it.

>> No.2550733

>>2550677
> a high power 433mhz transceiver
Can you give at least two examples?

>> No.2550846

>>2550733
why two?
cant remember off the top of my head but theres a silicon labs rf transceiver that i found that by default and a decent antenna can reach just over 1km reliably. like si44xx or some shit like that. they have a whole family with different stats and shit

>> No.2550874
File: 58 KB, 325x470, GPIO.png [View same] [iqdb] [saucenao] [google]
2550874

Is there any neat trick to route tracks from the short side of a raspberry GPIO header? If not, can anything really happen if just route through another non-power pin like 7 and 11, as they're both unused?

>> No.2550902

>>2550874
use layers retard

>> No.2550906

>>2550902
>more layers
>doesn't solve the problem in the slightest
Good one calling people retard, nigger.

>> No.2550915

>>2550874
>>2550902
>>2550906
You really are a fucking retard.
Use both layers, you can break out every single pin to wherever the fuck you want it with only two layers and the widths shown in your screenshot.
If you can't figure it out then maybe you should kill yourself you dirty shit-skin.

>> No.2550924

>>2550915
You really are a nigger.

>> No.2550937
File: 269 KB, 1153x924, twotoerail.jpg [View same] [iqdb] [saucenao] [google]
2550937

>>2550874
You put the wires where you need them so they go where they belong.
What else do you need to know?

>> No.2550941

>>2550874
use 6 mills for signal

>> No.2551011

Any reason why i should use a transistor to control a fan instead of just connecting the fan to the mcu?

>> No.2551022

>>2551011
The fan may draw more power than the MCU can safely supply through a GPIO pin.
Even if it doesn't, the current draw on startup or when stalled may exceed when the MCU can safely supply.
Even if it's within the "safe" range, driving it directly through the MCU puts more power through the MCU than would be otherwise, meaning it'll run hotter, and as a result it won't last as long.
If you manage to accidently stall the motor and burn out a transistor/mosfet, bfd, a couple pennies, 3 pins.
If you accidentally stall the motor and burn out the MCU, you need a whole MCU, a couple dollars, 28-32-40+ pins.

>> No.2551040

>>2551011
also back-EMF could fuck up your mcu, even with a transistor you still should put a diode across an inductive load

>> No.2551053
File: 338 KB, 4032x2016, IMG_20230126_234047.jpg [View same] [iqdb] [saucenao] [google]
2551053

>>2535428
I use an MSLA printer to expose the photoresist film when I make PCBs

>> No.2551061

>>2551053
huh, any recommendation on reading how to? a video is algo ok, but prefer a blog post or smth

>> No.2551064

>>2551053
what the hell is that

>> No.2551069

>>2551061
https://www.youtube.com/watch?v=CrdheP3Dwyc this is the general process, I just use an MSLA printer for the exposure step.
>>2551064
https://sagittronics.wordpress.com/2019/09/14/simple-smt-phantom-power-preamp-alex-rice-piezo-amplifier/

>> No.2551071

>>2551069
i also use a laminator to apply the film instead of an iron, and instead of agitating the ferric chloride by hand i put the container on a bed slanger printer and run a macro to shake it back and forth for 20 minutes. 0.25mm traces are no problem, could probably do .2 fine, below might be difficult unless you heat the ferric chloride to etch quicker, which reduces sidecut.

>> No.2551093
File: 1013 KB, 1769x1073, Delamination.jpg [View same] [iqdb] [saucenao] [google]
2551093

>>2551053
Based MELF enjoyer. A lot better looking than mine. Had major issues with the film softening and delaminating during etching. I think both my developer and etchant weren't sufficiently concentrated, and the excess time in the solutions was causing the film to degrade. It's homemade ferric chloride made from iron and HCl, since my air bubbler arrived I should add more iron and oxygen. After I extract the copper using electrolysis, that is.

You use UVtools I assume?

>>2551071
>i put the container on a bed slanger printer and run a macro to shake it back and forth for 20 minutes
Cool!

>> No.2551104

>>2551093
i do use UVTools, I have pulled copper layers from kicad into freecad and exported as STL, but uvtools simplifies things. the guy recently added excellon drill file support but it's half-broken.
>Had major issues with the film softening and delaminating during etching. I think both my developer and etchant weren't sufficiently concentrated
What are you using to develop? The cheap chinese photoresist film is meant to be developed with sodium carbonate, so if you're using sodium hydroxide (lye), you're stripping it prematurely. I use laundry booster, which is just sodium carbonate, to develop, then etch with fecl, then strip remaining photoresist with lye solution.

>> No.2551127

>>2551104
>the guy recently added excellon drill file support but it's half-broken
KiCAD can output gerber drill files, that's what I use. I add them both into the PCB window, invert the drill file, and make them both be part of the same layer. This subtracts the drill marks from the copper so I can drill them by hand. Watch the "invert" button, it can't be unpressed, and sometimes doesn't work. There's a backup method of importing both layers seperately, then combining them with math functions.

No support for mini drill marks though, as you can't gerber that in the first place. Think it would be pretty trivial to parse a drill gerber file in python and replace all hole sizes with 0.3mm or whatever though.
If you have any issues in UVtools, I recommend you make bug reports on his github. Guy has fixed like 3 of my problems within days, absolute legend.

>what are you using to develop
Was out of sodium carbonate, so I used bicarbonate instead. Which usually works ok, but I didn't have enough so it took at least twice as long as usual, maybe 10-15 minutes. Bought some washing soda a week ago which should be better.

>> No.2551135

>>2551022
>>2551040
makes sense, thanks

>> No.2551966

>>2534511
By a 10 pack of pro micros rather than an Arduino, do a little more soldering and fry a couple of them without wanting to cry.

>> No.2551994

>>2551966
Always buy 10 or more of something cheap if you can. I got 20 blue pill boards years ago for $2 each shipped, long before the problem of fake CPUs happened. I've used like four of them so far, and fried one. But I can always hot-air off the fried chip and put another one on.

>> No.2553105
File: 111 KB, 1074x676, AHT2020_i2c.png [View same] [iqdb] [saucenao] [google]
2553105

>Goal
Several AHT2020 sensors connected to a zero 2
>Problem
Am i understanding i2c correctly in that i "just" pump voltage into it to get it working? I'm a bit irritated to ignore any power consumption that should? go on here.
>Else
I know SDA and SDA_pu are the same, but if anyone could throw a look over my thoughts so far it be highly appreciated. My end goal is some sensors in my hens' barn to see if they're getting too frosty. AHT2020s because i already got some.

>> No.2553116

>>2553105
Not sure why i wrote AHT2020 instead of AHT20, but here's the datasheet before someone asks.
https://files.seeedstudio..
com/wiki/Grove-AHT20_I2C_Industrial_Grade_Temperature_and_Humidity_Sensor/AHT20-datasheet-2020-4-16.pdf

>> No.2553167

>>2553116
How many sensors? And how many I2C outputs does your micro/sbc have? You can bit-bang I2C pretty easily, allowing you to use more sensors than you have internal hardware. Just using one internal hardware and swapping which pin it’s connected to also works if you can do that. Multiplexing SDA or SCL with an analog switch is also an option. There are also dedicated I2C multiplexing ICs.

I’m not familiar with the zero 2’s hardware, best read the datasheet.

>> No.2553168
File: 240 KB, 1504x1085, 1675124392579483.jpg [View same] [iqdb] [saucenao] [google]
2553168

I know this may not be the right thread for this but I've been tasked with fully designing a small control system with quite a few inputs and outputs. The logic itself is easy enough, however I'm new to panel design and am not entirely sure my layout makes sense. All the field devices have to use 120v. It seems like a shot ton of wiring with each of the terminal block groups having jumpers. Is there something I'm missing? Any feedback is appreciated. I don't want someone electrocuted because of me. Nothing on this system will use much power, the 24dc to 120 relays are so i can control 120v field devices with the PLC's 24vdc outputs. The first group of 120v terminal blocks are inputs which are running to devices and coming back to a 120v input card. The second set, and set of neutrals will be wired for supplying 120v through the 24vdc-120vac relays to devices. Do i need to separate the terminal block groups more? There is a single 10 amp breaker which the line in is going through before feeding the 120s

>> No.2553170

>>2553167
See >>2553105 attached pic. 4 sensors, data and clock are on 3 and 5, no more dedicated i2cs, dunno if other gpio pins allow to be converted, haven't thought about that yet. My goal was to bit bang, as that's what I understood, so far, to the default in i2c. Another chip to just me show me neatly what is where seems overkill, as I don't care for that.

>> No.2553176

How to figure out what tasks FPGA does fast? Like jpeg encoding will be faster on FPGA or an MCU in similar price range?

>> No.2553239

>>2553167
>>2553170
So, i looked up software i2c on raspberry pi and this seems to me like a much more preferably solution, as i can fix more stuff in software myself. Apparently pin 3 and 5 also already come with an internal pull-up resistor, so it would've made my current plan a bit messy to begin with. A multiplexer probably would've been the cleanest solution, but i still think it's overkill for me and i rather keep parts simple for now.

>> No.2553256
File: 51 KB, 982x168, file.png [View same] [iqdb] [saucenao] [google]
2553256

>>2553105

>> No.2553268
File: 79 KB, 1076x560, load brake switch and channels.jpg [View same] [iqdb] [saucenao] [google]
2553268

>>2553168
>Do i need to separate the terminal block groups more?

no, it's more than fine.
one thing you might consider is adding a safety power switch.
they come in two parts, one inside the panel, and the other on the cover of the panel, connected by a long rod.
the rod can be inserted/removed into the cover only when the switch is in the off position.
so you cant open the panel when switch is on.
also consider adding a bit of PVC channel between the upper and lower sections to keep wiring neat.

>> No.2553278

>>2553176
There's also ASICs to consider. For example, MP3 players may have dedicated MP3 decoding hardware. It's possible some cameras have dedicated hardware for image or video compression too.

>> No.2553286

>>2553256
That shouldn't be a problem though, as i'm doing 4 buses now?

>> No.2553288
File: 123 KB, 774x799, R (80).jpg [View same] [iqdb] [saucenao] [google]
2553288

>>2553168
You van get din rail bus bars so you can cut-down on jumpers a little probably get them from whoever makes the shit you're using

>> No.2553456

I'm a complete idiot and have no idea what I'm doing
With that out of the way, do I daisy chain 2 8 bit shift registers to control a single 16-segment led? Is there a better way?

>> No.2553514

How can i mount an esp32 board into a pcb without actually sodering the board to the pcb? Is there some sort of socket?

>> No.2553521
File: 320 KB, 1156x513, Screenshot_2023-01-31_11-27-24.png [View same] [iqdb] [saucenao] [google]
2553521

>>2553514

>> No.2553528

>>2553521
is 2.54mm the most common?

>> No.2553539

>>2553528
>is 2.54mm the most common?
Yes. It's the quasi default.

>>2553286
You can make that work, but a muxer would be the usual way to go.

>> No.2553555

>>2553456
yep. not really. you could have each segment on its own mcu pin, but thats not really useful

>> No.2553575

I have a nrf52832 and I want to test the max count of bonded devices.
I searched that linux has bdaddr to change my laptop ble mac but it doesn't support my chip intel ax200.
Is there some way to test multiple device bonding with just laptop and nrf52?

>> No.2553579

>>2553575
to add to that, I have some other nrf52 devices and esp32 that I could use also to fill the target nrf52 bonding count.

>> No.2553620

How does IP-camera work? Let's say I have a camera module and get a buffer with video stream on each loop. How do I put it on network via ethernet?

>> No.2553640

has anyone used Nodered or similar? What are the alternatives?

>> No.2553642

>>2553514
>>2553521
By ESP32 board do you mean a dev-board with USB and such, or the ESP-WROOM-32? Because the WROOM has 1.27mm pitch on its castellated vias (0.05"). I think you can still buy pin and socket headers of that size though, so it's an option. There are also sockets for them, both made by the chinese and 3d-printable, but they're pretty big.

>> No.2553648

>>2553642
i meant the dev board, but ideally i'd like to go for the wroom, but i don't understand shit about that, is there a guide or something?

Like, am i supposed to solder pins on those tiny spaced holes?

>> No.2553667

>>2553648
No, you're supposed to solder it to the PCB you've designed to accept it.

They're really not hard to work with, barely different than working with a devboard.
It doesn't have a built in voltage regulator, you'll need to supply it with 3.3v yourself, not 5v.
It doesn't come with a USB bridge, so you'll need a separate programmer like an FTDI breakout/programmer.
If you're feeling frisky, you pick up an ESP32S2 with built-in USB and use https://github.com/espressif/esp-usb-bridge to "make your own" programmer.

Just for shits and giggles, look at a D32. It's based on a typical ESP-WROOM-32 module, so what else does it get you?
A USB port and a CH340C USB-UART bridge, enabling you to easily program it with just a USB cable.
There's a voltage regulator, ME6211, taking power from the USB port and dropping it to 3.3V for you to use.
You'll also find a TP4054 charge controller and a JST connector for a lipo battery. It's also hooked up to the ME6211, and there's a CJ2301 mosfet that isolates the regulator from the battery if there's power coming in from the USB port.
The Enable pin is pulled high, and has a switch hooked between it and ground, giving you a reset button.
Some boards also add a switch between GPIO 0 and ground, so you can easily switch it into programming/upload mode without a separate jumper.

It's all the little stuff to make your life a little bit easier.
If you want a better idea of how to use a bare ESP-WROOM module, take a look at devboard schematics!
You'll see exactly what's between the module and your project when using a devboard.
https://www.wemos.cc/en/latest/_static/files/sch_d32_v1.0.0.pdf
https://cdn.hackaday.io/images/9269711652634663582.png
https://cdn.hackaday.io/images/9253081652634675320.png
Here's an actual reference design from Espressif, it's painfully simple: https://dl.espressif.com/dl/schematics/esp32_devkitc_v4-sch.pdf

>> No.2553670
File: 69 KB, 919x767, 61avZXb85cL._AC_SL1001_.jpg [View same] [iqdb] [saucenao] [google]
2553670

>>2553667
Totally forgot, you may be interested in looking at fixtures.
It's similar to a dev module without the brains built in, sort of a halfway point between a breakout board and a real dev module.
You can just pop in a bare ESP32-WROOM module to work with it, prototype with it, and ultimately program it before you remove it and install it in its final home.
The common Chinese ones run $10-$20 on scamazon.

>> No.2553675

>>2553667
>S2 instead of C3
why though

>> No.2553684

>>2553675
>ESP32S2 with built-in USB
The C3 doesn't have native USB OTG.
It's got some USB capabilities, but it cannot use esp-usb-bridge, which is exactly what was specified.

>> No.2553695

>>2553620
write(net_socket, your_buffer)
optionally compress it first
it's literally just yeeting the frames over the network as fast as they come in

>> No.2553698

>>2553620
Do they still work with HTTP and mjpeg? Pretty complicated unless you have a full OS. You could roll your own protocol and use UDP only, which would make it near trivial.

>> No.2553713

>>2553684
>The C3 doesn't have native USB OTG.
Shit, really? Do they still program via UART, or is there some sort of RISC-V programming hardware that can do debugging and all that too?

>> No.2553718

>>2553667
>>2553670
thanks man, i feel spoiled with so much info, i feel like i should've learned this in college.

>ESP32S2 with built-in USB and use
Is this similar to using the arduino as a programmer?

>D32
This looks cool, but i'm not sure i can find it in europe.

>devboard schematics
i feel dumb looking at all this

>> No.2553719

>>2553713
Still program via UART, typically paired with a common bridge like an FT232 or CH340.
Take a look at one of the official reference designs: https://docs.espressif.com/projects/esp-idf/en/v5.0/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html
Schematic is here: https://dl.espressif.com/dl/schematics/SCH_ESP32-C3-DEVKITM-1_V1_20200915A.pdf

It's used in exactly the same way as the vast majority of ESP32 modules, truly nothing weird or special.
The S2 and S3 are unique in their USB capabilities, but also lack some notable features like being able to feed I2S directly to the DAC.

>> No.2553726

>>2553719
Can you get live debugging via UART?

>> No.2553729

>>2553718
>ESP32S2 with built-in USB and use
>Is this similar to using the arduino as a programmer?
Nope! The S2 and S3 have native USB host capability way beyond what's typical for ESP32 modules.
A notable "example" usage is hosting a USB webcam and streaming the video over wifi.
In the esp-usb-bridge example, it simultaneously acts as a USB->UART bridge, appearing as a COM/TTY port on your computer, and also a USB mass storage device allowing you to drag-and-drop files to program a target device.
It's a versatile example with kind of a lot going on, but the important part is the plain ol' bridge functionality, it provides you with RX/TX lines to use for "whatever."
It even acts as a JTAG bridge, making it that much more versatile! However, the JTAG implementation is slow and bad, it's more of a demo than a useful function.

>>2553713
Sure do!
You can program the S2 and S3 with normal methods like you would any other ESP32, via UART with an FTDI bridge or similar, but also add the ability to program directly via the USB port with ESPs native DFU capabilities.
The port is bidirectional, it acts like a USB-OTG port (but does NOT feature a true USB-OTG implementation!), so it can act as a host or slave as necessary.
With most ESP boards, the USB port is just connected to a UART bridge, but with the S2 and S3 it's connected directly to the native USB port of the module!

>> No.2553733

>>2553726
I've never actually needed to myself unfortunately, I know very little about debugging in this context.

As I understand it, yes, you can do debugging via the native USB, but it comes with limitations.
The implementation is NOT fast, it can't keep up with an actual FTDI or similar chip.
When using the usb-bridge to program other chips, I normally have to drop the baudrate all the way down to 115200, 1/8th the speed I can get when using a real CH340G.
Knowing full well the JTAG implementation is known to be slow and bad, the speed limits that exist when acting as a UART bridge, and Espressif disabling certain features when using the native USB CDC (esp_rom_printf and ESP_EARLY_LOG), I think it's probably a poor choice to use the native USB for debugging.

Thankfully they don't in any way disable you from using more typical methods that I'd imagine will work better.

>> No.2553737

>>2553729
>but with the S2 and S3 it's connected directly to the native USB port of the module
All the boards I've seen have two USB ports, one connected to a UART bridge for programming, and the other used for native USB stuff. I looked into native USB programming on them a few weeks ago and came to the conclusion that it's slightly buggy but works for the most part (something about a manual reset required after programming?) but barely anyone uses it. I'd be surprised to see it used as the primary programming method on a dev-board. If they can avoid that reset issue then it would be possible to make USB projects that can easily upload new firmware to them.

>>2553733
>The implementation is NOT fast
Worst case it takes like a minute to upload, which isn't really inconvenient at all unless you're going trial+error out the ass. Though for debugging I can see situations where a debugger that throttles the CPU speed in order to get all the information live would be an issue.

I'd rather learn the C3's RISC-V than try to wade through whatever the other ESP32s are built on.

>> No.2553740

>>2553718
>>2553729
>Is this similar to using the arduino as a programmer?
I should be more specific.
When using an arduino as a programmer for an ESP32, you're bypassing the entire Arduino! You're just using the USB bridge they typically build into the boards, usually common CH340 chips.
So when you use an Arduino like this, you're bypassing the whole Arduino, and just borrowing the USB->UART bridge that's on the board!
Fundamentally, it's no different than using an FTDI module https://www.amazon.com/s?k=ftdi+programmer

When using the S2/S3 with the esp-usb-host example, it's actually using native USB.
The ESP32 is actually hooked directly to the USB port, using its own dedicated USB hardware inside.
This is a very simple connection, it doesn't "do" anything by default, but the ESP32 S2/S3 can be programmed to do all sorts of USB things.
DFU is easily the coolest (in my opinion) feature, a built-in ability to be programmed over USB without a separate chip/module/programmer/whatever.
You could take a bare ESP32 S2/S3 chip and solder just the 4 wires of a USB port to it, and you're able to plug it in and program it with absolutely nothing else required!

In the esp-usb-host example, the ESP32 S2/S3 is programmed to act like those FTDI / WCH chips.
It's doing a few different things, but the important one is it's acting like a USB serial port, so a computer sees it in a similar way to how it sees a normal FTDI programmer.
This "serial port" is directly connected, via the program running on the S2/S3, to the UART port of the chip.
USB on one side, TX/RX on the other, just like the FTDI or WCH chips!
While slow, it's a good demonstration of exactly what those chips really do. In fact, the WCH chips are purpose-made RISC-V MCUs, just like many ESP32 modules!

>> No.2553743

>>2553737
If your goal is to get down and dirty, such that you actually give a shit that it's RISC-V as opposed to Tensilica/Xtensa, then it sounds like you're on the right track.

>> No.2553745

>>2553740
>You could take a bare ESP32 S2/S3 chip and solder just the 4 wires of a USB port to it, and you're able to plug it in and program it with absolutely nothing else required!
anon don't forget the 3.3v regulator
>In the esp-usb-host example
Do you mean you have to program it beforehand to get it to program via native USB? As in a bootloader? I thought that wasn't the case.

>>2553743
Nah I'm an avrbabby. Was a toss-up between an ESP32 C/S/etc. and RP2040 for my next big project, but I'm pretty sure going for the RP2040 will be better. If only because it has a better ADC.

>> No.2553762

>>2553745
The S2 and S3 can be programmed via their native USB port, they don't need a bootloader added or anything, the DFU functionality that lets them be programmed directly by USB is built right in.

With the esp-usb-host example, they're able to act as programmers for other devices that don't have native USB DFU functionality, like all ESP32s that aren't S2/S3 models.

All the USB C3 S2 S3 DFU CDC UART FTDI WCH talk has so much overlap I'm sure this thread is quickly turning into a confusing convoluted mess.

>anon don't forget the 3.3v regulator
I can assure you it works off 5V directly without a problem for several seconds, minutes even if you're lucky.

>>2553745
>RP2040 will be better. If only because it has a better ADC.
I'd really appreciate it if you could expand on this.
From where I sit, all I see is the same 12-bits but fewer channels with the RP2040, but what I've done with ADCs isn't necessarily what you've done or will do of course.
Has someone objectively compared them? I'd love to see that.

Pic is a reminder that I am old and will die soon.
I'd like to think one day I'll find a use for all of these ancient PICs and AVRs.
I won't, but it's nice to think that way.

>> No.2553764
File: 148 KB, 900x929, deathcomesforyou.jpg [View same] [iqdb] [saucenao] [google]
2553764

>>2553762
Too drunk to click the right button.

>> No.2553768

>>2553764
Does anyone remember Boarduinos?
So fuckin' adorable.
I replaced that 328 at least 3 times, oops.

>> No.2553775

>>2553768
Oh no I'm wrong, it was originally a 168, fuck me I must have upgraded it at some point in the last 14 years. brb gonna kms

>> No.2553776

>>2553762
>they're able to act as programmers for other devices that don't have native USB DFU functionality, like all ESP32s that aren't S2/S3 models.
Ah that's what you're talking about. That's probably useful.
>this thread is quickly turning into a confusing convoluted mess
Yeah, more so even than trying to scour forums for info on how to do anything removed from the arduino ide with an ESP.

>I'd really appreciate it if you could expand on this.
It's just the 500kS/s that I care about.
>only 4 channels
>also 8.7 effective number of bits
Actually maybe it won't be sufficient. I'll go for an external ADC after all. Preferably a delta-sigma so I can cheap-out on the anti-aliasing filter.

>>2553764
I bought a random assortment of PICs, assuming someone made an arduino code that let you upload to PICs using a small pin-header on the PIC board. That is a false reality.

>> No.2553796

>>2553776
You got me curious and I did a google.
https://www.makerfabs.cc/article/cautions-in-using-esp32-adc.html
>vomit.gif
A difference isn't surprising, but fuck me that's orders of magnitude worse than my expectations.

>I bought a random assortment of PICs, assuming someone made an arduino code that let you upload to PICs using a small pin-header on the PIC board. That is a false reality.
Will it hurt if I tell you that's how I've done it for the last 7 years?
https://github.com/stechiez/a-p-prog
Works with any PIC that supports LVP (Low Voltage Programming), which is "pretty much" all of them.
Still workin' fine the last time I used it about a year ago.

Ever seen Pinguino? Started out as Arduino-like boards for PIC MCUs, now it's grown into an entire PIC-based Arduino alternative, with its own IDE and everything. It's old and long since unloved but it's still functional, usable, and some folks still contribute to it with rare library updates. It's particularly well suited for PICs with native USB.

>> No.2553804

>>2553796
Fucking dammit I googled it and didn't realize I caught a stale fork, this is the original UP TO DATE project: https://github.com/jaromir-sukuba/a-p-prog

>> No.2553821

What do you use MCU's without wifi for? Feels like it's a minimum requirement to have something decent going.
I was looking to get into the stm32, but being used to the esp32 makes it hard to come up with something to do with it.

>> No.2553822

>>2548637
Used to work for Dow and as of about 2 years ago damn near everything was Ladder at their Freeport site.

>> No.2553828

>>2553821
Everything ever done with a cheap MCU prior to August 26th, 2014.

>> No.2553831

>>2553828
https://www.google.com/search?q=microcontroller+projects&tbs=cdr%3A1%2Ccd_min%3A1993%2Ccd_max%3A8%2F25%2F2014

>> No.2553851
File: 106 KB, 640x480, 68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f63687269733430382e636f6d2f617474696e7938352e706e67.jpg [View same] [iqdb] [saucenao] [google]
2553851

What can I do with a microcontroller for ants?
>inb4 stick it up your pooper

>> No.2553856

>>2553851
You buy a tiny oled and build a tiny terrible handheld game, play some tiny snake.

>> No.2553926

>>2553821
I think I am going to use Arduino pro Nano and make a oscilloscope out of it, just until I can buy a better oscilloscope.

>https://www.hackster.io/siliconvalley4066/arduino-lcd-touch-shield-dual-channel-oscilloscope-1441bf

>> No.2553938

>>2553796
>vomit.gif
I feel the same.
>Will it hurt if I tell you that's how I've done it for the last 7 years?
What the hell did you google to find that? Because I've been searching for the last 2.

>>2553804
>8-bit PIC
I got a PIC10, PIC12, PIC24, and PIC32, for some ungodly reason. Looks like it won't do anything but the PIC12, but hey better than nothing. I'll see if I can flash that code to one of my cheap ATtiny214s, and cram a programmer onto a little PCB.

>>2553851
Do some mitxela V-USB projects.

>> No.2553953

What hobby microcontroller is the best?

>> No.2553955

>>2553953
What verb is best?

>> No.2553957

>>2553953
attiny
>>2553955
goyslopping

>> No.2553992

>>2553953
Parallax Propeller.
8-core 32-bit RISC 32KB RAM & ROM 32kHz-80MHz dynamically controllable clock rate, dedicated PAL/NTSC/VGA video timing signal generator, built in bytecode interpreter for bespoke Spin programming language, comes in DIP TQFP and QFN.

Why use interrupts when you can use an entire core?

>> No.2553996

>>2553992
BUT WAIT NOW THERE'S THE PROPELLER 2
Eight identical 32-bit processors each with 4 KB of dual-port RAM, a configurable clock up to 320 MHz (8×160 MIPs), 64 configurable I/O pins, and a common hub with 512 KB of shared RAM and a CORDIC math solver.
Ability to execute code directly from register RAM, lookup RAM, and hub RAM.
2-clock execution for all math and logic instructions, including 16 x 16 multiply
Ability to stream hub RAM and/or lookup RAM to DACs and pins or HDMI modulator
It'll spit HDMI, VGA, S-video, NTSC, and PAL with whatever pins you feel like using.
Pixel blending instructions for 8:8:8:8 data
32-bits-per-clock sequential read/write for all cogs, simultaneously
16 KB boot ROM
64-bit free-running counter which increments every clock
Delta-sigma ADC with 5 ranges, 2 sources, and VIO/GIO calibration
8-bit, 120-ohm (3 ns) and 1 k-ohm DACs with 16-bit oversampling, noise, and high/low digital modes
Several ADC sampling modes: automatic 2n SINC2, adjustable SINC2/SINC3, oscilloscope
Logic, Schmitt, pin-to-pin-comparator, and 8-bit-level-comparator input modes
Triangle/sawtooth/SMPS PWM output, 16-bit frame with 16-bit prescaler
Quadrature decoding with 32-bit counter, both position and velocity modes
Synchronous serial transmit and receive, 1 to 32 bits, up to clock/2 baud rate
Asynchronous serial transmit and receive, 1 to 32 bits, up to clock/3 baud rate

Boy they sure make it sound good don't they?

>> No.2554005

>>2553953
bluepill

>> No.2554020

>>2553996
>320 MHz (8×160 MIPs)
>1 instruction per 2 cycles
What architecture? I thought 1:1 was common even for cheap micros, though maybe 1:2 is more common with micros that use external progmem. Not like I understand how you can read even 8xSPI fast enough to get a full 32-bit instruction even in two cycles. PLL up the frequency?

>> No.2554023

>>2553953
>What hobby microcontroller is the best?
...for what purpose?

>> No.2554059

>>2554023
For making an HD USB camera similar to a soldering microscope, for my scientific project. It must be cheap.

No fpga and no asic please.

>> No.2554071

>>2553926
that's a great one

>> No.2554127

>>2553953
RP2040/Pi Pico. Available, cheap, general a good chip, big but onions community.

>> No.2554135

Is there any standard size for a thermo retractable sleeve? What diameter should i get?

>> No.2554142

>>2554127
But it's not a microcontroller, it's a PC with Linux onboard. I need an MCU that I can program myself and show the result on presentation.

>> No.2554144

>>2554142
That's the Pico

>> No.2554147

>>2554144
How 133 MHz and 264 KB SRAM will be able to stream HD video?

>> No.2554151

>>2554142
Google it before talking nonsense, raspberry pi 4b/cm4/zero are SOCs. RP2040 is an MCU

>> No.2554171

>>2540519
thats pretty cool anon

>> No.2554173

>>2541883
>>2550400
kekd

>> No.2554202

Has anyone here built a motion sensor triggered surveillance camera before?

>> No.2554213

>>2554127
Its USB is shit. Even if much better than Arduino USB, which is just a FT serial converter.

>> No.2554231

>>2535428
yes there are special printer for it, no ordinary 3D printers though, cheapest way is milling >>2535772
you can get small mills for such sizes for ~200 bucks

>> No.2554232

>>2542476
we once had similiar problems, issue was that some pin was put on high that shouldnt be, try disconnecting everything

>> No.2554241

So I'm stepping through my stm32-f446re nucleo clock initialization code/function. It's of type void and I call it from an init() function.
I get the PLL configured and working correctly at 180MHz, then I set the PLL as the system clock source. That's the last statement in the function, before the closing bracket, where presumably it would return to the calling init() function.

But stepping through, after setting the PLL as the sysclock, it doesn't return - literally it just keeps running down the code into whatever function lies below it, as if the program counter gets lost or something. I haven't looked at the assembly-level yet, but that's next

What the fuck is happening

>> No.2554245

>>2554202
No, never. What a fresh, unique idea!

>> No.2554249

>>2554245
If it's so common then you should have some tips on how to build it

>> No.2554252
File: 212 KB, 739x806, Screenshot_2023-02-01_13-32-47.png [View same] [iqdb] [saucenao] [google]
2554252

>>2554249
>If it's so common then you should have some tips on how to build it

>> No.2554287

>>2554241
It looks like this might just be the debugger freaking out when the system clock changes. Is there any official/recommended way to make it behave itself when the clock switches over

>> No.2554292

>>2554213
>Its USB is shit
I don't understand, what's shit about it? It can be programmed to be a USB HID, which is more than you can say about a common arduino. Code can also be flashed to it directly through native USB in a convenient method, without needing a bootloader, which is more than you can say for most MCUs out there.

>> No.2554294

>>2554292
It can do only USB 1.1 full speed, which is slow. Also, I couldn't even reach USB 1.1 speeds with their example code.
>flashed to it directly through native USB in a convenient method
Do you mean the USB mass storage interface, which lets you program the flash by copying a file there? I find it very inconvenient and awkward. Something like DFU would have been better.

>> No.2554295

Why STM is so confusing?

>> No.2554300

>>2554295
What's confusing about it? I never used them though.

>> No.2554357

Is the esp32 cam worth it?

>> No.2554361

Is it possible at all to have a camera capture at 4K and at least 30 fps with hobby-level stuff? And I'm not talking about jpeg compressed video.

>> No.2554411
File: 276 KB, 2400x1200, sample.jpg [View same] [iqdb] [saucenao] [google]
2554411

>>2554357
It's worth <$7. The image quality can be decent with a good 2A power supply and full daylight.
However, for video, especially anything with less than full sunlight, the quality goes to shit in a hurry. It can only handle so much, you have to balance your desired framerate versus image quality. The cheap common Ai-Thinker clones are the worst, but cheap enough to make up for it in my opinion. Well designed boards can handle higher framerates with less noise and perform a little better in low light.

Here I just took some shots in a well lit room with a $5 ESP32-CAM, all captured at 800x600.
Top row shots all with settings that I can stream at 10FPS "smoothly," bottom row is all with settings that can't maintain 1FPS.

For some tasks, they're excellent. Outdoors, they're cheap as fuck and work great in full sun, plenty to like about them. Overall performance isn't anything stellar, but there are fancier options that provide a similar experience if you need them, like the M5Stack ESP32 Camera module with the OV3660. They're better in every measurable way, except price.

>> No.2554413

>>2554361
Define hobbyist?
Jetson Nano, there are Youtube tutorials for recording 4K 30FPS with a Jetson Nano.

>> No.2554416

>>2554411
Seems good enough for what i want, it'll be in the sunlight, i want either video or video with extremely low fps, i don't mind it.

What do you use to power it and program it?

>> No.2554421
File: 70 KB, 679x660, 81NTgZiQJgL._AC_SX679_.jpg [View same] [iqdb] [saucenao] [google]
2554421

>>2554416
For programming, you use whatever you want, an FTDI or similar programmer is an easy way to go about it.
I use an ESP32S2 as a programmer with Espressif's esp-usb-bridge firmware.
The easiest most convenient way would be using the purpose made programmers specifically for the Ai-Thinker clones, picrel.
They're inexpensive on Ali or when purchased with a bunch of camera boards, and they're brain-dead simple to use.

For power, they require 5V input for the camera, and have their own 3.3V regulator onboard for the ESP module.
So I add a micro-usb port for 5V and ground, cheap and easy.
At that point any normal USB power supply will do the job, I use old phone chargers, but I highly recommend one that's rated for at least 1.5A output, 2A is better.
Below 1.5A, the cheap cameras tend to be less reliable, and depending on the power supply the ESP might even brown out and reset when taking a photo or turning on the LED.

For software, obviously you can start from scratch and do your own thing if you want, but there are plenty of ready-to-use solutions.
If you want a drop-in to use it as an IP camera without much fuss, I recommend this: https://github.com/easytarget/esp32-cam-webserver
There are plenty of modified/forked versions of the Espressif streaming camera example, but this is my favorite, and in my opinion the most refined.
It also has OTA support, so once it's been programmed once, you no longer need to use the programmer and can just update it over Wi-Fi if needed, convenient as fuck.

>> No.2554424

>>2554421
I should add, you can also just use those cheap programmers as your power source if you want.
You can just leave the ESP32-CAM connected to it and just power it through the micro-usb port.
It works fine, but it leaves the CH340 powered all the time. If you're running off battery power, especially if it's backed by solar and not by you charging it, then it's a significant amount of waste, it can easily double the deep-sleep power consumption in some setups.
If it's going to live plugged in all the time, the amount of power it wastes is totally negligible, only a small fraction of the power it consumes while actually streaming video.

>> No.2554435

>>2554421
Tell me this. In all the examples people use JPEG:
> config.pixel_format = PIXFORMAT_JPEG;
even though the camera supports native RGB, YUV and grayscale:
> pixformat_t pixel_format; //!< Format of the pixel data: PIXFORMAT_ + YUV422|GRAYSCALE|RGB565|JPEG

If you change it to one of those formats camera will work 10 times slower and you will get around 10 fps with resolution 96x96 pixels. With usable resolution it basically does not work.

Why? I need the pixel data at usable framerates.

>> No.2554436

>>2554421
Man, you make this thread, so much help, are you a bored professional or something?

>https://github.com/easytarget/esp32-cam-webserver
oh i've seen this, my only concern is if this enables me to embed the video in something like nodered or some sort of frontend coupled with other stuff around it.

Glad you mentioned the aithinker stuff, i almost comited that mistake.

As for the programmer, i can't find those specifically made ones so i guess i'll go with an FTDI.

>>2554424
Solar sounds fucking nice

>> No.2554442

>>2554436
> As for the programmer, i can't find those specifically made ones so i guess i'll go with an FTDI.
They are called ESP32-CAM-MB. Mine does not work, so I just use FTDI

>> No.2554445

>>2554442
yes, i meant i can't get those in europe, it's a pain in the ass to import

>> No.2554446

>>2554445
I'm in Europe. You should try get it, if it works for you it's definitely worth, because using FTDI is pain in the ass.
https://www.berrybase.de/en/esp32-cam-mb-usb-zu-seriell-schnittstelle-fuer-esp32-cam

I'm not the guy who wrote you first though. I'm the one who had a lot of issues with esp32 cam in general and got no real solutions to my problems.

>> No.2554451

>>2554446
thanks for the link, that's perfect

>I'm not the guy who wrote you first though. I'm the one who had a lot of issues with esp32 cam in general and got no real solutions to my problems.
In this thread?

>> No.2554456

>>2554451
Its not in stock there, I just saw it. Get your board from eBay, they are bundled with the programmer already.

> In this thread?
I asked here as well, yes, but it's not problem of this thread. It's just the issues with camera+drivers+esp32. It let's you do just one thing "stream jpeg video over wifi or take jpeg images and save them on SD card". If that is what you want, then you are fine.

>> No.2554477

>>2554436
>are you a bored professional or something?
No I'm just a long-winded autist, so I regurgitate en masse and am incapable of making brief comments.

>>2554435
> In all the examples people use JPEG [...] even though the camera supports native RGB, YUV and grayscale [...] Why?
It's because the camera is doing the compression work! In JPEG mode, the camera is doing all the heavy lifting, and spitting out compressed data, that's getting shot into RAM (PSRAM) as quickly as possible.
Let's say you take a shot at 800x600, reasonable settings, typical 10FPS stuff for an ESP32-CAM.
In JPEG mode, you're looking at 20-30 kbytes per frame, I'll just say 32 for fun/ease, so 320 kilobytes/s to maintain 10FPS (though in reality it'd vary from frame to frame, typically in the 20-30 kbyte range at 800x600).
In RGB mode, that'd be 1,440 kbytes per frame, so you need 45x the throughput, 14.4 megabytes/s.
There's your performance.

>> No.2554479
File: 39 KB, 508x412, 9fba1c127ce32da72ec9e5ebca7dd1720c5a3b58.png [View same] [iqdb] [saucenao] [google]
2554479

>>2554477
I missed one
>>2554436
> if this enables me to embed the video in something like nodered or some sort of frontend coupled with other stuff around it.
Absolutely, you can access it like a normal MJPEG video stream with things like Octoprint, VLC, or directly in a browser, anything that can display an MJPEG stream.
Yes, that includes nodered, picrel (not mine) showing a local MJPEG stream.

>> No.2554482

>>2554477
ackshewally they run in a 16-bit RGB mode, so 22.5x the throughput, 7.2 megabytes/s.

>> No.2554484

>>2554477
What you mean is it's not actually ESP32 MCU doing the JPEG encoding, but internal camera chip hidden under the hood somewhere in camera? I've destroyed one camera for science and didn't find a substantial piece of silicon there.

What MCU is capable of storing grayscale in PSRAM with at least 20 FPS at let's say 640x480? I don't need full RGB, just a native grayscale.

>> No.2554490

>>2554435
>Why? I need the pixel data at usable framerates.
Does it have to be real pixel data, is that actually important for your project?
Converting from the compressed format into an RGB array is easy and fast as fuck if you don't need "real" pixel data.
It can also convert to grayscale on the fly, from that you can quickly have an array of pixels that are super fast to work with and still gives you more useful data than luminance alone (grayscale isn't luminance).

>> No.2554497

>>2554484
>internal camera chip hidden under the hood somewhere in camera?
In addition to the sensor array, the OV2640 also has an on-board ASP, DSP, ADCs, and an entire dedicated microcontroller that runs the whole bitch!
That's kind of the point of the whole OmniPixel family.
Complete camera and image processor. All the image quality stuff, contrast, saturation, lens correction, scaling, compression, all handled internally.
Just have to talk to it over SCCB, OmniVision's I2C compatible serial interface, so anything that can reasonably handle I2C can handle an OmniPixel camera.

Cool shit ain't it?

>> No.2554496

>>2554490
> Does it have to be real pixel data, is that actually important for your project?
I want to check the brightness as certain frame areas, I don't know how to answer this question correctly.

> Converting from the compressed format into an RGB array is easy and fast as fuck if you don't need "real" pixel data.
> It can also convert to grayscale on the fly, from that you can quickly have an array of pixels that are super fast to work with and still gives you more useful data than luminance alone (grayscale isn't luminance).
I feel super uncomfortable. How raking ans storing a grayscale buffer in PSRAM is 10 fps, but converting the same buffer stored in PSRAM is faster?

Can you please explain more and how to do it? There is a jpeg convertor, but on esp32 it works with speeds around one frame every 500ms, hence 2 fps. How is this super fast?

>> No.2554508

>>2554496
https://github.com/bitbank2/JPEGDEC
What you're describing, let the camera do the scaling (and convert to grayscale if desired), use JPEGDEC to rapidly decode the images, should manage 320x240 at 20FPS.
You say you want to check the brightness of certain frame areas, well what areas? What are these areas shaped like?
At 640x480, that's 307,200 data points per frame, 6.14 million individual brightness samples per second, do you actually need that for what you're doing?
Any reason not to tell the camera to scale down to 160x128? You could capture and decode at over 60FPS, with over 20,000 samples in every frame, leaving you lots of overhead for whatever you're doing with that data.

>> No.2554513

>>2554508
Thank you so much, I will try it.

Yes, I can compromise the frame size. Right now I have a grayscale video 96x96 with 12 fps. If I get grayscale 160x128 at 60 fps I will be happiest man on the earth. But for some reason I feel its impossible...

There will be bright spots on the frame, X/Y positions of which I need to find from the array of pixels.

>> No.2554518

>>2554513
Higher framerates will give you more useful data to work with than higher resolutions.
There will always be noise, always. If you can push higher framerates, there are very simple ways to combine/compare frames to isolate useful data. If you can manage 60fps for example, you could potentially compromise for a cleaner and more useful 30, 20, or 15 fps.

>> No.2554527
File: 123 KB, 1200x965, 1675306482221.jpg [View same] [iqdb] [saucenao] [google]
2554527

>>2554518
I just loop over the array and pick all pixels which are brighter than certain value. That works for me just fine.

I will check that library during this day and report here. Can you please check the thread tomorrow for my reaction?

>> No.2554542

>>2554527
Looking forward to it!

>> No.2554571

>>2554241
i agree with >>2554287
whenever i try to debug before the clocks are set up the shit gets weird. if im debugging and need to step through stuff i just chuck a break point in main after the clocks are set up

>> No.2554574

>>2554295
gonna have to narrow it down there bud, otherwise we cant help

>> No.2554578

>>2554513
theres a complete solution for this already.
96x96 resolution, 120 fps, spits out XY of each "spot" over SPI
caveat is that its infrared only

>> No.2554709

>>2554413
>Jetson Nano
A small desktop or smartphone computer, as far as I'm concerned.

>> No.2554766

>>2554542
Well I tried it, and I can't get it to work. Simply putting a buffer into decode function does not work, it has some issues with buffer size. Decoded frame becomes 160x8 instead of 160x120 and I have a feeling decoded pixels are broken as well.

I will have to debug it and there's no documentation of course. I'm not a programmer and it makes me feel miserable. But I guess there's no choice.

>> No.2554800

>>2554542
I dont understand what the author of the library did there. I need an array of pixels and im pretty sure there's no way to obtain it. Unless it obfuscated somewhere the method to do exactly this.

>> No.2555086

>>2554571
Now I might just be retarded, but I initialize my clocks from within main (my clock config function is in my init() function, which itself is in main)

is there some way I'm supposed to be setting up my clocks before main is invoked? There's also the annoying habit of STMCubeIde "inserting" a break point at main and stopping execution there even when there's none explicitly enabled there

>> No.2555316
File: 288 KB, 863x398, Untitled.png [View same] [iqdb] [saucenao] [google]
2555316

Is there an atmega programmer that includes serial throughput-like feature?
Basically I want a single device that can both program an atmega328p without a bootloader and provide serial output for debugging purposes.
Currently I'm using USBasp + separate CH9102 serial (pic related), but it's pain in the ass swapping them all the time.

>> No.2555320

>>2555316
consider using the debugwire pin(s) to upload a program instead, there's support for debugging a 328p via gdb. you'll have to figure out what hardware that requires though, looks like the atmel ice is probably required. but some guy seems to have modified a cheap stlinkv2 with custom firmware to be a debugwire transceiver.

>> No.2555404

Guys, i have this code,, i'm trying to control a relay with the time, but i have a manual mode that should ignore the hour restrictions. This code is giving me a problem where i have to turn manual mode on and off for changes in the setnumber variables to take effect, otherwise it just keeps the relay on.

bool manual_mode;

other function(){
if(buttonpress = high){
manual_mode = true;
}
else if (buttonpress = low){
manual_mode = false;
}
}
void loop(){
if(!manual_mode){
if(timeinfo.tm_hour >= setnumber1 && timeinfo.tm_hour < setnumer2){
digitalWrite(stuff,HIGH);
}
else if(timeinfo.tm_hour <= setnumber1 && timeinfo.tm_hour > setnumber2){
digitalWrite(stuff,LOW);
}
}
}

>> No.2555405

>>2555404
no idea why code formatting didn't work

>> No.2555479

>>2555404
without supplying a schematic too many assumptions need to be made about the hardware to help with your tarduino code. though your issue screams not handling button input properly

>> No.2555502

>>2555479
It's not that, i know i should've had == on the code, the issue isn't there.

>> No.2555505

>>2555502
Does tarduino actually not show the compiler warnings when you use = like that in an if statement?
-Wall -Wextra chads rise up

>> No.2555511

>>2555505
that's an error only commited when i copied the code here, in the original it's not like that because i have a different, but equivalent, condition.

>> No.2555602

>>2545447
i know that all the rockchip sbcs suck because they can even run main line kernel

>> No.2555640

>>2555602
Ah jeeze, without that you can't do all the things that they're used for.
How are you going to play emulated NES games or browse Reddit without an main line kernel?

All the RockPi 4 models run mainline.
Most of the Orange Pi offerings also run mainline.

You didn't actually look into this at all, you're just shitting out loud because you don't want pay scalper prices for a Raspberry Pi.

>> No.2555658

Any help with IS31SE5117 touch chip? Can't get it to change pages and I've been banging my head against the table for several hours, going to try wall soon

>responds to i2c - no issues
>by default connected to some touch pads, they detect touch and reflects in registers
>try page swap for gpio mapping
>page swap value changes registers, still can read same touch key value
>try system reset, restore to default, write to flash etc settings in various combinations
>no change

I don't see any reference to 9 or 10 bit addressing so writing to page register should switch to different register bank
Or alternatively, I suspect chip is shit as default firmware version is not same as "default" in datasheet


>>2555404
Not sure but I suspect missing "=" in if(x) checks. "==" is for equal check, "'=" just sets value and returns if bool if operation was completed or not

>> No.2555664

How sturdy is the RPi Pico's USB port? will it rip out in regular usage?

>> No.2555665

>>2555404
>>2555658
Just saw reply
Another issue - for "stuff" write you set conditions in else if.

I assume setnumber1 will aways be lower than setnumber2, it will execute either first if condition (if it meets) or skip else due to hour not meeting both <setnumber1 and >setnumber2. Might want to change to "||" for that

>> No.2555696

>>2555665
>I assume setnumber1 will aways be lower than setnumber2
That's correct, but i can't have two "else if".
Not sure if i understood the rest of your comment. I want to have a window of hours, so i have a minimum hour and a maximum hour, say for example, 16 and 24.

>Might want to change to "||" for that
Where? If i want to have a window, like i said, i need two values no?

>> No.2555700

>>2555696
Error is here
>else if(timeinfo.tm_hour <= setnumber1 && timeinfo.tm_hour > setnumber2){
>digitalWrite(stuff,LOW);
In this case setnumber1 must be higher than setnumber2 otherwise if(x) check fails and you skip "stuff" LOW write

>> No.2555703

>>2555700
oh, so it's just the order then? like
>else if(timeinfo.tm_hour > setnumber2 && timeinfo.tm_hour <= setnumber1){

>> No.2555707

>>2555696
>>2555700
To expand on answer

>if(condition)
>{
> if(hour>=16 && hour<24)
> {
> do stuff inside window
> }
> else
> {
> do stuff outside window
> }
>}

if you do want else if() check - you can add else after like this.
> if()
> else if()
> else
But for hour window check, there will be two states - either inside window or outside window, so just
>if()
>else
is suficient

Or if you absolutely want that useless check, for your case you need to replace && with || so that it executes command if (hour>24) or (hour<16)
>else if(timeinfo.tm_hour <= setnumber1 || timeinfo.tm_hour > setnumber2){
>digitalWrite(stuff,LOW);

>> No.2555711

>>2555707
i get it now, thanks, i just don't understand why it didn't work as it was, even if useless.

|| wouldn't work as intended, for example, if it was 22 hours, and the time window was set for 16 minimum and 20 maximum, || would make it meet one of these, but not both.

>> No.2555715

>>2555711
|| is OR operator
&& is AND operator
a || b >> if a or b meets condition, return true and perform operation
a && b >> both a and b must meet condition to return true

Your first check
>if(hour>= 16 && hour<22)
checks if hour is in window
your second check in
>else if(hour <=16 && hour >22)
might return true on (hour<=16) but false on (hour>22) but because it's operator && - it will skip function in (if(){}) and with no (else) - just continues on without doing anything
with || operator - (hour<=16) or (hour>22) - if any of these two is true, it will perform whatever is in if(){} loop.

>> No.2555721

>>2555715
i think i finally understand the problem. Let's say that the time windows is 16 to 20, and current time is 22 hours.

so, hour = 22.

>if(hour>= 16 && hour<20)
Only one is true so it doens't execute.
>else if(hour <=16 && hour >20)
Only one is true, so not execution either, and only one of them will ever be true, even if hour is 5 or 15.

I'm just dumb, i thought of this initially when i was thinking of the functionality but then it never clicked again.

Thanks anon, may whatever god you believe in repay all your good will.

>> No.2555732
File: 3.08 MB, 3072x4096, 699b967d-a024-4f78-bfaa-2bca423a0293.jpg [View same] [iqdb] [saucenao] [google]
2555732

Is this enough to be respected around here?

>> No.2555745

>>2555732
Looks like someone got a $20 Amazon Gift Card, good for you buddy.
Now make 'em do a thing.

>> No.2555750

>>2555745
ima go ahead and just say it. The pico is underrated, it's small, well built (one of those esp32 has a solder ball) and does most of the stuff like the others. Also, the arduino nano is 4x more expensive.

>> No.2555756

>>2555750
The best thing about the Pico is the Raspberry Pi name behind it making it popular by default.
More people, more interest, more backing, more documentation, more examples, more community.
Want to do something with the Pico that nobody has ever done before? Good fuckin' luck with that, there's probably a year-old forum thread covering every stupid idea you can come up with already.
Really can't overstate how easy it is to work with something that's overwhelmingly popular.

>> No.2555773

Does anyone else hate the Arduino? The old architecture. The 5 volts. The shitty software ecosystem.

>> No.2555803

>>2555773
>old architecture
8 bits is still more than enough for a lot of projects out there
>5V
just run it off 3.3V
>shitty software ecosystem
use avr-gcc and avrdude with your text editor of choice

the only thing holding you to mediocrity is yourself

>> No.2555836
File: 2.94 MB, 800x450, ssd1331.webm [View same] [iqdb] [saucenao] [google]
2555836

>> No.2555838
File: 2.96 MB, 800x450, ssd1306.webm [View same] [iqdb] [saucenao] [google]
2555838

>> No.2555846
File: 74 KB, 655x562, 1675438518702.jpg [View same] [iqdb] [saucenao] [google]
2555846

>> No.2555950

>>2555502
wasnt talking about the = sign. i also noticed you dont initialise the manual mode variable. the symptom of your error seems like its never entering the code beyond the manual mode check. another thing to check on, is if the button is active low with a pullup resistor then the system will never enter beyond the if check. all these things point towards the input and variable not being handled properly

>> No.2556017
File: 1.92 MB, 498x498, 1675503706812.gif [View same] [iqdb] [saucenao] [google]
2556017

Well RIP, the guy explaining me how camera works on esp32 went missing.

>> No.2556145

>>2555950
oh, that was just me not wanting to copy a huge chunck of code, i had it initialized originally. The issue is solved tho, it was what the other anon pointed out, cheers.

>> No.2556206

>>2554800
This might be a hard one to explain, you most certainly can get an array of pixels if you'd like.
The ESP32 example in JPEGDEC does what you need, it demonstrates it perfectly, and it's well commented.

A jpg image is broken into units of a given size, the Minimum Coded Unit or MCU, which is "typically" 16x16 pixels.
JPEGDEC is your gopher here, it's grabbing and decoding as many MCUs as it can for each run of your "draw" function, it'll do this for up to 4000 pixels per call.
You have to assume that your draw function might be called multiple times, even very small images will be calling it repeatedly.

Here's some loose and incomplete code that may help:
void loop()
{
camera_fb_t* frame = esp_camera_fb_get();
jpeg.openRAM((uint8_t*) frame->buf, frame->len, drawMCUs); //Gimme dat frame
jpeg.setPixelType(EIGHT_BIT_GRAYSCALE); //Only use what you need, 256 shades of gray is plenty.
jpeg.decode(0, 0, 0); //Here we're doing a decode at the origin (0,0) at full scale (0). The OV2640 can do scaling for us, so let it.
jpeg.close(); //Never forget to tell it to fuck off
}
When jpeg.decode runs it's going to call this function, drawMCUs, as many times as is necessary until it's decoded the whole image.
int drawMCUs(JPEGDRAW *pDraw)
{
int iCount;
iCount = pDraw->iWidth * pDraw->iHeight; // number of pixels to draw in this call
Serial.printf("Draw pos = %d,%d. size = %d x %d\n", pDraw->x, pDraw->y, pDraw->iWidth, pDraw->iHeight);
//For whatever block of pixels happens to be decoded on any given pass, we know how big it is, and where it is relative to the origin.
//The easiest most readable solution would probably be to just loop these pixels directly into a 2-dimensional array.
//Probably a million reasons not to do it that way, but it'd be good for wrapping your head around what's happening.
return 1; // return 1 to tell JPEGDEC to continue decoding.
}

>> No.2556211

>>2556206
I hate C++ so much.

>> No.2556221

>>2556211
I don't notice the difference when working in C, C++, C#, Javascript, or Python.

Really the only language I've ever had any bias against was Java, and that's because I was forced to use it in school and god damn I didn't enjoy the experience. Two semesters to get through the equivalent of a Youtube tutorial.
The final covered Variables, Comments, Type Castings, If/Else, For Loops, Arrays, and writing to files. Horrendous waste of time at shit-tier college.

>> No.2556231

>>2556221
>C
Outdated language, maintainers refude to update it, lacks modern (and good) concepts, but still does its job.
>C++
Overcomplicated. In the 90s, they tried to push any modern concepts into it (and in the 10s again), so now it's a wreck which nobody fully knows. Some love it because it picked up some concepts from the 80s which C still lacks, but nobody but sage-level experts know the full language, because it's so complex and huge.
>C#
Completely different language, sometimes called Microsoft's Java, but truth to be told, even though it's Microsoft's Java, it's adds some C concepts which make it not as much awfully Java,
>Javascript
Completely different language again. Superficially similar to Java, is part of the C syntax family for superficial reasons only.
>Python
The fuck, this doesn't even have any similarity to the C family of languages. Since it's a GC-dominated language, it's most similar to JavaScript or C#. But its syntax is so different, at most you could say it borrowed some minor syntax elements from C, like some operators.

>> No.2556266

>>2556221
>Two semesters to get through the equivalent of a Youtube tutorial.
Same here.

I don't have any experience with Python, but to me it feels like bash.

>> No.2556268

>>2556206
> you most certainly can get an array of pixels if you'd like.
But can you give me a variable name where pixels are stored?

>jpeg.setPixelType(EIGHT_BIT_GRAYSCALE); //Only use what you need, 256 shades of gray is plenty.
I did this and it won't work because developer has an obvious bug there - pixels are always at 16 bits because that's how he stores that temporary array with uint16_t.

> Serial.printf("Draw pos = %d,%d. size = %d x %d\n", pDraw->x, pDraw->y, pDraw->iWidth, pDraw->iHeight);
This will only print size of the frame and corner position, no pixels.

> The easiest most readable solution would probably be to just loop these pixels directly into a 2-dimensional array.
Exactly this is my problem. If it does not have an array of my pixels I will have to store a 160x120=20k 16 bits values array in memory every single time 50 times per second. This is impossible on any smol microcontroller. Without decoding the buffer is "rolling" on camera and I have a pointer to it, so I don't copy anything. Here I will have to copy, hence all this fast decoding does not make sence to me. I thought I'm wrong, but you wrote Exacly my point, so it seems my conclusions were correct.

>> No.2556275

>>2556268
>But can you give me a variable name where pixels are stored?
Name it yourself, it doesn't exist yet.
You've gotta make it and fill it with pixels.

>I did this and it won't work because developer has an obvious bug there - pixels are always at 16 bits because that's how he stores that temporary array with uint16_t.
Look at jpeg.inl to see how it actually works. EIGHT_BIT_GRAYSCALE works perfectly fine, and delivers 1 byte per pixel.

>This will only print size of the frame and corner position, no pixels.
Yeah, that's the point. Showing you useful information about the data so you can verify that it's working as predicted.

The library turns jpegs into arrays of pixels, that's all it does, it just doesn't do the WHOLE image at once so it's up to you to deal with the chunks.
The easiest thing to do is assemble the chunks into one array, your singular array of pixels.

At 8-bit greyscale 160x120(QQVGA), you've got 19.2kbytes per frame, on a device with 520 KB SRAM and another 4MB PSRAM if you're running on a $5 ESP32-CAM with XCLK at ~12MHz (probably, maybe higher).
You've got space out the ass, and you only need to store one frame at a time.
Frame decodes from camera to array of bytes, you perform your checks on the array and log the info, the next frame comes in.
What you're describing is totally achievable at the framerates you're describing on an ESP32-CAM board, assuming what you're doing to your array of pixels isn't terribly costly.

>> No.2556291
File: 77 KB, 674x643, LED shift register.png [View same] [iqdb] [saucenao] [google]
2556291

When programming for a shift register how do I make sure in my code that the clock and serial in wave are shifted slightly like so?
In the example the data transmitted is:
1010101
But only OUT0 and OUT7 are high
What gives?

>> No.2556295

>>2556291
Oh I'm guessing they just didnt bother including the other outputs and it's LSB

>> No.2556304

>>2556291
after the shift, pulse the latch then lower the enable.

>> No.2556307

>>2556304
No I mean how do I phase shift the clock signal by 90° compared to the serial in signal in code?

>> No.2556309

>>2556275
>Look at jpeg.inl to see how it actually works. EIGHT_BIT_GRAYSCALE works perfectly fine, and delivers 1 byte per pixel.
It does in jpeg.inl but not in the draw structure. It gives 16 bits at the end anyways.

>The library turns jpegs into arrays of pixels
Then give me the name of those arrays of pixels please.

>> No.2556314

>>2556291
Honestly it's probably fine to just do the transitions of the serial-in line on the falling edges of the clock, because the clock only triggers on the rising edge. Check your MCU's SPI docs, it may well already do exactly that and also toggle the CS line such that the latch rising(?) edge occurs after writing a byte, which would make it a lot easier than bit-banging. Even if not you can probably add an inverter or two for it to work properly.

>> No.2556361
File: 1 KB, 160x120, testImage.jpg [View same] [iqdb] [saucenao] [google]
2556361

>>2556275
Okay, I played with it and figured how to assemble the array. But there are still two problems:
1. EIGHT_BIT_GRAYSCALE is bugged. It just is, im sorry, it gives some random artifacts which made my head blow. Im not a programer but the results without using this command are fine. And i really need grayscale ffs...
2. struct jpeg_draw_tag-pixels gives uint16_t which is 16bits no matter what, line 113 in JPEGDEC.h

Can you please check it on my test image and test code? You dont need camera for this, just an esp32:
https://hastebin.com/share/ifobidigiz.cpp
https://hastebin.com/share/hiradiqiwu.cpp

>> No.2556912

How do you guys make extensions for module's cables? I feel like the only way is to just solder wires to them and them couple them together with tape or something, is this the way?