[ 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: 426 KB, 551x405, arduino.png [View same] [iqdb] [saucenao] [google]
1165266 No.1165266 [Reply] [Original]

ITT post anything related to arduino

Anything goes

>projects
>advice
>help

>> No.1165272 [DELETED] 

>starting a thread with no content, just for the sake of having a general topic thread

kys, you're the cancer that's been killing this site for years. There are already other threads up on this board where you can do everything you just listed out in your post. You just killed a thread to make way for this useless one. You monster.

>> No.1165300

>>1165266
/g/ would probably be a better place for this, no?

>> No.1165526 [DELETED] 

>>1165266
>Dear mods,
>Please ban OP for
>being a cancerous
> Faggot
>Love Anon

>> No.1165542 [DELETED] 
File: 697 KB, 1154x1192, Capture+_2017-04-17-10-23-28.png [View same] [iqdb] [saucenao] [google]
1165542

>>1165526
>>1165300
>>1165272
>>1165266
When you just wanna talk about arduino but 4chans autistic superpowers decode your writing patterns and find out your a newfag.
Congrats op, you played yourself.

>> No.1165683 [DELETED] 

>>1165542
>>1165526
>>1165300
>>1165272
>>1165266
tfw No one uses this forum, so it's not a big deal when ppl post shit like this. It just has a bunch of cucks going around attempting the spread of their disease.

For fucks sake, this thread is going to be a day old, barely anyone has posted on it, and it's still going to be here tonight. You know that your chan is dead when that happens. And you guys are most likely the ones responsible for killing it.

How about you guys do yourself a favor, go to /b/ and shove some shit up your ass to some chicks with dicks.

>> No.1165709
File: 201 KB, 1632x1224, ir seq1.jpg [View same] [iqdb] [saucenao] [google]
1165709

>>1165683
agreed

I'd like to see some uC projects. It was /diy/ that inspired me to get one in the first place.

>> No.1165723

The only kind of thread we ever get is "whadda I do wit de Ardy" and "give me idea for Raspy proj pls" though.

>> No.1165844

>>1165709
I like it

>> No.1165850
File: 2.61 MB, 4128x2322, 20161122_230038.jpg [View same] [iqdb] [saucenao] [google]
1165850

>>1165709

Interesting. What's your project?

>> No.1165855

>>1165850

Never mind. I see your IR transmitter and receiver LEDs.

Are you getting codes from known remotes or just dicking around?

>> No.1165887

>>1165855
Any NEC code.
>https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol
It generates a pronto code as an intermediate step
>http://www.remotecentral.com/features/irdisp1.htm

It's been a few years, had to look at the code.
It's built up to use like this:
>xmitNEC(0x4012); //my tv's power

>> No.1165914

im making a code to dim LEDs, does anybody know where i can find one, that is already made :)

>> No.1166007
File: 7 KB, 480x360, hqdefault (6).jpg [View same] [iqdb] [saucenao] [google]
1166007

>>1165272
Unironically is a cencerous faggot.

Starts thread with kys and then shits on OP.

Honestly doesnt realise what a faggot he is being.

>> No.1166008

I have an analog sensor attached to my arduino, and I'm trying to read data from it using PySerial in Python (readline function). The output is supposed to be a string with 200 values followed by a newline character (the sensor outputs 200 readings at once).

My code collects a proper output about half the time, and half the time Python throws various errors like "invalid start byte" and/or reads only part of the line before throwing an error.

I'm trying to debug this shit, so my question is: is it possible that the serial output from my arduino uno is outputting inconsistent lines? Or is it possible for PySerial to begin reading from the sensor mid-line?

Alternatively, what are the best practices for debugging this kind of inconsistent serial error?

>> No.1166069

>>1165887

Very cool. Might have to get my old launchpad out and mess with it.

>>1166008

>"invalid start byte"

What is the typical start byte for C++ and what is the typical start byte for Python? Maybe they're different and you have to put some code in there for that exception to convert it.

>> No.1166147

>>1165914
If that's all it's doing, putting it in a run loop would be easiest.
Get code that blinks an LED. Lower the delays to the point you can't see it blink. Adjust ON and OFF delay times for brightness.

If a run loop isn't practical, you'd use the timer and interrupts for PWM on the MSP430. I'm not sure about the specifics with an arduino

>> No.1166226

>>1166008
Readline will have a timeout, if it doesn't get a newline character after a certain amount of time then it will throw an error.
If it starts reading while arduino is in the middle of a transmission it will miss part of the data, hit the newline then won't have 200 values.
If the timeout isn't long enough and you start reading too early it will break out before getting the newline, increase the read timeout.
If it works half the time then its half way done! Good job. Getting it working robustly is tedious but very rewarding, seriously consider exactly what is going on behind the scenes, where the data is and what the computer is expecting.

>> No.1166522

>>1166147
ye my code its a like that but i dont know there should be a library with, like lvls to adjust that haha i just tested a motor and it slows it down as i want, thanks for responding

