Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Arduino?  (Read 3116 times)

0 Members and 1 Guest are viewing this topic.

saint

  • turned to the Dark Side
  • Supreme Chancellor
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6149
  • Last login:Yesterday at 06:47:53 pm
  • I only work in cyberspace...
    • Build Your Own Arcade Controls
Arduino?
« on: September 12, 2012, 04:59:01 pm »
Anyone into Arduino stuff? I'm about to start tinkering with Arduinos, a Raspberry PI, and small motors along with the LEDs I already play with.
--- John St.Clair
     Build Your Own Arcade Controls FAQ
     http://www.arcadecontrols.com/
     Project Arcade 2!
     http://www.projectarcade2.com/
     saint@arcadecontrols.com

Well Fed Games

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1884
  • Last login:January 07, 2025, 04:42:47 pm
  • Delicious!
Re: Arduino?
« Reply #1 on: September 12, 2012, 05:05:51 pm »
Coming soon: Project Skynet: Build Your Own Robot Overlord
Completed projects: Pac bartop (Plug & Play), 30th Anniversary Pac cab (MAME), Point Blank (PS1), Centipede (arcade hardware- light restore), VS. Super Mario Bros (arcade hardware- light restore) Tetris Cocktail (SNES), Arcade Classics upright (60-in-1, then MAME), Multi-Raiden (arcade hardware). Pac Man vs.(Gamecube),

Working on: Pinball Re-theme, Homebrew arcade arena shooter

Vigo

  • the Scourage of Carpathia
  • Global Moderator
  • Trade Count: (+24)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6417
  • Last login:June 25, 2025, 03:09:16 pm
Re: Arduino?
« Reply #2 on: September 12, 2012, 05:17:58 pm »
I always like to see what people do with them on instructables..... never shelled out money to do anything with them though. I'd think there could be some pretty sweet applications for them in the BYOAC world.

usedelectronics

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 358
  • Last login:January 06, 2019, 02:57:37 am
Re: Arduino?
« Reply #3 on: September 12, 2012, 07:21:50 pm »
Yes, I have played with just about every Arduino variant made. They are an excellent platform for someone wanting to get into micro-controllers from the ground floor. The support and accessories available for them is huge, and code examples are readily available.

What else would you like to know?

(sparkfun dot com, and adafruit dot com are excellent resources)

saint

  • turned to the Dark Side
  • Supreme Chancellor
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6149
  • Last login:Yesterday at 06:47:53 pm
  • I only work in cyberspace...
    • Build Your Own Arcade Controls
Re: Arduino?
« Reply #4 on: September 12, 2012, 07:41:03 pm »
Nothing yet, just interested to see who all is out there playing with it. I bought a starter kit from adafruit.com to play with. I have no doubt I'll have questions for the willing at some point :)
--- John St.Clair
     Build Your Own Arcade Controls FAQ
     http://www.arcadecontrols.com/
     Project Arcade 2!
     http://www.projectarcade2.com/
     saint@arcadecontrols.com

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Today at 11:06:50 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Arduino?
« Reply #5 on: September 12, 2012, 08:24:30 pm »
I like the teensy.  It is arduino code compatable but it is a lot cheaper, so it's better suited for single-use projects. 

I hate to change the subject, but check your PM...It's been a month and a week man, I'd sure like to at least get ftp access back into my site. 

lordnacho

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 509
  • Last login:January 21, 2023, 07:38:14 pm
Re: Arduino?
« Reply #6 on: September 12, 2012, 09:09:06 pm »
Was thinking about getting a Lillypad, Halloween just around the corner.  But my wife doesn't agree with lighting up my 3 year old.
Also got a Raspberry Pi in a shoe box on my desk right now, can't get wifi working on it.  Linux :angry:

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: Arduino?
« Reply #7 on: September 12, 2012, 10:14:52 pm »
I've been using the AVR series of microcontrollers (on which the Arduino an derivatives are based) for quite some time - I think longer than the Arduino project has existed.  I've found the Arduino platform itself somewhat unnecessary.  Most models of the micro are readily available in hobbyist/breadboard friendly DIP packages and can be used with essentially zero external components.  The Arduino does give you a nice little bootloader usable over a serial port or USB with an appropriate adapter (built into many Arduino bases), but its capabilities are somewhat limited.

