[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Arduino Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 52
Thread images: 13

File: arduino.png (426KB, 551x405px) Image search: [Google]
arduino.png
426KB, 551x405px
ITT post anything related to arduino

Anything goes

>projects
>advice
>help
>>
>>1165266
/g/ would probably be a better place for this, no?
>>
File: ir seq1.jpg (201KB, 1632x1224px) Image search: [Google]
ir seq1.jpg
201KB, 1632x1224px
>>1165683
agreed

I'd like to see some uC projects. It was /diy/ that inspired me to get one in the first place.
>>
The only kind of thread we ever get is "whadda I do wit de Ardy" and "give me idea for Raspy proj pls" though.
>>
>>1165709
I like it
>>
File: 20161122_230038.jpg (3MB, 4128x2322px) Image search: [Google]
20161122_230038.jpg
3MB, 4128x2322px
>>1165709

Interesting. What's your project?
>>
>>1165850

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

Are you getting codes from known remotes or just dicking around?
>>
>>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
>>
im making a code to dim LEDs, does anybody know where i can find one, that is already made :)
>>
File: hqdefault (6).jpg (7KB, 480x360px) Image search: [Google]
hqdefault (6).jpg
7KB, 480x360px
>>1165272
Unironically is a cencerous faggot.

Starts thread with kys and then shits on OP.

Honestly doesnt realise what a faggot he is being.
>>
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?
>>
>>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.
>>
>>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
>>
>>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.
>>
>>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
>>
>>1166008
What's your baud rate? How do you manage the read rate on the Arduino end? That's a really long line too.
>>
File: 40j12e2a.png (297KB, 8664x4256px) Image search: [Google]
40j12e2a.png
297KB, 8664x4256px
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.
>>
File: 1493122259687.gif (2MB, 640x348px) Image search: [Google]
1493122259687.gif
2MB, 640x348px
I wanna get into this sort of stuff as it is interessing for me.
Where should I start?
>>
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
>>
File: AK Electronic Brick Kit 020.jpg (268KB, 750x750px) Image search: [Google]
AK Electronic Brick Kit 020.jpg
268KB, 750x750px
>>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.
>>
File: Rotary_Stepper_Schematic.png (68KB, 1024x708px) Image search: [Google]
Rotary_Stepper_Schematic.png
68KB, 1024x708px
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?
>>
>>1167710
https://www.arduino.cc/en/tutorial/stepperSpeedControl
https://www.arduino.cc/en/reference/stepper
>>
>
>>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)
>>
File: controllers.jpg (1MB, 2592x1456px) Image search: [Google]
controllers.jpg
1MB, 2592x1456px
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.
>>
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.
>>
>>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.
>>
>>1168134
damn well done! looks very nice.
was it hard?
>>
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.
>>
>>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.
>>
>>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.
>>
>>1168675
noted. ty.
>>
File: inside.jpg (716KB, 1280x719px) Image search: [Google]
inside.jpg
716KB, 1280x719px
>>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.
>>
>>1168634
good info, thanks
>>
>>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.
>>
>>1168620
https://www.youtube.com/watch?v=jEnNCB233eo
>>
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?
>>
>>1165300
no
>>
>>1165300
/g/ is mostly threads arguing about Linux, Rust, and various minorities ruining software development. Very little quality content over there.
>>
>>1169143
https://www.youtube.com/watch?v=HflJYf60Tkc

maybe of some use?
>>
>>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.
>>
>>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.
>>
>>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
>>
>>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
>>
>>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.
>>
>>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.
>>
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
>>
File: Motor Torque vs. Curent.png (24KB, 480x360px) Image search: [Google]
Motor Torque vs. Curent.png
24KB, 480x360px
>>1170510
Current goes up as torque does.
Maybe you could monitor the voltage across the motor or driver circuit to detect higher current draw.
>>
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?
>>
File: hu.jpg (75KB, 497x576px) Image search: [Google]
hu.jpg
75KB, 497x576px
>>1171065
what?
>>
>>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.
>>
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?
>>
File: 13975-01.jpg (257KB, 600x600px) Image search: [Google]
13975-01.jpg
257KB, 600x600px
>>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.
Thread posts: 52
Thread images: 13


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.