>> No.1166537

>>1166008
What's your baud rate? How do you manage the read rate on the Arduino end? That's a really long line too.

>> No.1166726
File: 297 KB, 8664x4256, 40j12e2a.png [View same] [iqdb] [saucenao] [google]
1166726

My first project is a PID-controlled ball-and-plate system. I also ordered a tank chassis from Aliexpress. Not sure yet what to do with it. Maybe some kind of lasertag-like IR-tank toy.

>> No.1167315
File: 1.56 MB, 640x348, 1493122259687.gif [View same] [iqdb] [saucenao] [google]
1167315

I wanna get into this sort of stuff as it is interessing for me.
Where should I start?

>> No.1167321

questions:

can I expect an arduino to have the same reliability as a PLC?

anyone have a good resource for turning an arduino prototype into a production piece? ie. using only the necessary components for the application so rather than buying an arduino per item, I'd just buy the cpu and necessary parts, nothing unnecessary

>> No.1167661
File: 268 KB, 750x750, AK Electronic Brick Kit 020.jpg [View same] [iqdb] [saucenao] [google]
1167661

>>1167315
Get one of those arduino-clone starterkits from ebay or aliexpress (should be around 25$). They usually include a breadboard, servo, stepper motor, sensors, leds and a shitload of small parts. Pretty easy to get into it since there is plenty information on projects you can do with those.

>> No.1167710
File: 68 KB, 1024x708, Rotary_Stepper_Schematic.png [View same] [iqdb] [saucenao] [google]
1167710

So I'm trying to drive two stepper motors using two rotary encoders. I need you guy's help on the coding part.

My set-up is essentially the same as the picture attached. I instead used a Mega board and led the second stepper motor's In1, In2, In3, In4 to digital pins 22, 23, 24, 25. And the second rotary encoder to digital 5, 6, 7.

The code I'm implementing is the one in this link:
https://brainy-bits.com/blogs/tutorials/stepper-motor-rotary-encoder-p1?

>> No.1167764

>>1167710
https://www.arduino.cc/en/tutorial/stepperSpeedControl
https://www.arduino.cc/en/reference/stepper

>> No.1168090