Atmel has their Dragon platform which can be used as not only a programming head but also for on-chip debug (of the smaller parts), and it's comparably priced to an Arduino.  It's a bit more DIY than an Arduino, but it can do a lot more.

I've never been fond of the Arduino programming "language".  It's a nifty use of C++, but the code you end up generating is often quite far from ideal.  Not a big deal in a hobbyist application, I guess, but when you're trying to cram your program onto the 2k version of the chip to save 5 cents per unit, it makes a difference :)

These days, I really prefer the ARM Cortex-M series to AVR.  I really only use AVR anymore if I want to run something at 5V or have a REALLY small application (e.g. for the aforementioned 2k chip) in low-mid volume cost sensitive application where I just plain don't need the capabilities or pin count of even the smallest Cortex-M0 parts.  AVR isn't bad, it's just getting a bit long in the tooth.  The architecture dates from the late 90s, which is quite a long time in the computing world.  I dunno if anyone has an Arduino equivalent using ARM CM0.  I'd suspect probably, and it may even be bootloader and language (but not binary application, of course) compatible.  That should be doable, at least.

As for the RasPi, it's neat, but mostly because it's cheap.  The SoC they picked is actually kinda crappy to run general purpose Linux on.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Today at 11:06:50 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Arduino?
« Reply #8 on: September 12, 2012, 10:49:23 pm »

I've never been fond of the Arduino programming "language".  It's a nifty use of C++, but the code you end up generating is often quite far from ideal.  Not a big deal in a hobbyist application, I guess, but when you're trying to cram your program onto the 2k version of the chip to save 5 cents per unit, it makes a difference :)



What he said.  I was going to mention it before, but I always seem to throw these threads in a negative direction... but since somebody else already has.... :D

The arduino "hardware" is good, if you can all it that... it's normally just your typical amtel chip with some nice i/o pins.... doesn't really have anything to do with the language, but it's marketed that way.  The software is good IF you are wanting to do something very simple, or if you are a little weak on your microprocessor programming (which admittedly I am).  For example, you can turn a avr into a hid joystick with just a few clicks using the arduino interface... but if you want to do anything advanced with said HID joystick in terms of monitoring i/o pins, you are probably better off using assembly or a more "straight c" programming language. 

Luckily it doesn't really matter.  As I've said, the hardware is just generic avr stuff for the most part, so you can put anything on it and the arduino language is pretty good for beginners projects, so you can build up as you go.   

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: Arduino?
« Reply #9 on: September 13, 2012, 12:28:05 am »
Honestly, I think I've used straight assembly on an AVR...maybe 2 times?  Once was on an old tiny11, which has NO RAM and is therefore a bit tough to program in C (though not impossible!). The other was for a "bit swap" function; the compiler didn't optimize it very well, and it was in a hot path for me.

Now, I frequently look at a disassembly of what the compiler puts out to see what it's doing.  Often, some minor tweaks to the input (C or C++) can convince it to generate substantially better output.  However, I've only ever actually directly written assembly on an AVR those two times that I can recall.  The compilers for it (well, at least GCC, which is what you're probably using) are pretty good, and the arch was designed originally to be reasonably C-compiler friendly.  Now, you can probably out-optimize the compiler in many cases if you want, but the compiler is good enough that it seems to be rarely necessary.

There is some bare assembly in the C library for the crt0 (setting up the stack, clearing .bss, initializing .data, etc.) as well as optimized implementations of floating point, division, and (for MCUs without the appropriate hardware) multiplication, but you should never have to touch it.

The Arduino libraries, and the simple fact that they're based on some of the "nice" features of C++ that carry runtime overhead, are the major cause of inefficiency when using them.  The overhead isn't outrageous, but carefully written straight C can do quite a bit better and approach the efficiency (speed/size) of hand-tuned assembly in many cases.  The compiler also has some options to do speed vs. size tradeoffs automatically whereas you'd have to re-write your assembly to do that.

ARM is also of course compiler friendly.  In fact, you can bring up a Cortex-M from the bare series with no assembly whatsoever.  The last project I did with an ARM CM4 only had a little inline assembly to make it easier to implement the exception vectors in C (by passing the exception SP in as a parameter to the "function" that implemented it).

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: Arduino?
« Reply #10 on: September 13, 2012, 01:07:03 am »
Yeah, I have to echo what MonMotha basically said. I think the arduino series is very nice and all but I just don't like the overhead that it incurs. When I look at people using the Arduino, I think back to my Visual Basic days.

For a lot of projects, the platform really does get the job done and quickly I might add. But when you find yourself diving into straight C/C++ or digging down into assembly because of some defect in the platform, it's definitely time to move on. The important part is seeing when that happens. I didn't see that with Visual Basic and I found myself, no joke, with an app (that no longer exists) and book that documented every single known C/C++ library call for the Windows environment and the VB formatted call. In other words I was bypassing many of VB's built in ActiveX stuff and going straight for the system DLL's. Before I dropped VB entirely, I was handcrafting ASM inside VB itself. I think there was even a group for that, ExtremeVB.com or somesuch. If I recognized what I was doing and that C++ or C could have gotten me down that road a hell of a lot faster I'd be in a far different place now.

I really like the 8-bit AVR's and one is going straight into a current project. But I paid around $15 for an arduino compatible board though I don't use the arduino platform. For comparison, I just shelled out <$10 for two ARM M4F boards which I hope will ship soon. The price difference is astonishing. And there is an Arduino-style platform that just came out not too long ago for the ARM controllers so it'll get real interesting in a hurry.

saint

  • turned to the Dark Side
  • Supreme Chancellor
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6149
  • Last login:Yesterday at 06:47:53 pm
  • I only work in cyberspace...
    • Build Your Own Arcade Controls
Re: Arduino?
« Reply #11 on: September 13, 2012, 09:16:33 am »
Well I'm starting from the beginning here. Way back in the day I was a CS programming major in college (Fortran, Pascal, Cobol, C, C+, 808x assembler, Basic, probably something else archaic I've forgotten) but I haven't used any of my programming skills for anything serious in a long time.

I've been playing with LEDs in this hobby somewhat, but seriously started playing with them in the last year or so. Of course, there really isn't much to playing with LEDs if all you're doing is turning them on/off (ledcalc.com is my friend). Battery, resistor, and soldering. 

I'm wanting to get into playing with motors, relays, sensors, and having LEDs do something other than turn on and off (illuminate in sequences, respond to inputs, etc). My goal is costuming and haunted house and other geek-related special effects.

While I hear what you guys are saying about the limitations, Arduino and PI seemed like good ways to get my feet wet. Any other suggestions for getting started?
--- John St.Clair
     Build Your Own Arcade Controls FAQ
     http://www.arcadecontrols.com/
     Project Arcade 2!
     http://www.projectarcade2.com/
     saint@arcadecontrols.com

kahlid74

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1366
  • Last login:January 01, 2021, 12:42:56 pm
  • Gaming for a better future!
    • GamersAnon
Re: Arduino?
« Reply #12 on: September 13, 2012, 10:14:55 am »
I'm still pretty new to the Arduino but I use mine to interface with a stepper motor and rotate a 42" TV in my pedestal cabinet.

Works very well and is mostly intuitive.  I would recommend getting books with working examples.  It's so much easier to grasp.

I also plan to use an Arduino in my Battletech Pod to open and close the doors and move the three monitors into position after the door has been closed.

saint

  • turned to the Dark Side
  • Supreme Chancellor
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6149
  • Last login:Yesterday at 06:47:53 pm
  • I only work in cyberspace...
    • Build Your Own Arcade Controls
Re: Arduino?
« Reply #13 on: September 13, 2012, 10:25:25 am »
I've purchased this book to start with: http://www.amazon.com/gp/product/B004TI7IGI/ . Recommend any others in particular?
--- John St.Clair
     Build Your Own Arcade Controls FAQ
     http://www.arcadecontrols.com/
     Project Arcade 2!
     http://www.projectarcade2.com/
     saint@arcadecontrols.com

Mysterioii

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 398
  • Last login:August 31, 2018, 11:44:34 am
Re: Arduino?
« Reply #14 on: September 13, 2012, 11:33:35 am »
I'm a EE but actually hadn't done much electronics-wise for several years (been doing "legacy software" support), but I used an arduino in a project I needed to do, to "get back into things" as it were.  A lot of people bash them, actually, but you have to take them for what they are.  Some people say "just use your own microcontroller, the chip itself is only three bucks", which is true, but with the arduino they're saving you some time and there's a big community out there so you can find lots of libraries and examples all over the web.  For some things, it's woefully underpowered, for some things it's fine.