>
>>1167321
Check out the schematic and one of those "build your own" guides. Basically, you need 5V, a switch, and probably an external crystal (there's an inaccurate internal oscillator)

>> No.1168134
File: 1.13 MB, 2592x1456, controllers.jpg [View same] [iqdb] [saucenao] [google]
1168134

I made these rhythm game controllers using arduino leo, some microswitches with buttons and rotary encoders. Real simple electronics-wise but was a fun project.

>> No.1168519

I'm making an eight-channel remote controlled robot using an RC plane receiver and an old Spektrum DX8 transmitter. The receiver outputs control commands as pulses, and I've been able to read them using pulseIn.
However, since I'll be operating on eight channels (eight pulse inputs), I would rather use interrupts, like http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with.html is doing. Does anyone have a good tutorial on how to use interrupts? I'm a shit programmer and that guy's code might as well be written in Martian to me.

>> No.1168528

>>1167321
>can I expect an arduino to have the same reliability as a PLC?
Not a chance, we have some PLCs at work that have been quietly chugging along without issue for over 30 years.

>> No.1168600

>>1168134
damn well done! looks very nice.
was it hard?

>> No.1168620

first project, skull with moving jaw and glowing eyes. idk, im by no means a professional and have zero qualifications and was thinking of suicide so why not.

>> No.1168634

>>1167321
PLC reliability is mainly due to careful IO design and other protective shit. Plus watchdog.
I don't know if Arduino itself is somehow flawed (probably not), but certainly you can take its processor and support components, add PLC-tier protection circuits and start the watchdog. You can expect that to be just as reliable as a PLC.

>> No.1168675

>>1168620
Cool idea. Stick your LEDs in a pingpong ball or similar to diffuse the light and make it look more like ominous necromancy glow and less like a shitty school science project.

>> No.1168690

>>1168675
noted. ty.

>> No.1168710
File: 716 KB, 1280x719, inside.jpg [View same] [iqdb] [saucenao] [google]
1168710

>>1168600
Not really. I mean, the project was basically only box-building, lasercutting some parts from acrylic and MDF, painting the box and then wiring everything together and making the code. Since I had access to good tools, the only difficult part was painting and that's because it's something I don't have a lot of experience doing.

The rotary encoders and the buttons play really nicely with arduino, and there're loads and loads of tutorials for every aspect of the project, be it the wiring or how to make the arduino work as a kb+mouse.

Here's a picture taken with a potato that shows the innards of one of the controllers, it's basically just 4 wires to the encoder and then the wires for the microswitches and leds.

>> No.1168771

>>1168634
good info, thanks

>> No.1168946

>>1168134
I had an idea to do a thing like this for a while but am pretty retarded so I don't trust myself to do it unless I'm just copying someone elses project. Cool shit.

>> No.1168994

>>1168620
https://www.youtube.com/watch?v=jEnNCB233eo

>> No.1169143

If I wanted to do traction control for a tracked vehicle, what would be the best way to do that? The way you do it in a wheeled vehicle is by comparing the rate of rotation between the wheels, but on a tracked vehicle the entire track works as one unit and you can't really do that.
It seems to me that I need to compare the relative speed of the ground with the relative speed of the track. I'm thinking I could use two optical mice as odometers to compare how fast each side of the vehicle is moving, and since I know the diameter of the track+drive sprocket, I can calculate how fast the track is moving by checking the RPM of the drive sprocket (two or four small magnets glued evenly spaced to each sprocket wheel, and a Hall Effect sensor).

Would this approach work?

>> No.1169286

>>1165300
no

>> No.1169308

>>1165300
/g/ is mostly threads arguing about Linux, Rust, and various minorities ruining software development. Very little quality content over there.

>> No.1169310

>>1169143
https://www.youtube.com/watch?v=HflJYf60Tkc

maybe of some use?

>> No.1169317

>>1169310
Thank you, that's the method where you compare the wheels to each other I mentioned. Unfortunately this method doesn't work with tracks. Think of the track as a single large wheel, I only have two "wheels", so I can only compare left to right. He's comparing front right to rear left and rear right to front left, which works because only the two rear wheels are powered. He assumes the front wheels will never lose traction, because they just roll freely, so if the rear wheels are faster or slower than the front ones you know you've lost traction, and can adjust the power to the motor accordingly. With tracks, the entire unit moves as one, so you have nothing to compare the speed of the track to. That's why I'm looking into making a makeshift visual odometer to compare the speed of the ground to the speed of the track. If the track is faster or slower than the ground, I've lost traction and can adjust accordingly. With the sensor placed at the middle of the track's surface contact, I can do some basic geometry (one wide circle for the track's path, one narrower for the path of the sensor mounted inside the track) to calculate the effective relative speed of the ground under the track for the differential steering.

>> No.1169322

>>1169317
>two wheel traction control
Look at old truck anti-lock brakes. Old pickups only had two wheel ABS, maybe you could make something based on that system? It compares the speed of the left and right wheels and loosens the braking force if one locks up. As long as your tracks don't both lose traction at the exact same time, it should work on a tank.

>> No.1170373

>>1168675
https://www.youtube.com/watch?v=190ViBKbbz4

>i used latex gloves over the inside of the eye sockets because i only had orange pingpong balls

>> No.1170382

>>1170373
Randomise the action of the servo a little bit, and consider adding a second servo to make the jaw move sideways a bit too.
https://www.youtube.com/watch?v=dHSlETV9hSo

>> No.1170398

>>1170382
thank you i will do this

i eventually want to make it say random things when a button is pressed based on uncle death from let it die.

>> No.1170407

>>1169322
I've tried it, but can't get enough resolution. When I accelerate I lose traction on both tracks before the Hall effect sensor has time to notice a difference in speed between them. I'll give it a second try with the sensor on the gearbox after it arrives, but for now I guess I'll settle for setting a throttle curve to limit the problem.

>> No.1170510

there's a way to control the torque of a motor and set an alarm?
i need a motor to stop and send an alarm if during the rotation it uses too much torque for doing the job cause this mean there's an obstacle

>> No.1170515
File: 24 KB, 480x360, Motor Torque vs. Curent.png [View same] [iqdb] [saucenao] [google]
1170515

>>1170510
Current goes up as torque does.
Maybe you could monitor the voltage across the motor or driver circuit to detect higher current draw.

>> No.1171065

Let's say I made a project that uses about 10 pins. How w I uld I go about making it something I can sell?

>> No.1171066
File: 75 KB, 497x576, hu.jpg [View same] [iqdb] [saucenao] [google]
1171066

>>1171065
what?

>> No.1171198

>>1171065
Get it set up and working on a breadboard. Make a PCB design that does the same things. Pay a company to print a batch of 100 PCBs of your design. Buy sacks of components. Sit at home and solder for days. Get a 3D printer for small and simple mechanical parts, pay to have things manufactured if you want more quality. Put it up for sale.

>> No.1172429

Why the fuck does arduino use that shitty weird USB plug you don't have cables for instead of that common one you have loads of cables from phone chargers for?

>> No.1172757
File: 257 KB, 600x600, 13975-01.jpg [View same] [iqdb] [saucenao] [google]
1172757

>>1172429
Sparkfun and other manufacturers make what you want, but you'll pay more than the cost of a cable for it.

To answer your question, my guess is the full size is size appropriate. Smaller boards have smaller plugs, while the smallest just have pins or holes. The full size plug is, iirc, an order of magnitude more durable based on its expected number of plugging/unplugging actions before possible failure. In my life ive had one full size USB I needed to bend the case back to make it more solid while ive had half a dozen micro USB plugs fail.