A bit about my project...  We have a sewage pump station across the street from us, and "something" allows rainwater into the sewer system whenever it rains (this is not supposed to be a combined system, but things happen).  Additionally our house was actually built really too low with respect to that system...  if it rains really hard we can have water backup into the house through the plumbing.  We have a manual shutoff valve to close off the main sewer line, but of course you have to know that there's a problem.  (By the way, the sewer company is allegedly going to be reconstructing this whole system over the next few years, so the problem should go away eventually, but in the meantime I'd prefer not to get other people's poop water in my basement).

What this project does for me is:

Has 8 water sensors in various locations of my basement.

Has a buzzer acting as an alarm, located in the cold air return right at the master bedroom.
     Has a mute switch to disable the buzzer if you know there’s a problem and would rather not keep hearing the buzzer go off.

Has tilt switches on the sewer shutoff valve so I know when the valve is closed.
     Automatically removes power to the sewer ejector pump in the basement when the valve is closed to prevent it pumping waste water into the sewer line when it can’t drain out of the house.  I have built-in redundancy as a failsafe mechanism… Two tilt switches, two relays.  I have feedback signals on the relays to ensure that they are opening and closing correctly, and use the buzzer to provide audible feedback when you close or open the valve so you know the relays actuated.

Runs on battery backup from a pretty beefy UPS.

I hacked a line from the beeper in the UPS itself and ran it to an input on the microcontroller so the system knows it’s on battery backup and alerts me.

Uses a GPIO expander chip that communicates with the microcontroller using the I2C protocol because I needed a lot more digital inputs.

Utilizes a temperature/humidity sensor module.

Incorporates an external watchdog timer chip to reset the system if it should ever lock up.

Acts as a web server so I (or anyone else) can check a detailed status of the system from anywhere in the world at any time.

Acts as an email client and automatically sends me an email whenever water is detected, the valve is closed or the system switches to battery backup. 

Has an RGB LED status indicator located on the device and another run up to a panel by the door from the garage, giving at-a-glance feedback to whether water is detected, the valve is closed, or everything is fine.

Additional LED indicators on the device indicate web activity, email activity and proper watchdog timer function.


The heart of the system is an arduino with an ethernet shield, but I did design and build an interface board included in the system that includes buffer circuitry for all the water sensors, the GPIO expander chip, the temp/humidity module, relay and speaker mosfet drivers, an optoisolator for the UPS “on battery” circuit, the watchdog timer chip and a voltage regulator. 

Despite what I consider to be a pretty full set of features all things considering, the code compiles to only about 19KB.  The system has been running 24/7 since about February without any hiccups, and it’s correctly alerted me several times to such things as a power outage, my wife closing the sewer valve, water from a dripping cleanout valve on a water heater, etc.

I've used the arduinos for several other things, but this project was by far the most involved.  I'm pretty proud of it...  I'll try to get some pics posted later.

HaRuMaN

  • Supreme Solder King
  • Global Moderator
  • Trade Count: (+45)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 10328
  • Last login:July 23, 2025, 07:04:20 pm
  • boom
    • Arcade Madness
Re: Arduino?
« Reply #15 on: September 13, 2012, 11:37:33 am »
 :dizzy:

Mysterioii

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 398
  • Last login:August 31, 2018, 11:44:34 am
Re: Arduino?
« Reply #16 on: September 13, 2012, 01:11:29 pm »
Haha I hope that's a good " :dizzy:".....   A lot of arduino projects seem to be of the "blinky lights" variety (and in fact, I've used them for that), but I think this is a good example of what those little 8-bit uC's are capable of...  and honestly I'm sure my code isn't remotely optimized... I've always been more of the "just get it to work" kinda guy...    :lol

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: Arduino?
« Reply #17 on: September 13, 2012, 02:34:54 pm »
I'm a EE but actually hadn't done much electronics-wise for several years (been doing "legacy software" support), but I used an arduino in a project I needed to do, to "get back into things" as it were.  A lot of people bash them, actually, but you have to take them for what they are.  Some people say "just use your own microcontroller, the chip itself is only three bucks", which is true, but with the arduino they're saving you some time and there's a big community out there so you can find lots of libraries and examples all over the web.  For some things, it's woefully underpowered, for some things it's fine.

A bit about my project...  We have a sewage pump station across the street from us, and "something" allows rainwater into the sewer system whenever it rains (this is not supposed to be a combined system, but things happen).  Additionally our house was actually built really too low with respect to that system...  if it rains really hard we can have water backup into the house through the plumbing.  We have a manual shutoff valve to close off the main sewer line, but of course you have to know that there's a problem.  (By the way, the sewer company is allegedly going to be reconstructing this whole system over the next few years, so the problem should go away eventually, but in the meantime I'd prefer not to get other people's poop water in my basement).

What this project does for me is:

Has 8 water sensors in various locations of my basement.

Has a buzzer acting as an alarm, located in the cold air return right at the master bedroom.
     Has a mute switch to disable the buzzer if you know there’s a problem and would rather not keep hearing the buzzer go off.

Has tilt switches on the sewer shutoff valve so I know when the valve is closed.
     Automatically removes power to the sewer ejector pump in the basement when the valve is closed to prevent it pumping waste water into the sewer line when it can’t drain out of the house.  I have built-in redundancy as a failsafe mechanism… Two tilt switches, two relays.  I have feedback signals on the relays to ensure that they are opening and closing correctly, and use the buzzer to provide audible feedback when you close or open the valve so you know the relays actuated.

Runs on battery backup from a pretty beefy UPS.

I hacked a line from the beeper in the UPS itself and ran it to an input on the microcontroller so the system knows it’s on battery backup and alerts me.

Uses a GPIO expander chip that communicates with the microcontroller using the I2C protocol because I needed a lot more digital inputs.

Utilizes a temperature/humidity sensor module.

Incorporates an external watchdog timer chip to reset the system if it should ever lock up.

Acts as a web server so I (or anyone else) can check a detailed status of the system from anywhere in the world at any time.

Acts as an email client and automatically sends me an email whenever water is detected, the valve is closed or the system switches to battery backup. 

Has an RGB LED status indicator located on the device and another run up to a panel by the door from the garage, giving at-a-glance feedback to whether water is detected, the valve is closed, or everything is fine.

Additional LED indicators on the device indicate web activity, email activity and proper watchdog timer function.


The heart of the system is an arduino with an ethernet shield, but I did design and build an interface board included in the system that includes buffer circuitry for all the water sensors, the GPIO expander chip, the temp/humidity module, relay and speaker mosfet drivers, an optoisolator for the UPS “on battery” circuit, the watchdog timer chip and a voltage regulator. 

Despite what I consider to be a pretty full set of features all things considering, the code compiles to only about 19KB.  The system has been running 24/7 since about February without any hiccups, and it’s correctly alerted me several times to such things as a power outage, my wife closing the sewer valve, water from a dripping cleanout valve on a water heater, etc.

I've used the arduinos for several other things, but this project was by far the most involved.  I'm pretty proud of it...  I'll try to get some pics posted later.

Holy hell dude. This is a prime example of what you should do with an Arduino. Blinking lights and game controller adapters are fine and dandy. But a full blown finished project that touches on at least a dozen different concepts is what people need to see.

But uh... A sewer valve? Is that something you had installed or the city put it in or....?
« Last Edit: September 13, 2012, 02:37:28 pm by SavannahLion »

Mysterioii

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 398
  • Last login:August 31, 2018, 11:44:34 am
Re: Arduino?
« Reply #18 on: September 13, 2012, 02:53:42 pm »
It's something the city paid for...  it is a LONG story, we had an event where water came back into the house shortly after we moved in...  The sewer district gave us some lines about "we're not responsible for record rainfall, which is what we got...", so out of the kindness of their hearts they paid for the shutoff valve to be installed.  Then it turned out that the pump station really just can't keep up with demand.  We probably should have sued, but I hate to get engaged in things like that, especially with the city.  They are supposed to be eliminating the pump station and hooking us up with a new sewer system on down the hill from us so we will no longer be the lowest spot at the end of the line...  but it's not estimated to be done until 2015.  So, for now we keep an eye on things and close that valve whenever the "high water" warning light on the pump station is going off or when we know we're going to be away from the house when rain is in the forecast.

Major pain in the butt, man...

And thanks, by the way.   :cheers:
« Last Edit: September 13, 2012, 03:52:13 pm by Mysterioii »